Abstract
Barren plateaus — the exponential vanishing of cost-function gradients as a variational quantum circuit is scaled — are the central obstacle to training quantum machine-learning models, and diagnosing them today requires expensive gradient sampling on each candidate circuit. We reframe barren-plateau diagnosis as supervised prediction: given only a circuit's architecture (qubit count, depth, ansatz type, entanglement pattern, entangler gate, and cost-observable locality), can a classical model predict its trainability without sampling a single gradient? Using this simulator's exact statevector engine we generate 20,000 random variational circuits, each labelled by the gradient variance measured over 200 random parameter vectors via the parameter-shift rule. A gradient-boosted model predicts the trainability and, crucially, extrapolates from small circuits to larger qubit counts that are progressively harder to simulate. We make no quantum-advantage claim — this is classical machine learning about quantum circuits, offering a cheap ansatz-screening heuristic.
Method
Each data point is a random circuit spec. The circuit is built and simulated
exactly with this project's qsim statevector engine; the parameter-shift
gradient of the cost is sampled over 200 random parameter vectors to form the
gradient-variance label y. Cheap closed-form architectural features X are
read directly from the spec. A gradient-boosted model is trained on (X, y)
to predict trainability — as regression (log10 of the gradient variance) and
as classification (barren vs. trainable).
Dataset
The design space is sampled independently and uniformly. Every circuit is seeded reproducibly, so the exact dataset regenerates from a single command (below).
| Design choice | Count | Mean log10Var | Barren % |
|---|---|---|---|
| Local cost Z0 | 9,974 | −2.33 | 30.9% |
| Global cost Z⊗n | 10,026 | −4.49 | 62.4% |
| Entanglement: linear | 6,649 | −2.50 | 38.5% |
| Entanglement: all-to-all | 6,603 | −4.79 | 52.8% |
The data reproduces barren-plateau theory directly: global cost observables are ~2 orders of magnitude more barren than local ones, exactly the cost-locality effect predicted by Cerezo et al. (2021).
Results
We compared six model families on both a random hold-out split and an extrapolation split (train on ≤10 qubits, test on larger). Gradient-boosted trees won both tasks.
| Model | Reg. R² (hold-out) | Reg. R² (extrap.) | AUC (hold-out) | AUC (extrap.) |
|---|---|---|---|---|
| Hist Gradient Boosting | 0.685 | 0.719 | 0.991 | 0.989 |
| MLP (neural net) | 0.665 | 0.752 | 0.990 | 0.991 |
| k-NN | 0.645 | 0.639 | 0.986 | 0.979 |
| Random Forest | 0.640 | 0.716 | 0.985 | 0.988 |
| Extra Trees | 0.610 | 0.707 | 0.968 | 0.988 |
| Linear baseline | 0.274 | 0.297 | 0.953 | 0.889 |
Reproduce it yourself
The entire study — data generation, model training, model comparison, and the paper's figures/tables — regenerates from the open-source repository with fixed random seeds. On any machine with Python 3.10+:
1Get the code and install dependencies
git clone https://github.com/bithabib/quantum_computer_simulator.git cd quantum_computer_simulator python3 -m venv .venv && source .venv/bin/activate pip install -r qml_bp/requirements.txt
2Quick sanity check (~1 minute, small dataset)
python -m qml_bp.generate --n-specs 300 --samples 80 --qubit-max 8 --out data_bp/sample.csv python -m qml_bp.train --data data_bp/sample.csv
3Regenerate the full 20,000-circuit dataset
(set --workers to your core count; ~1 hour on 16 cores)
python -m qml_bp.generate --n-specs 20000 --samples 200 \
--qubit-min 2 --qubit-max 12 --layer-min 1 --layer-max 20 \
--workers "$(nproc)" --out data_bp/bp_dataset.csv
4Train, compare models, and describe the data
# headline model + extrapolation split + feature importance python -m qml_bp.train --data data_bp/bp_dataset.csv # compare six model families (picks the best) python -m qml_bp.compare_models --data data_bp/bp_dataset.csv # dataset descriptive-statistics tables python -m qml_bp.describe_data --data data_bp/bp_dataset.csv --outdir paper/latex
5Rebuild the paper figures and PDFs
python paper/latex/make_figures.py --data data_bp/bp_dataset.csv python paper/latex/fill_results.py --data data_bp/bp_dataset.csv # syncs numbers into all papers (cd paper/ieee-access && ./build.sh) # IEEE Access PDF (cd paper/mdpi && ./build.sh) # MDPI Entropy PDF
SeedSequence, and all models use fixed random_state, so the numbers
above regenerate exactly. Labels are computed with the ideal (noiseless) statevector
simulator; hardware noise is out of scope.
Code & data
Source repository Try the Quantum Lab Interactive experiments
The qml_bp/ package (data generation,
training, model comparison) and the qsim/ statevector simulator that produces the
labels are both in the repository. The dataset is regenerable end-to-end; it is not committed
because it is large and deterministic.