Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.98 KB

File metadata and controls

93 lines (67 loc) · 3.98 KB

Wishart n=50 α=0.50 Example

This example demonstrates the stochastic benchmarking framework applied to Wishart problem instances.

Prerequisites

Additional Dependencies

This example has different dependencies depending on what you want to do:

For Running Analysis Only (using pre-generated data):

pip install -r ../../requirements.txt
pip install -r ../../requirements-examples.txt

This 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

For Generating New Experimental Data:

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.txt

requirements-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.

Data Files

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

Running the Example

  1. Ensure you have the data files in the appropriate directories (see structure above)

  2. Install dependencies:

    pip install -r ../../requirements.txt
    pip install -r ../../requirements-examples.txt
  3. 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.

What This Example Demonstrates

  • 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)

Key Files

  • 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

Notes

  • The paths in wishart_ws.py and wishart_runs.py have 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()