Skip to content

Repository files navigation

QAOA RBM Annealing Dashboard

Desktop dashboard and simulation workflow for studying QAOA-based annealing on RBM-inspired Ising models.

The project lets you sweep delta_t, compare estimated kappa against KL-divergence, and generate plots and result files for different visible/hidden-node configurations.

Overview

This repository contains two main usage paths:

  • beta_kl_dashboard.py Opens a Tkinter desktop dashboard for interactive parameter sweeps and live plotting.

  • QAOAAnnealing_Modified.py Runs the simulation directly from the command line for scripted experiments.

Supporting modules:

  • plot_beta_vs_kl.py Loads saved results and exports a styled Kappa vs KL-Divergence figure.
  • rbm_config.py Builds RBM parameter configurations shared across the workflow.
  • rbm_kl_curve.py Generates the analytical KL-vs-kappa reference curve.

Requirements

  • Python 3
  • Qiskit
  • Qiskit Aer
  • Qiskit Optimization
  • NumPy
  • SciPy
  • Matplotlib

Install everything with:

python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt

If you want a one-step launcher on Windows, use:

.\run_dashboard.ps1

Or the double-clickable wrapper:

.\run_dashboard.bat

Run the Dashboard

.\.venv\Scripts\python.exe .\beta_kl_dashboard.py

The launcher is the safer option on a fresh checkout because it creates the virtual environment automatically when needed. If it reports that Tkinter could not initialize, repair or reinstall your local Python with Tcl/Tk support and rerun the launcher.

The dashboard supports:

  • delta_t sweep ranges
  • number of sweep points
  • circuit depth and shots
  • number of visible and hidden nodes
  • annealing schedule selection
  • Hamiltonian normalization selection
  • optional sampled-count threshold filtering
  • saved plots and JSON outputs for each run

Run from the Command Line

Example:

.\.venv\Scripts\python.exe .\QAOAAnnealing_Modified.py --delta-t-values 0.01 0.02 0.03 --reps 100 --shots 1000000 --num-visible-nodes 7 --num-hidden-nodes 2 --hamiltonian-normalization largest-eigenvalue

Useful options include:

  • --delta-t-values
  • --delta-t-file
  • --reps
  • --shots
  • --num-visible-nodes
  • --num-hidden-nodes
  • --annealing-schedule
  • --enable-count-threshold-filter
  • --rbm-seed
  • --hamiltonian-normalization
  • --kappa-estimator
  • --execution-mode
  • --aer-device

Annealing Schedules

  • linear Uses gamma(u) = u and beta(u) = 1 - u.
  • dwave-like Uses the smooth D-Wave-inspired cubic schedule present in the project.
  • linear-to-dwave Blends from the linear schedule toward the D-Wave-like schedule around the normalized midpoint, near kappa ~= 0.5.

Normalization Modes

  • max-coefficient Divides the Ising Hamiltonian by the largest absolute Pauli coefficient.
  • largest-eigenvalue Divides the Ising Hamiltonian by its spectral radius, max(|lambda_max|, |lambda_min|).

Output Files

Typical runs can generate:

  • results JSON files with delta_t, kappa_hat, kl_divergence, RBM sizes, seed, and normalization metadata
  • a final Kappa vs KL-Divergence plot
  • an optional minimum-KL diagnostic plot

Notes

  • Hidden nodes refers to the size of a single hidden RBM layer.
  • If --rbm-seed is omitted, a fresh random seed is generated and saved with the results.
  • The analytical reference curve reuses the same saved RBM seed so the comparison stays consistent with the sampled run.
  • On this Windows setup, Aer currently reports CPU-only availability.

About

Open code repository for reproducibility.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages