This example demonstrates the stochastic benchmarking framework applied to Wishart problem instances.
This example has different dependencies depending on what you want to do:
pip install -r ../../requirements.txt
pip install -r ../../requirements-examples.txtThis installs the core stochastic-benchmark dependencies plus:
- scikit-learn - Required for polynomial regression models in parameter recommendation
- nbconvert and ipykernel - Required for reproducible command-line notebook execution
If you want to generate new data (not just analyze existing results), you also need:
- Hyperopt - Required for
wishart_runs.run_hyperopt() - PySA - For running simulated annealing experiments
Install the generation dependencies from this directory with:
pip install -r ../../requirements-generation.txtrequirements-generation.txt includes a temporary setuptools<81 compatibility pin for Hyperopt 0.2.7, which imports pkg_resources. This pin is only for generation workflows and is not required to run analysis notebooks.
These generation-only dependencies are imported lazily by wishart_runs.py, so importing the analysis helpers in wishart_ws.py does not require them.
The analysis notebooks (wishart_n_50_alpha_0.50.ipynb and wishart_n_50_alpha_0.50_split.ipynb) require the core stochastic-benchmark dependencies and the example dependency set, and work with pre-generated data files without Hyperopt or PySA.
The example expects the following directory structure relative to this folder:
wishart_n_50_alpha_0.5/
├── wishart_ws.py # Main analysis functions
├── wishart_runs.py # Experimental run functions
├── wishart_n_50_alpha_0.50.ipynb # Main analysis notebook
├── rerun_data/ # Experimental results (pickled data)
│ ├── hpoTrials_warmstart=*_trial=*_inst=*.pkl
│ └── ...
└── wishart_planting_N_50_alpha_0.50/ # Problem instances
├── wishart_planting_N_50_alpha_0.50_inst_*.txt
└── gs_energies.txt # Ground state energies
-
Ensure you have the data files in the appropriate directories (see structure above)
-
Install dependencies:
pip install -r ../../requirements.txt pip install -r ../../requirements-examples.txt
-
Run the Jupyter notebook from the command line:
python -m jupyter nbconvert --to notebook --execute --inplace wishart_n_50_alpha_0.50.ipynb
You can also open the notebook in a Jupyter UI if you have one installed.
- Loading experimental data from multiple parameter configurations
- Bootstrap resampling for statistical analysis
- Interpolation across resource levels
- Computing virtual best (oracle) performance
- Comparing different parameter recommendation strategies
- Generating performance plots (Window Stickers)
- wishart_ws.py: Contains
stoch_bench_setup()which initializes the benchmarking framework with Wishart-specific configuration - wishart_runs.py: Functions for running QAOA/simulated annealing experiments on Wishart instances
- wishart_paths.py: Shared path and filename helpers used by both analysis and generation code
- wishart_n_50_alpha_0.50.ipynb: Main analysis notebook with visualization
- The paths in
wishart_ws.pyandwishart_runs.pyhave been configured to use relative paths for portability - If you encounter permission errors, ensure you're running the notebook from the correct directory
- The example uses polynomial regression models (via scikit-learn) for parameter recommendation strategies
- Hyperopt is only needed when generating new data through
wishart_runs.run_hyperopt()