Comparing quantum data encoding strategies for variational classifiers

Comparing quantum data encoding strategies (angle, amplitude, IQP, ZZ feature map) for variational quantum classifiers on small low-dimensional binary classification tasks

Quantum data encoding is widely regarded as the bottleneck of variational
quantum machine learning. The way classical features are loaded into a
quantum state determines what functions the subsequent variational ansatz
can express. Three encoding families are compared here: angle encoding
(single-qubit rotations only, no input entanglement), amplitude encoding
(information-dense state preparation that loads the classical vector as
state amplitudes), and the ZZ feature map (Hadamards plus diagonal
pairwise phase rotations, injecting entanglement at the input layer).

The research question is direct. Holding the variational ansatz, the
classical optimizer, the simulator backend, and the dataset preprocessing
fixed, which encoding produces the best test accuracy on a moderately
difficult 6D binary classification task, and does at least one quantum
encoding approach the better of two classical baselines (logistic
regression and a small MLP)?

Implementation guidance is provided by the `quantum-qiskit` skill, which
is automatically injected into the stage-10 code generation prompt for
this topic. Use the skill's reference patterns verbatim: import
`ZFeatureMap`, `StatePreparation`, and `ZZFeatureMap` from
`qiskit.circuit.library`; use `qiskit_machine_learning.algorithms.VQC`
with the reference Sampler primitive for training; never roll a custom
optimization loop. Hand-written gate sequences in place of these
library classes have been observed to produce degenerate ablations
(three encodings collapsing to nearly identical computations) and will
fail the rubric.

Experimental protocol. All three quantum encodings share EfficientSU2
reps=1 linear entanglement as the variational ansatz, COBYLA maxiter=200
as the optimizer, and the noiseless statevector backend as the simulator.
Two classical baselines (LogisticRegression and MLPClassifier) run on
the same 6D features. Five random seeds per cell across 5 conditions
yields 25 total cells. Each per-seed result is logged to stdout as a
single line with the prefix `METRIC_RESULT` followed by a JSON object
containing `condition`, `dataset`, `seed`, and `test_accuracy` keys so
the autoclaw sandbox parser can collect structured metrics.

Research question: *On a moderately difficult 6D binary classification
task (LogisticRegression baseline expected around 0.65 to 0.80), does
the choice of quantum encoding (angle, amplitude, ZZ) measurably change
variational classifier accuracy, and does at least one quantum encoding
approach the better classical baseline?*

The best of the three quantum encodings (5-seed mean) achieves test_accuracy within 5 absolute percentage points of the BETTER of the two classical baselines (logistic_regression and mlp_classifier, 5-seed means) on synthetic_classification_6d.

The spread of test_accuracy across the three quantum encodings (max minus min of the 5-seed means) is at least 5 absolute percentage points, demonstrating that encoding choice produces a measurable effect rather than a wash.

zz_feature_map test_accuracy (5-seed mean) is at least as high as angle_encoding test_accuracy (within 2 absolute percentage points or higher), consistent with the conjecture that entanglement-rich input encoding does not hurt and may help on this task.

On a moderately difficult 6D binary classification task, does the choice of quantum data encoding (angle, amplitude, ZZ feature map) measurably change variational classifier accuracy, and does at least one encoding approach the classical baseline?

qiskit.circuit.library.ZFeatureMap(feature_dimension=6, reps=1) as the data encoding circuit. Each feature x_i is loaded as H followed by RZ(x_i) on qubit i. No entangling gates in the feature map.

qiskit.circuit.library.StatePreparation on the L2-normalized, zero-padded input vector (length 64 = 2**6) as the data encoding circuit. Implementation: x_normalized = x / ||x||; x_padded = np.concatenate([x_normalized, np.zeros(64 - 6)]); StatePreparation(x_padded). The padded state is unit norm by construction.

qiskit.circuit.library.ZZFeatureMap(feature_dimension=6, reps=2, entanglement='linear') as the data encoding circuit. Two repetitions of H + RZ(x_i) on each qubit + RZZ(x_i * x_j) on linear nearest-neighbor pairs.

logistic_regression: sklearn.linear_model.LogisticRegression(max_iter=1000) on the same 6D features.

mlp_classifier: sklearn.neural_network.MLPClassifier(hidden_layer_sizes=(16,), activation='relu', solver='adam', max_iter=500, random_state=seed) on the same 6D features.

Both baselines reported per seed; both contribute to the H1 comparison (the BETTER of the two is the reference). Neither contributes to the primary quantum_test_accuracy_mean metric.

Primary metric. Mean of the 5-seed test_accuracy means across the THREE quantum encodings ONLY. The classical baseline is reported separately and does NOT contribute to this metric. This isolates the refinement signal from the baseline.

Per-condition mean accuracy on the 20% held-out test split, averaged over 5 random seeds. Reported per condition (angle, amplitude, zz_feature_map, logistic_regression).

max(logistic_regression_5seed_mean, mlp_classifier_5seed_mean). Used as the reference point in H1 (the stronger of the two classical baselines).

make_classification(n_samples=400, n_features=6, n_informative=4, n_redundant=1, n_repeated=0, n_clusters_per_class=2, class_sep=0.4, flip_y=0.05, random_state=seed). class_sep is set to 0.4 (not 1.0) so the LogisticRegression baseline lands around 0.65-0.80 instead of saturating near 1.0, leaving headroom for the quantum encodings to differ. Apply StandardScaler fit on the train split only. 80/20 train/test split.

A minimal pilot study comparing three quantum data encoding strategies (angle, amplitude, ZZ feature map) for a variational quantum classifier on ONE moderately difficult 6D binary classification dataset (synthetic_classification_6d with class_sep=0.4). The agent must (a) implement all three encodings as drop-in feature maps for a shared 6-qubit EfficientSU2 ansatz, (b) train each (encoding, seed) cell using qiskit_machine_learning.algorithms.VQC + COBYLA over 5 random seeds, (c) report test accuracy per quantum cell and a classical logistic_regression baseline on the same data, and (d) produce a writeup that assigns supported / refuted / inconclusive verdicts to H1, H2, H3 with numerical evidence.

Quantum ML pilots are scored on (i) whether all three encodings are implemented per qiskit convention, (ii) whether ansatz / optimizer / simulator are held fixed across encodings so the encoding axis is isolated, (iii) whether the quantum cells produce non-trivial accuracy (not near 0.5 random for all 3 encodings, which would indicate a training bug rather than an encoding-specific effect), and (iv) whether per-hypothesis claims are backed by numerical evidence. Quantitative result leaves are scored on a graded scale: 100% if the hypothesis threshold is cleanly met, 67% if the trend is in the predicted direction but does not clear the numerical threshold, 33% if the trend is ambiguous, 0% if the result contradicts the hypothesis or evidence is missing.

Code-development bucket: all 3 encodings implemented per qiskit convention, shared ansatz + optimizer + simulator + training framework are wired identically across cells, and per-cell metrics are logged in the expected METRIC_RESULT JSON format.

All three encodings are implemented by IMPORTING and INSTANTIATING the canonical classes from qiskit.circuit.library by name, NOT by hand-writing the gate sequences. Concretely the agent's code MUST contain (grep-verifiable): 'from qiskit.circuit.library import' followed by at least the symbols ZFeatureMap, StatePreparation, and ZZFeatureMap; and the three encoding builders must instantiate exactly those classes (angle_encoding = ZFeatureMap(feature_dimension=6, reps=1); amplitude_encoding wraps StatePreparation on a 64D L2-normalized zero-padded vector; zz_feature_map = ZZFeatureMap(feature_dimension=6, reps=2, entanglement='linear')). Hand-written H/RZ/RZZ loops in place of these library classes FAIL this leaf. Additionally, a sanity check at runtime confirms that the three encodings produce DIFFERENT output statevectors for a fixed non-zero input (if they produce identical statevectors, the dispatch is broken and this leaf scores 0). Class bodies are non-trivial (not 'class X(Base): pass' shells).

Training uses qiskit_machine_learning.algorithms.VQC with the reference Sampler primitive. The variational ansatz (EfficientSU2 num_qubits=6 reps=1 entanglement='linear'), the classical optimizer (COBYLA maxiter=200), and the simulator backend (AerSimulator method='statevector') are identical across the 3 quantum encoding cells. Only the feature_map argument is swapped. No hand-rolled training loop in place of VQC.

Each per-(condition, seed) result is emitted to stdout as a single line beginning with METRIC_RESULT followed by a JSON object whose keys include at minimum: condition (one of angle_encoding / amplitude_encoding / zz_feature_map / logistic_regression / mlp_classifier), dataset (synthetic_classification_6d), seed (integer 0..4), test_accuracy (float in [0,1]). Both classical baselines (LogisticRegression and MLPClassifier) are logged in the same format.

Execution-validity bucket: all cells ran and produced numerically valid outputs.

At least 25 cells out of 25 expected (5 conditions: 3 quantum encodings + LogisticRegression + MLPClassifier x 1 dataset x 5 seeds) completed without unhandled errors and produced an accuracy value. Missing more than 2 cells (10 percent) without documented justification fails this leaf.

Numerical validity: no NaN or Inf in test_accuracy. Every test_accuracy lies in [0, 1]. No quantum cell collapses to a degenerate single-class prediction. At least one quantum encoding achieves test_accuracy strictly greater than 0.55 on at least 1 of 5 seeds (rules out the failure mode where all quantum cells stay near 0.5 random-chance because optimization never actually ran). The 3 quantum encodings MUST NOT produce identical test_accuracy across all 5 seeds (this is the ABLATION FAILURE pattern observed in a prior failed run: if angle/amplitude/zz produce bit-for-bit identical accuracies on every seed, the feature_map argument is being silently ignored by the training code, and this leaf scores 0). Training takes nontrivial wall time per cell (at least a few seconds; sub-1s per cell means VQC.fit was not actually invoked).

Results bucket: quantitative tests of H1/H2/H3 plus a per-hypothesis writeup.

Quantitative test of H1. Does the best of the 3 quantum encodings (5-seed mean) achieve test_accuracy within 5 absolute percentage points of the BETTER classical baseline (max of LogisticRegression and MLPClassifier 5-seed means)? 100% if gap is <= 5pp, 67% if gap is <= 10pp, 33% if gap is <= 20pp, 0% if quantum is more than 20pp worse than the best baseline (or either baseline is missing).

Quantitative test of H2. Is max(encoding 5-seed mean) - min(encoding 5-seed mean) across the 3 quantum encodings at least 5 absolute percentage points? 100% if spread >= 5pp, 67% if spread >= 2pp, 33% if spread > 0, 0% if all three encodings produce identical means (suggests training did not actually depend on the encoding choice).

Quantitative test of H3. Is zz_feature_map test_accuracy (5-seed mean) at least as high as angle_encoding test_accuracy (within 2 absolute pp lower, or higher)? 100% if zz >= angle - 2pp, 67% if zz is 2-5pp below angle, 33% if zz is 5-10pp below, 0% if zz is more than 10pp below angle.

Writeup of at least 200 words (in submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1, H2, H3 backed by specific mean accuracies (per encoding plus baseline) and the gap / spread values. Identifies a dominant systematic uncertainty (seed variance, optimizer convergence on the simpler EfficientSU2 reps=1 ansatz, class_sep=0.4 difficulty level). Discusses whether the result would change at higher difficulty or with a deeper ansatz.


Entangling-gate ablation in a variational quantum classifier

Ablating entangling gates in a variational quantum classifier: how much classification accuracy is actually attributable to CNOTs versus single-qubit rotations

Quantum machine learning models routinely use parameterized circuits
that mix single-qubit rotations with entangling two-qubit gates,
typically CNOTs. The common narrative is that entanglement is the
source of quantum advantage. If a variational classifier with no
entangling gates whatsoever can match the accuracy of one with full
entanglement, that narrative breaks down for this task class. The
purpose of this study is to measure the actual contribution of
entanglement in a simple variational quantum classifier by cleanly
removing CNOTs in a controlled monotonic manner.

The design isolates entanglement to one source. The data encoding is
fixed to angle encoding (single-qubit rotations only, no entangling
gates). The variational ansatz template is EfficientSU2 with reps=3,
which by default places a linear chain of CNOTs between each rotation
block (5 CNOTs per entangling layer, 3 layers, 15 CNOTs total for
6 qubits). We ablate by replacing some or all of those CNOTs with
identity, while keeping every single-qubit rotation parameter intact.
This isolates the gain attributable to two-qubit entangling structure
from the gain attributable to the trainable single-qubit basis change.
half_entanglement uses an independent random Bernoulli(0.5) mask over
the 15 CNOT positions per cell, seeded deterministically so the
ablation is reproducible but not aligned with any fixed pattern.

A parameter-matched classical baseline (sklearn MLPClassifier with a
hidden layer sized so its total parameter count is within 10 percent
of the VQC parameter count) tells us whether either quantum condition
is competitive with a trivial classical alternative on the same data.
If the no-entanglement VQC underperforms the classical MLP, the
conclusion is that on these tasks, entangling layers are not just
helpful but necessary for the variational quantum model to be a
viable choice at all.

Datasets are deliberately shared with Q01 (encoding comparison) so
results can be read across both studies. If the cross-topic story
holds, the encoding family that benefits most from ansatz CNOTs in
Q02 should also be the family that performed worst in Q01 (because
the ansatz CNOTs are compensating for the encoding's lack of input
entanglement). The current manifest does not require that
cross-comparison, but the writeup is encouraged to discuss it.

Research question: *In a variational quantum classifier on low
dimensional binary classification, how much of the model's accuracy
is actually due to ansatz entangling gates, and does the accuracy
degrade monotonically as CNOTs are removed?*

full_entanglement achieves mean test_accuracy (averaged over 5 seeds) at least 5 absolute percentage points higher than no_entanglement on at least 2 of 3 datasets.

half_entanglement mean test_accuracy lies strictly between full_entanglement and no_entanglement (within seed-mean noise of 1 absolute percentage point) on at least 2 of 3 datasets, demonstrating that the contribution of entangling layers is approximately monotonic in CNOT count.

On at least 1 of 3 datasets, classical_baseline (parameter-matched MLPClassifier) achieves test_accuracy at least as high as no_entanglement (5-seed mean). This sanity check rules out a trivial-task explanation: if removing all entanglement leaves the VQC weaker than a tiny classical net, then 'no entanglement' is not a viable QML setting on these tasks.

Feature map: ZFeatureMap(feature_dimension=6, reps=1). Ansatz: EfficientSU2(num_qubits=6, reps=3, entanglement='linear'). All 15 CNOTs from the 3 entangling layers are kept. This is the baseline VQC.

Same feature_map and ansatz template as full_entanglement, but each of the 15 CNOTs is independently dropped according to a random Bernoulli(0.5) mask. The mask is generated per cell using a derived random state: np.random.RandomState(seed + 10000).binomial(1, 0.5, size=15), where seed is the per-cell run seed. Dropped CNOTs are replaced with identity. Each cell records its realized cnot_count (expected ~7.5, variance per draw). Trainable parameters unchanged.

Same feature_map and rotation blocks as full_entanglement, but EVERY entangling gate is replaced with identity. The circuit reduces to a tensor product of independent single-qubit gates. CNOT count is 0. Trainable parameters unchanged.

sklearn.neural_network.MLPClassifier with hidden_layer_sizes chosen so the total trainable parameter count is within 10 percent of the VQC (EfficientSU2 reps=3 on 6 qubits has 48 rotation parameters; an MLP with one hidden layer of size 6 has 6*6 + 6 + 6*1 + 1 = 49 params). Use hidden_layer_sizes=(6,), activation='relu', max_iter=500, solver='lbfgs', random_state matched to the corresponding seed.

no_entanglement is the within-quantum ablation baseline

classical_baseline is the cross-paradigm sanity baseline

Mean over 5 seeds of held-out 20% test split accuracy.

Number of COBYLA iterations (or MLP solver iterations for classical_baseline) until training loss change drops below 1e-4 across 5 consecutive evaluations.

Number of CNOT gates remaining in the variational circuit (feature map + ansatz) after ablation. Informational metric. Expected: full=15, half=mean over draws (~7.5), no=0, classical_baseline=0.

make_classification(n_samples=200, n_features=6, n_informative=4, n_redundant=1, n_repeated=0, n_clusters_per_class=2, class_sep=1.0, flip_y=0.05, random_state=seed). Binary classification, native 6D. Apply StandardScaler. 80/20 train/test split. Same configuration as Q01.

load_wine (178 samples, 13 features, 3 classes). Select classes 0 and 1 only (binary subset, ~130 samples). Apply StandardScaler then PCA(n_components=6). 80/20 train/test split. Same configuration as Q01.

load_breast_cancer (569 samples, 30 features). Apply StandardScaler then PCA(n_components=6). 80/20 train/test split. Same configuration as Q01.

A controlled ablation study of entangling gates in a variational quantum classifier. Holding encoding (angle), ansatz template (EfficientSU2 reps=2), optimizer (COBYLA), and datasets fixed (matching Q01), the agent must implement full / half / no entanglement variants by selectively replacing CNOTs with identity in the ansatz, plus a parameter-matched classical MLP baseline. Score H1 (full > no by >=5pp), H2 (half between full and no), H3 (classical >= no on at least 1 dataset) with numerical evidence.

Ablation studies are scored on (i) whether the CNOT-removal mechanism actually changes the circuit as described (verified by inspecting cnot_count per condition), (ii) whether every other variable is held fixed (same encoding, same rotation parameters, same datasets, same optimizer, same seeds), and (iii) whether the H1/H2/H3 verdicts are backed by numerical evidence. The classical baseline must be parameter-matched (within 10 percent of the VQC's trainable parameter count) to be a meaningful sanity check.

Code-development bucket: the CNOT ablation mechanism is correctly implemented, the classical baseline is parameter-matched, and the evaluation loop holds all non-ablated variables fixed.

All three quantum conditions (full_entanglement, half_entanglement, no_entanglement) use the same ZFeatureMap and the same EfficientSU2(reps=3) rotation parameters. CNOTs are removed by replacing them with identity (not by re-parameterizing the ansatz). The resulting circuits have cnot_count = 15 for full, 0 for no, and a random Bernoulli(0.5) draw over 15 positions for half (mean ~7.5, verified by recording the realized count per cell). The half_entanglement mask is generated via np.random.RandomState(seed + 10000).binomial(1, 0.5, size=15) to be reproducible.

classical_baseline uses sklearn MLPClassifier with a hidden layer size chosen so the total parameter count is within 10 percent of the VQC's 48 trainable parameters (e.g. hidden_layer_sizes=(6,) gives 49 params for 6-dim input). max_iter, activation, solver, and random_state are specified explicitly. The MLP is trained and evaluated on the SAME train/test splits as the VQC conditions.

Nested loop over 4 conditions x 3 datasets x at least 5 seeds. Each cell records test_accuracy, convergence_iterations, and cnot_count. The same seed produces the same train/test split across the 4 conditions on each dataset (so the 4 conditions can be paired-compared).

At least 60 cells out of 60 expected (4 conditions x 3 datasets x 5 seeds) completed and produced an accuracy value. Missing cells must be documented; missing more than 6 cells (10 percent) without justification fails this leaf.

Numerical validity: no NaN or Inf in test_accuracy. Every test_accuracy in [0, 1]. cnot_count matches the manifest expectation per condition (full=15, half=Bernoulli draw mean ~7.5 with all values in [0,15], no=0, classical_baseline=0). At least one cell of each condition produces a non-degenerate classifier (not predicting a single class for all test samples).

Quantitative test of H1. Does full_entanglement beat no_entanglement by at least 5 absolute percentage points (5-seed mean) on at least 2 of 3 datasets? 100% if cleanly met, 67% if gap >= 2pp on 2/3, 33% if full > no on 2/3 but gap <2pp, 0% if full does not consistently beat no.

Quantitative test of H2. Does half_entanglement test_accuracy lie strictly between full and no (within 1pp seed-mean noise) on at least 2 of 3 datasets? 100% if cleanly monotonic on 2/3, 67% if monotonic on 1/3, 33% if half is non-monotonic but within 2pp of one of the endpoints, 0% otherwise.

Quantitative test of H3. On at least 1 of 3 datasets, does classical_baseline achieve test_accuracy at least as high as no_entanglement (5-seed mean)? 100% if classical >= no on at least 1/3, 50% if classical is within 2pp of no on at least 1/3, 0% if classical never reaches no_entanglement minus 2pp.

Writeup of at least 200 words (in submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1, H2, H3 with numerical evidence (specific mean accuracies for each condition x dataset, and the gap), a discussion of monotonicity, and an honest acknowledgment of whether the classical_baseline sanity check passes. The writeup is encouraged but not required to cross-reference Q01 (encoding) findings if available.


Classical optimizer comparison for VQE on H2 under finite shot noise

Benchmarking classical optimizers (SPSA, COBYLA, L-BFGS-B, ADAM) for VQE convergence on H2 under finite shot noise across multiple shot budgets and bond lengths

The Variational Quantum Eigensolver (VQE) is the canonical algorithm
for near-term quantum chemistry. The quality of a VQE result depends
on the ansatz, but it also critically depends on the classical
optimizer that updates variational parameters using noisy energy
estimates from shot-based measurement. Different optimizers exploit
gradient information very differently. Gradient-free methods such as
COBYLA and Nelder-Mead do not need explicit gradients and may be
robust to shot noise but converge slowly in high dimensions.
Simultaneous Perturbation Stochastic Approximation (SPSA) approximates
the gradient using just two function evaluations regardless of
parameter count, trading gradient quality for evaluation count and
often dominating in low-shot regimes. Gradient-based methods such as
L-BFGS-B and ADAM need explicit or finite-difference gradients, which
are expensive under shot noise because each partial derivative is
estimated from a noisy function value.

The choice of optimizer is rarely studied head-to-head under a fixed
shot budget. Most VQE papers fix the optimizer and tune everything
else around it. Here we hold ansatz (hardware-efficient EfficientSU2
reps=2), Hamiltonian (H2 in STO-3G basis), and initial parameters
(small random Gaussian) fixed, and vary only the optimizer and the
shot budget per energy evaluation. The diagnostic question is which
optimizer reaches chemical accuracy (within 1.6 mHa of the FCI
reference) using the fewest cumulative shots.

A credible study uses at least two molecular geometries to avoid
overfitting to a single energy landscape. We use H2 at two bond
lengths: the equilibrium distance (0.74 angstrom) where the ground
state is near Hartree-Fock and the optimization landscape is well
behaved, and a stretched geometry (1.5 angstrom) where multireference
character makes the landscape harder and tests optimizer robustness.
Each optimizer is run at a SINGLE fixed shot budget of 1024 shots per
energy evaluation. This is chosen as a representative middle-ground
value: low enough that shot noise is non-trivial (per-eval std ~15 mHa,
well above the 1.6 mHa chemical accuracy threshold, so the running-mean
convergence criterion matters), but high enough that some optimizers
can plausibly converge within their iteration budgets. All cells use
3 random seeds per (optimizer, geometry) cell, giving 4 optimizers x
1 shot budget x 2 geometries x 3 seeds = 24 total cells. Cumulative
shots is the sum of shots used across all energy evaluations
(including finite-difference gradient evaluations where applicable).
The Hamiltonian itself is constructed via
qiskit_nature.second_q.drivers.PySCFDriver (qiskit_nature and pyscf
are required dependencies for this topic; hardcoded Pauli string
fallbacks are NOT accepted).

Implementation contract (see quantum-qiskit skill for the reference
code). In qiskit 2.x, `qiskit_algorithms.VQE` and
`qiskit_nature.second_q.algorithms` are NOT importable (they depend on
the removed `qiskit.primitives.BaseEstimator` V1 interface). VQE MUST
be implemented as a manual optimization loop:
energy(theta) = estimator.run([(bound_ansatz, qubit_op)]).result()[0].data.evs + e_nuclear,
using `qiskit.primitives.StatevectorEstimator` (the V2 primitive that
works in qiskit 2.x) for the energy evaluation, and one of the four
optimizer classes from `qiskit_algorithms.optimizers` (SPSA, COBYLA,
L_BFGS_B, ADAM) for the parameter update, called via
`optimizer.minimize(energy, initial_point)`. Each call to `energy`
counts as one evaluation; cumulative shots is
`n_evaluations * shots_per_eval`. The Hamiltonian itself is constructed
via qiskit_nature.second_q.drivers.PySCFDriver +
qiskit_nature.second_q.mappers.ParityMapper (these submodules ARE safe
to import in qiskit 2.x — only the qiskit_nature.second_q.algorithms
module is broken). With ParityMapper and 2-qubit reduction
(num_particles=(1,1)), the H2/STO-3G Hamiltonian is 2 qubits, not 4.
Implement shot noise by adding Gaussian noise to each energy value
with sigma = ||H||_1 / sqrt(shots_per_eval). The convergence criterion
for shots_to_chemical_accuracy is the cumulative shots when a 5-eval
running mean energy stays within 1.6 mHa of E_FCI for 5 consecutive
evaluations; if not reached, report None or a sentinel distinct from
the upper bound so analysis can flag the cell as "did not converge"
rather than treating the budget cap as a measurement.

Research question: *Under finite shot noise, which classical optimizer
(SPSA, COBYLA, L-BFGS-B, ADAM) reaches VQE chemical accuracy using the
fewest cumulative shots, and how does the answer depend on shot budget
per evaluation and on Hamiltonian difficulty (equilibrium vs stretched
H2)?*

At 1024 shots per energy evaluation, SPSA reaches chemical accuracy (|E_running_mean - E_FCI| < 1.6 mHa for 5 consecutive 5-eval windows) using fewer cumulative shots than L-BFGS-B (3-seed median), on at least 1 of 2 H2 geometries.

At 1024 shots per energy evaluation, gradient-free methods (SPSA and COBYLA, 6 seed-runs combined across both geometries) achieve chemical accuracy with success rate at least 4/6, while gradient-based methods (L-BFGS-B and ADAM, 6 seed-runs combined) achieve it with success rate at most 3/6. This isolates the shot-noise sensitivity of finite-difference gradient estimation.

Optimizer ranking by shots_to_chemical_accuracy changes between H2 equilibrium and H2 stretched geometries: at least one optimizer pair (e.g. SPSA vs COBYLA, or SPSA vs L-BFGS-B) swaps relative ranking between the two geometries, indicating that Hamiltonian difficulty changes optimizer choice.

Under finite shot noise, which classical optimizer reaches VQE chemical accuracy in the fewest cumulative shots, and how does the answer depend on shot budget per evaluation and on Hamiltonian difficulty?

spsa

qiskit_algorithms.optimizers.SPSA(maxiter=200, learning_rate=0.05, perturbation=0.1). Fixed shot budget: 1024 shots per energy evaluation. Each iteration costs 2 energy evaluations.

cobyla

qiskit_algorithms.optimizers.COBYLA(maxiter=200, rhobeg=0.1, tol=1e-4). 1024 shots per energy evaluation. Each iteration costs 1 energy evaluation.

lbfgsb

qiskit_algorithms.optimizers.L_BFGS_B(maxiter=100, ftol=1e-6) with finite-difference gradients (epsilon=1e-3). 1024 shots per energy evaluation. Each iteration costs ~2*num_params energy evaluations for the gradient plus 1 for the function value (so ~25 evals per iter for EfficientSU2 reps=2 on 4 qubits).

adam

qiskit_algorithms.optimizers.ADAM(maxiter=200, lr=0.05, beta_1=0.9, beta_2=0.999) with finite-difference gradients (epsilon=1e-3). 1024 shots per energy evaluation. Same per-iter cost as L-BFGS-B.

Cumulative shots vs. FCI energy reference is the within-method benchmark

Hartree-Fock energy at each geometry is the trivial classical baseline below which any optimizer should clear

Cumulative shots until |E_running_mean - E_FCI| stays below 1.6 mHa for 5 consecutive evaluations. If not reached within the maxiter budget, report the total cumulative shots used (sentinel = max-shots) and flag success=False.

|E_final - E_FCI| in Hartree at the end of optimization (after all maxiter iterations).

Fraction of seeds (out of 3 per condition x geometry) where the run reached chemical accuracy by the maxiter budget.

H2 in STO-3G basis at bond length 0.74 angstrom. Build the FermionicOp via PySCFDriver, apply ParityMapper with 2-qubit reduction to obtain a 4-qubit qubit Hamiltonian (alternatively JordanWignerMapper + tapering). FCI reference: E_FCI = -1.137283 Ha. Hardcoded Pauli strings are NOT an acceptable substitute for this benchmark; both qiskit_nature and pyscf must be installed and used.

H2 in STO-3G basis at bond length 1.5 angstrom (multireference / strong-correlation regime). 4 qubits via the same mapping pipeline as h2_equilibrium. FCI reference: E_FCI ~ -1.001 Ha. Hardcoded Pauli strings NOT accepted.

A credible VQE optimizer comparison on H2 in STO-3G basis at two bond lengths (0.74 A equilibrium, 1.5 A stretched), at a fixed shot budget of 1024 shots per energy evaluation. The agent must (a) construct the 4-qubit H2 Hamiltonian at each geometry via qiskit_nature.PySCFDriver, (b) implement VQE via qiskit_algorithms.VQE.compute_minimum_eigenvalue() with a hardware-efficient EfficientSU2 reps=2 ansatz, (c) run 4 optimizers (SPSA, COBYLA, L-BFGS-B, ADAM) x 2 geometries x 3 seeds = 24 cells, (d) log cumulative shots and energy trajectories per cell, and (e) score H1/H2/H3 with numerical evidence keyed by (optimizer, geometry).

Optimizer comparisons are scored on (i) correctness of the Hamiltonian (FCI reference within 1 mHa of -1.137 Ha for H2 equilibrium), (ii) consistent ansatz / initial parameters across cells so only the optimizer and shot budget vary, (iii) accurate accounting of cumulative shots including gradient evaluations for L-BFGS-B and ADAM, and (iv) numerical evidence backing H1/H2/H3. qiskit_nature.second_q.drivers.PySCFDriver MUST be used to build the Hamiltonian. Hardcoded Pauli strings are NOT acceptable and a submission that uses them fails q03-code-hamiltonians.

Code-development bucket: VQE pipeline correctly implements 4 optimizers, both H2 geometries, and accurate cumulative-shot tracking.

VQE is implemented using qiskit_algorithms.VQE or an equivalent custom loop. The ansatz is EfficientSU2(num_qubits=4, reps=2, entanglement='linear'). Initial parameters are sampled from N(0, 0.1) with the same seed across all 4 optimizers for a given (shot_budget, geometry, seed) triple. All 4 optimizers are correctly instantiated from qiskit_algorithms.optimizers (SPSA, COBYLA, L_BFGS_B, ADAM) with the maxiter and learning rates listed in the manifest.

Both H2 Hamiltonians are constructed at the correct bond lengths (0.74 and 1.5 angstrom) in STO-3G basis using qiskit_nature.second_q.drivers.PySCFDriver (REQUIRED) and either ParityMapper with 2-qubit reduction or JordanWignerMapper with tapering. The diagonalized Hamiltonian (numpy eigvalsh of the matrix form) gives FCI energies within 1 mHa of -1.137 Ha (equilibrium) and -1.001 Ha (stretched). Hardcoded Pauli strings as a substitute for PySCFDriver are NOT accepted and fail this leaf.

Cumulative shots is tracked correctly per run. For SPSA and COBYLA, each iteration adds shots_per_eval * num_evaluations_per_iter (2 for SPSA, 1 for COBYLA). For L-BFGS-B and ADAM with finite-difference gradients, each iteration adds shots_per_eval * (2 * num_params + 1) so the gradient evaluations are accounted for. The shots_to_chemical_accuracy metric is computed using the running mean energy (over the last 5 evaluations) and reports the cumulative shot count at the first evaluation where the mean stays within 1.6 mHa of E_FCI for 5 consecutive evaluations.

Execution-validity bucket: all cells ran with valid energies and shot accounting.

At least 22 cells out of 24 expected (4 optimizers x 1 shot budget (1024) x 2 geometries x 3 seeds = 24) completed and produced a final_energy_error_hartree value. If any cells are omitted (e.g. ADAM ran out of budget), they must be documented with a recorded cause. Missing more than 2 cells (10 percent) without justification fails this leaf. The condition_summaries MUST be keyed by (optimizer, geometry) so each of the 8 condition cells has 3 seed entries — collapsing across the geometry axis (e.g. reporting only per-optimizer aggregates) fails this leaf because it makes H1 and H3 unevaluable.

Numerical validity: every final energy is finite (no NaN/Inf), every final_energy_error_hartree >= 0, every success_rate in [0, 1], cumulative shots is monotone increasing within a run. At least one cell across the entire sweep reaches chemical accuracy (otherwise the rubric thresholds are uncalibrated for this setup).

Results bucket: quantitative tests of H1/H2/H3 plus a per-hypothesis writeup.

Quantitative test of H1. On at least 1 of 2 geometries at 1024 shots/eval, does SPSA reach chemical accuracy with fewer median cumulative shots than L-BFGS-B (over 3 seeds)? 100% if SPSA wins on at least 1/2 geometries with a >=20 percent shot reduction, 67% if SPSA wins on at least 1/2 with any margin, 33% if SPSA and L-BFGS-B are within 10 percent of each other, 0% if L-BFGS-B is consistently faster.

Quantitative test of H2. At 1024 shots/eval, pooling across both geometries: do gradient-free methods (SPSA + COBYLA, total of 6 seed-runs = 2 methods x 3 seeds) have a combined chemical-accuracy success rate of at least 4/6, while gradient-based methods (L-BFGS-B + ADAM, 6 seed-runs) have at most 3/6? 100% if cleanly met, 67% if the gradient-free success rate exceeds gradient-based by at least 30 percent, 33% if gradient-free exceeds gradient-based at all, 0% if gradient-based methods are equal or better.

Quantitative test of H3. Does the optimizer ranking by median shots_to_chemical_accuracy change between H2 equilibrium and H2 stretched geometries? Specifically: take the 4-element ranking of optimizers (by 3-seed-median shots) on each geometry; H3 is supported if at least one pair swaps relative order between the two rankings (Kendall tau distance >= 1 between the two rankings). 100% if at least one swap detected with clear evidence, 67% if one optimizer's rank differs by exactly 1 position, 33% if rankings are similar but values differ, 0% if rankings are identical or H3 is unevaluable (e.g. due to collapsed condition_summaries that drop the geometry axis).

Writeup of at least 200 words (in submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1, H2, H3 with numerical evidence (specific median cumulative shots, success rates, and final energy errors per optimizer x shot budget). Identifies a dominant systematic uncertainty (seed variance, finite-difference epsilon, optimizer hyperparameter sensitivity, shot-noise variance at low budgets). Discusses the difference between equilibrium and stretched H2 in terms of optimizer ranking.


Data re-uploading depth vs Fourier expressivity for variational quantum regression: characterizing how the trainable bandwidth of a parameterized re-uploading circuit scales with re-uploading layers L on synthetic 1D regression targets

Data re-uploading is a variational quantum circuit pattern in which the
classical input x is loaded into the same qubits multiple times,
interleaved with trainable rotation layers: the circuit
W(theta_L) U(x) W(theta_{L-1}) U(x) ... W(theta_1) U(x) |0> applies L
encoding blocks U(x) and L trainable blocks W(theta). Perez-Salinas et al.
proved in 2020 that a single qubit with sufficient re-uploading depth is
a universal function approximator on bounded intervals. Schuld, Sweke,
and Meyer (PRA 2021) then proved the structural reason: a re-uploading
circuit's output function is a truncated Fourier series in the input x,
with the set of representable frequencies determined by the eigenvalue
spectrum of the encoding generators and growing with L.

The practical question that follows is whether the theoretical
expressivity claim translates into empirical fit quality. As L grows we
expect (i) more representable frequencies (better fit on high-bandwidth
targets), and (ii) more parameters and more risk of overfitting on
finite-sample regression with discontinuous targets. Classical kernel
regression (RBF) and polynomial regression provide the natural baselines
because they too can be interpreted as choosing a basis of functions
(Gaussian or polynomial) of fixed expressivity; comparing quantum
re-uploading against these classical baselines is the cleanest way to
ask "does the Fourier structure imposed by re-uploading give a useful
inductive bias on these targets, or do classical models with comparable
capacity match it?"

Implementation guidance is provided by the quantum-qiskit skill, which
is automatically injected at stage 10 and contains canonical code for
building re-uploading circuits using qiskit.circuit.ParameterVector and
rotation gates. Training uses Adam through parameter-shift gradients
(do NOT roll your own gradient finite-difference loop). The simulator
is fixed to AerSimulator(method='statevector') for noiseless evaluation
so the Fourier-spectrum probe is clean.

Experimental protocol. Four quantum re-uploading depths (L=1, L=3, L=5,
L=7) are compared against two classical baselines (RBF kernel ridge
regression with bandwidth chosen by cross-validation; polynomial
regression of degree 7). All six conditions are evaluated on two 1D
regression targets: a sum-of-sinusoids signal with known frequency
content, and a step function (tests handling of discontinuities).
Each (condition, dataset) cell is averaged over 2 random seeds, giving
6 conditions x 2 datasets x 2 seeds = 24 total cells.

Research question: *On 1D regression with known target bandwidth, does
increasing data re-uploading depth L produce monotonically lower test
MSE on bandwidth-rich targets (sinusoid mixture), and does the
recovered Fourier spectrum overlap with the target spectrum scale
predictably with L?*

On the sinusoid-mixture target, the L=5 re-uploading model achieves test MSE at least 4 times lower than the L=1 re-uploading model (2-seed mean), demonstrating that increasing re-uploading depth improves regression accuracy on bandwidth-rich targets.

On the step-function target, the L=7 re-uploading model exhibits overfitting compared to L=5: L=7 test MSE is at least 15 percent higher than L=5 test MSE (2-seed mean), even though L=7 has more parameters and lower training MSE.

At L=7 on the sinusoid-mixture target, the recovered Fourier spectrum (FFT of the trained circuit's output sampled on a uniform 256-point grid) has cosine similarity at least 0.7 with the target Fourier spectrum, restricted to the lowest 5 nonzero frequencies.

On 1D regression with known target bandwidth, does increasing data re-uploading depth L produce monotonically lower test MSE on bandwidth-rich targets, and does the recovered Fourier spectrum overlap with the target spectrum scale predictably with L?

Single-qubit re-uploading circuit with L=1 encoding block. Encoding: U(x) = RZ(x). Trainable block: W(theta) = RY(theta_0) RZ(theta_1). Output: <Z>. 2 trainable parameters total.

Same single-qubit re-uploading template with L=3 encoding blocks. 6 trainable parameters.

Same template with L=5 encoding blocks. 10 trainable parameters.

Same template with L=7 encoding blocks. 14 trainable parameters.

rbf_kernel_ridge: sklearn.kernel_ridge.KernelRidge(kernel='rbf', alpha=1e-3, gamma=tuned_via_grid_search). Strong nonparametric regression baseline.

polynomial_regression: sklearn.pipeline.make_pipeline(PolynomialFeatures(degree=7), Ridge(alpha=1e-3)). Matched-capacity polynomial basis baseline.

Mean squared error on a 200-point held-out test set, averaged over 2 random seeds per (condition, dataset) cell. Primary metric.

Mean squared error on the 200-point training set after training completes.

Cosine similarity between the FFT of the trained model's output sampled on a uniform 256-point grid over [0, 1] and the FFT of the target function on the same grid, restricted to the lowest 5 nonzero frequency bins. Higher means the model has learned the target's Fourier content.

Target function f(x) = sum_k a_k * sin(2*pi*k*x) for k in {1, 2, 3, 5, 7} with random amplitudes a_k drawn from Uniform[0.5, 1.0] using a fixed dataset-generation seed (independent of per-cell training seeds). 200 training x-values + 200 test x-values uniformly sampled on [0, 1]. Targets are observed with Gaussian noise N(0, 0.05).

Target function f(x) = 1.0 if x > 0.5 else 0.0, plus Gaussian noise N(0, 0.05). Tests how the re-uploading model handles a discontinuity (its Fourier series will exhibit Gibbs ringing). 200 training + 200 test samples.

A credible empirical study of data re-uploading depth vs Fourier expressivity in variational quantum regression. The agent must (a) implement 4 re-uploading circuits at L in {1, 3, 5, 7} using qiskit ParameterVector + RY/RZ rotation gates, (b) train each with parameter-shift Adam on 200 samples of two 1D regression targets (sinusoid mixture and step function), (c) compare against two classical baselines (RBF kernel ridge regression, polynomial regression degree 7) on the same data, (d) measure test MSE per cell and the recovered Fourier spectrum of the trained quantum model, and (e) score H1/H2/H3 with numerical evidence.

Re-uploading topics are scored on (i) whether the 4 quantum circuits actually differ by depth (sanity check: parameter counts must be 2/6/10/14), (ii) whether training was real and produced different outputs across L levels (3 quantum cells producing bit-identical MSE would indicate dispatch failure, same anti-pattern as Q01 ablation failure), (iii) whether classical baselines are computed on the exact same data as quantum cells, and (iv) whether H1/H2/H3 are supported by reported MSE and Fourier-spectrum numbers. Quantitative result leaves use a graded scale: 100% if hypothesis threshold cleanly met, 67% if trend in predicted direction without clearing threshold, 33% if ambiguous, 0% if contradicted or evidence missing.

Code-development bucket: 4 re-uploading circuits + 2 classical baselines are implemented correctly with shared training pipeline and reproducible per-cell seed control.

All four re-uploading circuits use qiskit.QuantumCircuit + qiskit.circuit.ParameterVector. The encoding gate is RZ(x) and the trainable block is RY(theta_2k) RZ(theta_2k+1). Output is the expectation <Z> on the single qubit (via qiskit.quantum_info.Statevector or the reference Estimator primitive). Parameter counts match: L=1 has 2 params, L=3 has 6, L=5 has 10, L=7 has 14. A sanity check asserts that the four circuits produce different output values for a fixed nonzero input x=0.3 with a fixed random parameter vector.

Training uses Adam with parameter-shift gradients computed via the qiskit parameter-shift rule (NOT scipy finite differences). Loss is mean squared error on the 200 training samples. Same optimizer hyperparameters across all four L levels (Adam lr=0.05, 300 steps). Both classical baselines use sklearn (KernelRidge with grid-searched gamma, and a Pipeline of PolynomialFeatures+Ridge).

Each per-(condition, dataset, seed) result is emitted to stdout as a single line starting with METRIC_RESULT followed by JSON containing condition, dataset, seed, test_mse, train_mse, and fourier_spectrum_cosine. The FFT is computed on the trained model's output sampled on a uniform 256-point grid over [0, 1].

Execution-validity bucket: all 24 cells ran and produced numerically valid outputs.

At least 22 cells out of 24 expected (6 conditions x 2 datasets x 2 seeds) completed without unhandled errors and produced a test_mse value. Missing more than 2 cells (10 percent) without documented justification fails this leaf.

Numerical validity: no NaN or Inf in test_mse; train_mse <= test_mse * 1.5 across conditions (otherwise model is broken); the 4 quantum L levels produce different test MSEs (max - min across the 4 quantum conditions on the sinusoid-mixture dataset is at least 0.005). Fourier spectrum values are real, finite, and the cosine similarity is in [-1, 1].

Quantitative test of H1. On the sinusoid-mixture dataset, is test_mse(L=5) <= test_mse(L=1) / 4 (2-seed mean)? 100% if ratio >= 4, 67% if 2 <= ratio < 4, 33% if 1 < ratio < 2, 0% if L=5 is not better than L=1.

Quantitative test of H2. On the step function dataset, is test_mse(L=7) >= test_mse(L=5) * 1.15 (2-seed mean)? 100% if overshoot is >= 15 percent, 67% if 5-15 percent, 33% if any small overshoot (0-5 percent), 0% if L=7 still has lower MSE.

Quantitative test of H3. On the sinusoid-mixture dataset at L=7, does the recovered Fourier spectrum cosine similarity (restricted to lowest 5 nonzero frequencies) reach 0.7? 100% if >= 0.7, 67% if >= 0.5, 33% if >= 0.3, 0% otherwise.

Writeup of at least 200 words (submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1, H2, H3 backed by specific test MSE values per (L, dataset) and Fourier spectrum cosine values. Discusses how the Fourier-series view (Schuld, Sweke, Meyer 2021) predicts the observed trend, and identifies a dominant systematic uncertainty (seed variance, optimizer convergence, parameter-shift gradient noise).


Barren plateau onset under cost-function locality: empirically measuring gradient variance of hardware-efficient ansatze under global vs local cost functions across depth, testing the Cerezo 2021 prediction that local costs avoid exponential gradient suppression

A barren plateau is the phenomenon, first identified by McClean et al.
in 2018, that the gradient of a variational quantum circuit's loss
becomes exponentially small in the number of qubits when the ansatz is
drawn from a sufficiently random circuit ensemble. Concretely, for a
loss L(theta) = <psi(theta)|H|psi(theta)> where the parameterized
state is generated by a random-ish unitary, the variance of the
gradient dL/dtheta_k scales as O(1/2^n). For n = 20 qubits this
variance is below machine epsilon, and SGD or any gradient-based
optimizer has effectively zero signal to follow. This is the central
trainability obstruction in variational quantum machine learning.

Cerezo et al. ("Cost function dependent barren plateaus in shallow
parametrized quantum neural networks", Nature Communications 2021)
showed that the locality of the cost function matters. If the cost is
a sum of single-qubit Pauli expectations (a local cost), then the
gradient variance can scale only polynomially in n even at moderate
ansatz depth. If the cost is a product or projection over all qubits
(a global cost), the variance is exponentially suppressed at any
depth. The mechanism is that local-cost observables overlap with only
a constant-size subspace of the 2^n dimensional Hilbert space, while
global-cost observables are spread thinly across the entire space and
almost always cancel.

The empirical question this topic addresses is whether the local-cost
free lunch holds at moderate depth on a CPU-feasible 6-qubit
benchmark. We fix n=6 qubits and the EfficientSU2 hardware-efficient
ansatz family (a standard choice in qiskit). We vary depth (number of
ansatz layers L) and cost-function locality, then directly probe the
gradient distribution by sampling 100 random parameter vectors per
cell, computing the parameter-shift gradient with respect to theta_0
for each, and reporting the empirical variance. A subsidiary check
trains each condition for 100 Adam iterations and reports the loss
change as a practical sanity probe of whether the gradient signal is
large enough to drive optimization at all.

Implementation guidance is provided by the quantum-qiskit skill,
which is automatically injected at stage 10. Use qiskit.circuit.library
EfficientSU2 verbatim; do NOT hand-write H/CNOT/RY gate stacks (a
prior failed run produced an "ablation failure" where three nominally
different encodings collapsed to identical circuits because they
were hand-coded). Use qiskit_algorithms.utils.algorithm_globals
random_seed for reproducibility. Gradients are computed via the
parameter-shift rule on a statevector backend.

Experimental protocol. Four conditions cover the cost x depth grid:
(local_cost_L2) shallow + local, the trainable control; (local_cost_L10)
medium + local, the regime Cerezo's theorem predicts is still
trainable; (local_cost_L20) deep + local, stressing the prediction;
(global_cost_L10) medium + global, the negative control where a barren
plateau is expected. Each condition is run with 3 different random
ansatz-structure seeds (controlling which qubits are entangled in each
EfficientSU2 layer) for variance estimation across architectures, and
100 random parameter vectors per (condition, structure-seed) cell are
used to estimate gradient variance. Total cells: 4 conditions x 3
ansatz seeds = 12 cells. No external dataset is required because this
is a measurement experiment on the ansatz family itself.

Research question: *Does the local-cost trick avoid the barren plateau
on a 6-qubit EfficientSU2 ansatz at L=10 and L=20 ansatz depth, as
predicted by Cerezo et al. 2021, when compared against the
global-cost baseline at the same depth and against the shallow local-cost
control?*

At ansatz depth L=10, the empirical variance of the gradient under local cost is at least 20 times larger than under global cost (3-seed mean of variance per condition), confirming Cerezo et al. 2021's prediction that locality changes the barren-plateau scaling.

Under local cost, the gradient variance at L=20 is at least 1/100 of the gradient variance at L=2, i.e. the polynomial (sub-exponential) decay regime is maintained even at deep ansatz, with log10(var_L20) - log10(var_L2) > -2.0 (3-seed mean).

When trained with Adam for 100 gradient steps starting from random initialization, the global-cost-L10 condition produces a loss change of at most 1 percent of the initial loss (3-seed mean), demonstrating that the predicted barren plateau actively prevents practical training, while the local-cost-L10 condition produces a loss change of at least 10 percent.

Does the local-cost trick avoid the barren plateau on a 6-qubit EfficientSU2 ansatz at L=10 and L=20, as predicted by Cerezo et al. 2021, when compared against the global-cost baseline and a shallow local-cost control?

Proposed-method core. EfficientSU2(num_qubits=6, reps=10, entanglement='linear') ansatz. Cost function: <Z_0> (expectation of Pauli Z on qubit 0 only). 100 random parameter vectors theta drawn from Uniform[-pi, pi]^{n_params}. For each theta, compute parameter-shift gradient dL/dtheta_0 by evaluating L at theta + (pi/2) * e_0 and theta - (pi/2) * e_0. Report variance of these 100 gradient values.

Proposed-method stress test. EfficientSU2 reps=20, same local cost <Z_0>. Tests whether the polynomial-decay prediction holds at deeper ansatz.

local_cost_L2: trainable-control baseline. EfficientSU2 reps=2, local cost <Z_0>. Known to have non-vanishing gradient because the ansatz is too shallow to enter the barren-plateau regime.

global_cost_L10: barren-plateau negative-control baseline. EfficientSU2 reps=10, global cost <Z_0 Z_1 Z_2 Z_3 Z_4 Z_5> (product of Z on all 6 qubits). Known from Cerezo 2021 to exhibit exponentially small gradient variance even though the ansatz depth matches local_cost_L10.

log10 of the empirical variance of dL/dtheta_0 over 100 random parameter samples. Higher means more trainable gradient signal. Primary metric. Less negative numbers are better (closer to 0).

Mean of |dL/dtheta_0| over the 100 random samples.

Relative loss change after 100 Adam steps starting from a random initialization: (L_initial - L_after_100_steps) / |L_initial|. Practical training-feasibility probe. Larger positive means training actually moved the loss.

Synthetic, generated in-script via numpy.random.RandomState(ansatz_structure_seed).uniform(-pi, pi, size=(100, n_params))

Each cell samples 100 random parameter vectors in the parameter space of EfficientSU2 at the given (num_qubits, reps). These are the inputs over which gradient variance is estimated. No external data is involved; this is a measurement experiment on the ansatz family.

An empirical study of barren plateau onset on a 6-qubit EfficientSU2 ansatz under local vs global cost functions and shallow vs deep ansatz. The agent must (a) build the EfficientSU2 ansatz with reps in {2, 10, 20} via qiskit.circuit.library, (b) for each (cost, depth) condition sample 100 random parameter vectors and compute parameter-shift gradient dL/dtheta_0, (c) report the empirical variance of those 100 gradient values per cell, (d) run a 100-step Adam training as a practical sanity probe of trainability, and (e) score H1/H2/H3 with numerical evidence.

Barren plateau studies are scored on (i) correctness of the EfficientSU2 / cost construction (using qiskit.circuit.library, not hand-rolled), (ii) whether the 100-sample gradient distribution actually captures the variance (cells reporting std=0 across 100 samples indicate a broken sampler), (iii) the local_cost_L10 vs global_cost_L10 contrast being clean (these have IDENTICAL ansatz, only cost differs, so any large variance gap directly tests Cerezo 2021), and (iv) the training-feasibility probe correlating with the gradient-variance prediction (BP cell should not train; trainable cell should train). Quantitative result leaves use a graded scale: 100% if cleanly met, 67% if in predicted direction without clearing threshold, 33% if ambiguous, 0% if contradicted.

Code-development bucket: EfficientSU2 ansatz built correctly via qiskit.circuit.library, parameter-shift gradient implemented correctly, and the 100-sample gradient distribution actually populated per cell.

EfficientSU2(num_qubits=6, reps=reps_value, entanglement='linear') from qiskit.circuit.library used directly (NOT hand-coded H/CNOT/RY stacks). Parameter-shift gradient of <O>(theta) with respect to theta_0 computed via the qiskit standard pattern: dL/dtheta_0 = (L(theta + (pi/2)*e_0) - L(theta - (pi/2)*e_0)) / 2. Cost observable for local_cost is Pauli Z on qubit 0; for global_cost is the product Z_0 Z_1 Z_2 Z_3 Z_4 Z_5 (a SparsePauliOp). A sanity check confirms that the gradient is nonzero for at least one random parameter sample at L=2 local cost.

For each (condition, ansatz-structure seed) cell, 100 independent random parameter vectors are drawn from Uniform[-pi, pi]^{n_params} using a per-cell seeded RNG. For each parameter vector, the gradient dL/dtheta_0 is computed. The 100 gradient values are stored and the empirical variance is reported. Reusing the same parameter vector across conditions in the same cell is allowed (paired comparison) but NOT required.

After the gradient-variance measurement, each cell runs a 100-step Adam optimization (qiskit_algorithms.optimizers.ADAM or pytorch Adam wrapping a parameter-shift gradient closure) starting from a random initialization. The initial loss and the loss after step 100 are recorded; the training_loss_change_fraction = (L_initial - L_final) / |L_initial| is computed per cell.

Execution-validity bucket: all 12 cells ran and produced numerically valid outputs.

At least 11 cells out of 12 expected (4 conditions x 3 ansatz-structure seeds) completed and produced a non-null log_gradient_variance value. Missing more than 1 cell without documented justification fails this leaf.

Numerical validity: no NaN or Inf in gradient values; empirical std of the 100 gradients is strictly > 0 in every cell (cells reporting std=0 indicate a broken sampler and fail this leaf); log10(variance) values are finite. The training_loss_change_fraction is in the range [-1.0, 1.0] (otherwise loss diverged or wasn't properly normalized).

Results bucket: quantitative tests of H1/H2/H3 plus a per-hypothesis writeup.

Quantitative test of H1. Is var(local_cost_L10) / var(global_cost_L10) >= 20 (3-seed mean of variances)? 100% if ratio >= 20, 67% if 5 <= ratio < 20, 33% if 1 < ratio < 5, 0% if global cost has equal or larger variance.

Quantitative test of H2. Is log10(var_local_L20) - log10(var_local_L2) > -2.0 (3-seed mean)? 100% if difference > -2.0 (polynomial decay), 67% if difference > -3.0, 33% if difference > -4.0, 0% otherwise (exponential decay observed).

Quantitative test of H3. Is global_cost_L10 training_loss_change_fraction <= 0.01 AND local_cost_L10 training_loss_change_fraction >= 0.10 (3-seed mean)? 100% if both conditions hold cleanly, 67% if local trains but global change is 1-5 percent, 33% if local trains but global has any change, 0% if global cost also trains (would contradict the BP prediction).

Writeup of at least 200 words (submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1/H2/H3 backed by specific variance values per (condition, seed) and training_loss_change_fraction values. Explicitly references Cerezo et al. 2021 'Cost function dependent barren plateaus' and discusses whether the observed variance ratio matches their theoretical prediction. Identifies dominant uncertainty (ansatz-structure seed variance, finite-sample variance estimate from 100 gradient samples).


Neural-network warm-start for QAOA-MaxCut initialization

Neural-network warm-start for QAOA-MaxCut: comparing MLP-predicted initial parameters against random and fixed initialization across in-distribution and out-of-distribution graph families

The Quantum Approximate Optimization Algorithm (QAOA) prepares a
parameterized quantum state to approximate the maximum cut of a graph.
At depth p=1 the state depends on two real parameters (beta, gamma),
and the algorithm proceeds by classical optimization of those two
parameters against the average cut size sampled from measurements of
the prepared state. The bottleneck for practical QAOA is the initial
parameter guess. Random initialization frequently falls into the
barren-plateau region or onto sub-optimal local minima, requiring many
classical iterations to escape. Brandao et al. 2018 showed
theoretically that the optimal (beta, gamma) values concentrate
around a problem-independent point on certain graph ensembles, so a
fixed initialization like (pi/4, pi/4) is a strong default.

Beyond concentration, a richer strategy is to train a classical
neural network offline to predict the optimal (beta, gamma) given
features of the input graph. Verdon et al. 2019 introduced the idea
as quantum-aware meta-learning. Jain et al. (Quantum 2022, "Graph
neural network initialisation of QAOA") showed that a graph neural
network trained on a few thousand small graphs can predict initial
parameters that reduce the number of subsequent classical
optimization iterations by 5-10x compared to random initialization,
with measurable transfer to out-of-distribution graph families.

The empirical question this topic addresses is whether the MLP-warm-start
strategy actually generalizes off-distribution: a model trained on
Erdős-Rényi graphs of one density should ideally retain its advantage
on regular graphs of a different size. We also want to verify whether
the simpler "fixed init at (pi/4, pi/4)" baseline (from Brandao 2018)
is competitive with the MLP-predicted init at p=1, since the
concentration result suggests that simple defaults may be hard to
beat in the low-depth regime.

Implementation guidance is provided by the quantum-qiskit skill at
stage 10. Implement QAOA on the qiskit AerSimulator statevector
backend; the small graph sizes (n=6 to n=8) make exact statevector
simulation cheap. The MLP is sklearn.neural_network.MLPRegressor
trained offline on a precomputed set of (graph_features, optimal_beta,
optimal_gamma) tuples obtained by grid search on 200 training
graphs. Optimization at test time uses COBYLA with a hard cap of 20
iterations.

Experimental protocol. Two graph families serve as the test bed.
In-distribution: Erdős-Rényi G(n=6, p=0.5) graphs (matched to the MLP
training distribution). Out-of-distribution: 3-regular graphs at n=8
(different size and edge density). Four conditions cover the
initialization strategies: random init, fixed init (beta=gamma=pi/4),
MLP-init evaluated in-distribution, and MLP-init evaluated
out-of-distribution. (MLP-init has 2 conditions because the model
trained on Erdős-Rényi G(n=6, p=0.5) is evaluated on both graph
families to test transfer.) Each (condition, graph family) cell is
averaged over 3 different random graph instances drawn within that
family. Total cells: 4 conditions x 2 graph families x 3 seeds = 24
cells.

Research question: *Does a small MLP trained to predict QAOA-MaxCut
initial parameters from graph features (degree distribution, edge
density, spectral gap) provide a faster warm-start than random
initialization or the Brandao 2018 fixed (pi/4, pi/4) initialization,
and does the advantage transfer to graphs from a different
distribution than the MLP was trained on?*

On in-distribution Erdős-Rényi graphs at n=6, the MLP-predicted initialization reaches approximation ratio 0.9 in at most 10 COBYLA iterations on average (3-graph mean), while random initialization requires at least 18 iterations to reach the same target.

On out-of-distribution 3-regular graphs at n=8, MLP-predicted initialization still beats random initialization by at least 20 percent in iteration count (3-graph median), demonstrating partial transfer of the learned initialization heuristic.

At p=1 the fixed initialization (beta=gamma=pi/4) is competitive with MLP-predicted initialization: the gap in 3-graph-median iteration count between fixed init and MLP-init is at most 30 percent on in-distribution graphs, consistent with the Brandao 2018 concentration prediction that QAOA-1 parameters concentrate around a problem-independent point.

Does an MLP trained on small Erdős-Rényi graph features predict QAOA-MaxCut initial parameters that reduce COBYLA iteration count compared to random and fixed init, and does the advantage transfer to graphs of a different distribution than the MLP was trained on?

Proposed method evaluated in-distribution. sklearn.neural_network.MLPRegressor(hidden_layer_sizes=(32, 16), activation='relu', max_iter=2000, random_state=seed) trained offline on 200 Erdős-Rényi G(n=6, p=0.5) graphs with (degree_mean, degree_var, edge_density, n_edges) as features and grid-searched (beta_optimal, gamma_optimal) as targets. At test time, predict initial (beta, gamma) for a fresh in-distribution graph, then run COBYLA QAOA optimization starting from that initialization.

Proposed method evaluated out-of-distribution. Same MLP as mlp_init_in_distribution (trained on Erdős-Rényi G(n=6, p=0.5)). At test time, evaluated on 3-regular graphs at n=8: predict initial (beta, gamma) using the same feature extractor, then run COBYLA QAOA optimization.

random_init: classical baseline. Initial (beta, gamma) drawn from Uniform[0, pi/2] x Uniform[0, pi/2] using a per-graph seed independent of optimization seed. Then COBYLA QAOA from that point.

fixed_init_pi_over_4: classical baseline from Brandao 2018. Initial (beta, gamma) = (pi/4, pi/4). Then COBYLA QAOA. Tests whether the concentration prediction holds in practice at p=1.

Number of COBYLA iterations required to reach approximation ratio (cut_size / optimal_cut_size) >= 0.9 on each graph, with a hard cap at 20 iterations (cells that don't reach 0.9 within 20 iterations report 20 and success=False). Primary metric. 3-graph median per condition x graph_family cell.

approximation ratio (cut_size / optimal_cut_size) achieved after exactly 20 COBYLA iterations, regardless of whether the target threshold was met. 3-graph mean.

Fraction of the 3 random graph instances in a cell that reached approximation ratio 0.9 within the 20-iteration budget.

In-distribution test set. 3 fresh random Erdős-Rényi graphs G(n=6, p=0.5), distinct from the 200 graphs used for MLP training. Optimal MaxCut value computed by brute-force enumeration over the 2^6 cuts. QAOA p=1 on AerSimulator statevector backend.

Out-of-distribution test set. 3 random 3-regular graphs at n=8 (different size and edge density than the n=6 ER training distribution). Optimal MaxCut value by brute-force enumeration over 2^8 cuts. QAOA p=1 on AerSimulator statevector backend.

An empirical study of neural-network warm-start for QAOA-MaxCut at p=1. The agent must (a) precompute 200 Erdős-Rényi G(n=6, p=0.5) training graphs with their optimal (beta, gamma) via grid search to label the MLP training set, (b) train sklearn.MLPRegressor to predict (beta, gamma) from graph features, (c) at test time, predict (beta, gamma) and run COBYLA QAOA optimization starting from that init for up to 20 iterations, (d) compare against random and fixed (pi/4, pi/4) initialization baselines on both in-distribution (ER G(n=6, p=0.5)) and out-of-distribution (3-regular n=8) test graphs, and (e) score H1/H2/H3 with numerical evidence.

QAOA warm-start studies are scored on (i) whether the MLP is actually trained offline (cells reporting identical MLP predictions across different graph instances indicate the model is broken or untrained), (ii) whether the 4 initialization strategies actually produce different starting (beta, gamma) points (must be verified by sanity check), (iii) whether COBYLA is run from each init for exactly 20 iterations and the approximation_ratio trajectory is recorded, and (iv) whether H1/H2/H3 are supported by 3-graph-median numerical evidence keyed by (condition, graph_family). Quantitative result leaves use a graded scale.

Code-development bucket: QAOA p=1 circuit built via qiskit.circuit.library or hand-coded RX/RZ + CNOT correctly, MLP trained offline on graph features, and 4 initialization conditions actually produce different starting points.

QAOA p=1 circuit for MaxCut implemented correctly: H^{otimes n} initial state, then U_C(gamma) = product over edges of exp(-i * gamma * Z_i Z_j), then U_B(beta) = product over qubits of exp(-i * beta * X_i). Run on qiskit AerSimulator statevector backend; observable is the cut Hamiltonian sum_{(i,j) in E} (1 - Z_i Z_j) / 2. Optimization via qiskit_algorithms.optimizers.COBYLA(maxiter=20).

Offline phase: generate 200 random ER G(n=6, p=0.5) graphs with a different RNG than the test set. For each, compute the optimal (beta_optimal, gamma_optimal) via a 20x20 grid search on (beta, gamma) in [0, pi/2]^2 maximizing the QAOA p=1 expected cut size. Extract 4 graph features (degree_mean, degree_var, edge_density, n_edges) and fit sklearn.neural_network.MLPRegressor(hidden_layer_sizes=(32, 16), max_iter=2000) to map features -> (beta_optimal, gamma_optimal). The trained MLP is reused for both in-distribution and out-of-distribution test conditions.

The 4 initialization strategies produce different starting (beta, gamma) per test graph. Sanity check: for 3 test graphs, log the initial (beta, gamma) for each of the 4 conditions and verify they are not all equal. Each condition's COBYLA optimization is run for exactly 20 iterations, and the cut size at each iteration is recorded so the iterations_to_target_ratio can be computed by replaying the trajectory.

Execution-validity bucket: all cells ran and produced numerically valid outputs.

At least 22 cells out of 24 expected (4 conditions x 2 graph families x 3 seeds) completed and produced an iterations_to_target_ratio value (clamped to 20 if not reached). Missing more than 2 cells (10 percent) without documented justification fails this leaf.

Numerical validity: iterations_to_target_ratio is in [1, 20] (integer-valued, since COBYLA budget is 20); final_approximation_ratio is in [0, 1]; success_rate is in [0, 1]. At least one cell across the entire 24-cell sweep reaches AR >= 0.9 within 20 iterations (otherwise threshold is uncalibrated).

Quantitative test of H1. On in-distribution ER G(n=6, p=0.5) graphs, does mlp_init_in_distribution reach AR>=0.9 in <= 10 COBYLA iterations on 3-graph mean, while random_init requires >= 18? 100% if MLP <= 10 AND random >= 18, 67% if MLP at least 30 percent better than random, 33% if MLP marginally better than random, 0% if random equals or beats MLP.

Quantitative test of H2. On out-of-distribution 3-regular n=8 graphs, does mlp_init_out_of_distribution beat random_init by at least 20 percent in 3-graph-median iterations_to_target_ratio? 100% if mlp gain >= 20 percent, 67% if mlp gain 10-20 percent, 33% if mlp marginally faster, 0% if no transfer (random matches or beats MLP).

Quantitative test of H3. On in-distribution graphs, is the 3-graph-median iteration-count gap between fixed_init_pi_over_4 and mlp_init_in_distribution <= 30 percent (i.e. fixed init is competitive with MLP at p=1, consistent with Brandao 2018 concentration)? 100% if gap <= 30 percent, 67% if 30-60 percent, 33% if 60-100 percent, 0% if MLP is more than 2x better than fixed init (would refute the concentration interpretation).

Writeup of at least 200 words (submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1/H2/H3 backed by per-(condition, graph_family) median iteration counts and approximation ratios. References Brandao et al. 2018 concentration result and Jain et al. Quantum 2022 GNN-init paper. Discusses whether the observed out-of-distribution transfer rate is high enough that MLP-init is worth the offline training cost compared to fixed init.


Matrix Product State classifier vs neural network at matched parameter count on downsampled image classification, characterizing the bond-dimension scaling of tensor-network classifiers as a quantum-inspired classical baseline for QML

A Matrix Product State (MPS) is a tensor network in which a target
tensor of N indices is decomposed into a 1D chain of N small tensors,
each connected to its neighbors by "bond" indices of dimension chi.
MPS originated in condensed-matter physics as the representation
underlying the Density Matrix Renormalization Group (DMRG) for 1D
ground-state computation, and Schollwock's 2011 review remains the
canonical reference. Stoudenmire and Schwab (NeurIPS 2016, "Supervised
Learning with Tensor Networks") repurposed the MPS as a classical
supervised classifier. The idea is simple: each input feature
(pixel) is mapped to a small feature vector (e.g. cos(pi*x/2),
sin(pi*x/2) for grayscale x in [0,1]), and the per-pixel feature
vectors are contracted with a chain of MPS tensors to produce a
class-score vector. The MPS bond dimension chi controls how much
correlation between distant pixels the classifier can capture,
giving an interpretable expressivity knob.

Crucially, the MPS classifier runs entirely on classical hardware.
This makes it a "quantum-inspired classical" baseline: the same
mathematical machinery as a low-entanglement quantum state, but
implemented as a NumPy tensor contraction. Glasser et al. (PRX 2018)
extended the framework to richer tensor networks. More recent
benchmarks (Liu et al. 2022 Nature Communications Physics) have asked
where the bond-dimension sweet spot is for image classification and
whether MPS classifiers can be competitive with CNNs at small
parameter budgets.

This topic asks whether an MPS classifier matches a parameter-matched
CNN baseline on a CPU-feasible image classification task. The
comparison is not "does MPS beat CNN at large scale" (it doesn't, on
high-resolution images) but rather "at matched small parameter
counts, is the MPS inductive bias competitive with a small CNN's
spatial bias on 8x8 downsampled MNIST and Fashion-MNIST?" The
question is timely because tensor-network ML is increasingly cited
as the honest classical baseline against which to measure quantum
machine learning claims of advantage.

Implementation guidance. Use pure NumPy or PyTorch for the MPS
contraction (no qiskit required for this topic; it is quantum-inspired
classical computation). The standard MPS classifier from Stoudenmire
& Schwab 2016 stores N+1 tensors of shape (chi, d, chi) where N is
the number of pixels (64 for an 8x8 image), d=2 is the per-pixel
feature dimension (we use the cos/sin embedding), and chi is the
bond dimension. The CNN baseline is a single 3x3 convolution layer
with K filters followed by a fully connected output layer; K is
chosen so the total parameter count is within 10 percent of the MPS
parameter count at each bond dimension.

Experimental protocol. Three MPS bond dimensions (chi=4, chi=8,
chi=16) are compared against two classical baselines (logistic
regression on flattened 8x8 pixels; small CNN with parameter count
matched to the chi=8 MPS). All five conditions are evaluated on two
datasets: 8x8 downsampled MNIST (10 classes, 5000 train / 1000 test
images) and 8x8 downsampled Fashion-MNIST (10 classes, same
size). Each (condition, dataset) cell is averaged over 3 random
seeds (controlling MPS / CNN initialization and the train / test
split). Total cells: 5 conditions x 2 datasets x 3 seeds = 30 cells.

Research question: *On 8x8 downsampled MNIST and Fashion-MNIST, do
MPS classifiers at moderate bond dimension chi reach the test
accuracy of a parameter-matched CNN, and how does the accuracy
scale with chi?*

On 8x8 downsampled MNIST, the MPS classifier at bond dimension chi=16 reaches at least 92 percent test accuracy (3-seed mean), matching the Stoudenmire & Schwab 2016 result scaled to this image size.

On 8x8 downsampled Fashion-MNIST, the parameter-matched CNN beats the chi=16 MPS classifier by at least 5 absolute percentage points (3-seed mean), reflecting the CNN's stronger inductive bias for spatial texture features that are more important on Fashion-MNIST than on plain digits.

Test accuracy of the MPS classifier scales log-linearly with bond dimension: on 8x8 MNIST the chi=4 to chi=8 gain in 3-seed mean accuracy is greater than the chi=8 to chi=16 gain (consistent with saturating expressivity at moderate chi).

On 8x8 downsampled MNIST and Fashion-MNIST, do MPS classifiers at moderate bond dimension chi reach the test accuracy of a parameter-matched CNN, and how does accuracy scale with chi?

Matrix Product State classifier with bond dimension chi=4. 64 pixels x 2-dim per-pixel feature embedding x chi=4 bonds, with a per-class output index. Approximate parameter count: 64 * 2 * 4 * 4 = 2048 parameters. Trained with Adam on cross-entropy for 50 epochs.

MPS classifier with chi=8. Approximate parameter count: 64 * 2 * 8 * 8 = 8192. Trained with Adam on cross-entropy for 50 epochs.

MPS classifier with chi=16. Approximate parameter count: 64 * 2 * 16 * 16 = 32768. Trained with Adam on cross-entropy for 50 epochs.

logistic_regression: sklearn.linear_model.LogisticRegression(C=1.0, max_iter=1000, multi_class='multinomial') on flattened 8x8 pixels. Classical linear baseline, ~640 parameters.

small_cnn_matched: PyTorch CNN with a single 3x3 conv layer of K=12 filters followed by an FC(K*6*6, 10) output, chosen so total parameter count is within 10 percent of the chi=8 MPS (target ~8200 parameters). Trained with Adam for 50 epochs.

Top-1 classification accuracy on the 1000-image held-out test set, 3-seed mean. Primary metric.

Total number of trainable parameters in the model. Reported for parity validation across conditions: matched-parameter comparisons require this to be within 10 percent across the relevant condition pair.

Wall-clock seconds for 50 epochs of training, measured per cell. Tests the practical compute cost of each method at matched accuracy.

sklearn.datasets.fetch_openml('mnist_784') downsampled to 8x8 via skimage.transform.resize

MNIST handwritten digits 0-9, downsampled from 28x28 to 8x8 grayscale, normalized to [0, 1]. 5000 training images, 1000 test images (stratified split, fixed random_state=seed). The 8x8 resolution is small enough for CPU MPS contraction but large enough to retain class structure (LogReg should reach ~85 percent here).

sklearn.datasets.fetch_openml('Fashion-MNIST') downsampled to 8x8

Fashion-MNIST clothing items (T-shirt, trouser, pullover, etc.) downsampled from 28x28 to 8x8. Tests model performance on texture-rich images where CNN inductive bias should be more important than for handwritten digits.

An empirical study of Matrix Product State (MPS) classifiers vs neural network baselines at matched parameter count on 8x8 downsampled image classification. The agent must (a) build an MPS classifier following Stoudenmire and Schwab 2016 with cos/sin per-pixel feature embedding and bond dimensions chi in {4, 8, 16}, (b) train each MPS via Adam for 50 epochs on 5000 training images, (c) compare against sklearn LogisticRegression and a small PyTorch CNN whose parameter count is within 10 percent of the chi=8 MPS, (d) evaluate test accuracy on a 1000-image held-out set, and (e) score H1/H2/H3 with numerical evidence.

MPS classifier studies are scored on (i) correctness of the MPS contraction (the per-pixel features cos(pi*x/2), sin(pi*x/2) must enter as a rank-2 tensor at each site, NOT collapsed to a single scalar), (ii) the parameter-count parity between chi=8 MPS and small_cnn_matched within 10 percent (deviation > 10 percent fails q11-code-cnn-parity), (iii) the same train/test split being used across all conditions for a given seed, and (iv) accuracy values being in [0, 1] with non-degenerate predictions. Quantitative result leaves use a graded scale.

Code-development bucket: MPS classifier implemented correctly with proper per-pixel feature embedding, CNN baseline parameter-matched, and training pipeline shared across conditions.

MPS classifier uses pure NumPy or PyTorch tensor contractions. Per-pixel feature embedding is phi(x) = [cos(pi*x/2), sin(pi*x/2)] for grayscale x in [0,1] (Stoudenmire and Schwab 2016 standard). The MPS is a chain of 64 tensors of shape (chi, 2, chi) (interior sites) plus 2 boundary tensors with one chi leg removed, with one site carrying an additional class index of size 10. Trained with Adam (lr=0.01, 50 epochs, batch_size=64). A sanity check confirms that MPS at chi=4 has approximately 64 * 2 * 16 = 2048 trainable parameters within 20 percent.

small_cnn_matched is implemented in PyTorch as Conv2d(1, K, kernel_size=3, padding=1) + ReLU + Flatten + Linear(K*8*8, 10) with K chosen so total parameter count is within 10 percent of the chi=8 MPS parameter count. K is calculated explicitly and the parameter counts are logged for both. Trained with Adam (same hyperparams as MPS) for 50 epochs.

Nested loop over 5 conditions x 2 datasets x 3 seeds = 30 cells. Each cell uses the same train/test split given a fixed seed (i.e. the per-seed split is computed once and shared across the 5 conditions). MNIST is downsampled to 8x8 via skimage.transform.resize. Per-cell results are logged to stdout as METRIC_RESULT JSON lines containing condition, dataset, seed, test_accuracy, trainable_parameter_count, training_time_sec.

Execution-validity bucket: all 30 cells ran with valid outputs.

At least 27 cells out of 30 expected (5 conditions x 2 datasets x 3 seeds) completed without unhandled errors and produced a test_accuracy value. Missing more than 3 cells (10 percent) without documented justification fails this leaf.

Numerical validity: test_accuracy values are in [0, 1], not equal to 1/n_classes (would mean random predictions, model didn't train), and the 3 MPS chi levels produce different mean test_accuracy on at least one dataset (max - min across chi=4/8/16 mean accuracy on MNIST is at least 0.01). trainable_parameter_count is reported per cell and matches the expected formula within 1 percent.

Results bucket: quantitative tests of H1/H2/H3 plus a per-hypothesis writeup.

Quantitative test of H1. Does the MPS at chi=16 reach test_accuracy >= 92 percent on 8x8 downsampled MNIST (3-seed mean)? 100% if >= 92 percent, 67% if >= 85 percent, 33% if >= 75 percent, 0% otherwise.

Quantitative test of H2. On 8x8 Fashion-MNIST, does the parameter-matched CNN beat chi=16 MPS by at least 5 absolute percentage points (3-seed mean)? 100% if CNN gap >= 5pp, 67% if CNN gap 2-5pp, 33% if CNN gap 0-2pp, 0% if MPS matches or beats CNN.

Quantitative test of H3. On 8x8 MNIST, is the chi=4 to chi=8 accuracy gain greater than the chi=8 to chi=16 accuracy gain (3-seed mean)? Specifically: (acc_chi8 - acc_chi4) > (acc_chi16 - acc_chi8). 100% if cleanly satisfied with difference of differences >= 1pp, 67% if log-linear trend holds with smaller gap, 33% if marginally so, 0% if linear or super-linear scaling observed.

Writeup of at least 200 words (submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1/H2/H3 backed by per-(condition, dataset) mean test accuracies and the trainable_parameter_count parity check between chi=8 MPS and small_cnn_matched. References Stoudenmire and Schwab NeurIPS 2016 and discusses whether the observed MNIST vs Fashion-MNIST gap is consistent with the CNN's stronger spatial-bias inductive prior.


Layerwise learning vs end-to-end training for variational quantum classifiers: testing the Skolik 2021 claim that incremental ansatz growth avoids barren plateaus on small UCI binary classification tasks

Variational quantum classifiers (VQCs) at moderate depth (reps >= 5)
suffer from barren plateaus: the gradient of the loss with respect to
any single parameter is exponentially suppressed when the ansatz is
initialized randomly across all layers. Skolik et al. (Quantum 2021,
"Layerwise learning for quantum neural networks") proposed a training
schedule that avoids this trap by adding ansatz layers incrementally.
Concretely, the agent trains a reps=1 ansatz to convergence, freezes
its parameters, prepends or appends a fresh reps=1 block initialized
to identity, trains only the new block to convergence, and so on
until the target depth is reached. Each layer of training sees a much
smaller parameter space, so the gradient signal stays well above the
barren-plateau floor at every step.

The empirical question this topic addresses is whether the layerwise
schedule actually delivers higher final test accuracy AND faster
practical convergence than naive end-to-end training of the full
reps=5 ansatz on small UCI binary classification tasks. A
parameter-matched classical baseline (sklearn MLPClassifier) and a
logistic regression baseline serve as the cross-paradigm controls
required by the bench's PROCEED gate; they also calibrate the
difficulty of each dataset (logistic regression should fit linear
separable cases cleanly).

Implementation guidance is provided by the quantum-qiskit skill,
which is automatically injected at stage 10. Use
qiskit.circuit.library.EfficientSU2(num_qubits=4, reps=5,
entanglement='linear') as the underlying ansatz family, and use
qiskit_machine_learning.algorithms.VQC for training (it works in
qiskit 2.x; do NOT use qiskit_algorithms.VQE which is broken). For
the layerwise condition, the agent must implement the layer-freezing
schedule manually: construct an ansatz with only the first k blocks
trainable and previous blocks bound to their converged parameters.
The classical baselines train on the same 80/20 train/test split
using the same per-seed random_state.

Experimental protocol. Three quantum conditions compare training
schedules at the same final depth (reps=5): layerwise growth from
reps=1 to reps=5, end-to-end training of reps=5 from random
initialization, and a random-init control (no training, evaluate
the randomly initialized reps=5 ansatz). Two classical baselines
(logistic regression, MLPClassifier with parameter count matched to
the VQC's 40-parameter count) provide the cross-paradigm reference.
Each (condition, dataset) cell is averaged over 3 seeds. Total:
5 conditions x 2 datasets x 3 seeds = 30 cells.

Research question: *Does layerwise incremental training of a VQC
reach higher test accuracy or faster convergence than end-to-end
training of the same final-depth ansatz, and does the layerwise
gradient norm at each newly added layer remain above the
barren-plateau threshold?*

Layerwise training reaches higher test accuracy than end-to-end training on at least 1 of 2 datasets, with a 3-seed-mean gap of at least 3 absolute percentage points.

The mean gradient norm during the first 10 optimization steps of the layerwise schedule (averaged across all newly added blocks) is at least 5 times larger than the mean gradient norm during the first 10 steps of end-to-end training (3-seed mean), confirming the Skolik 2021 mechanism.

Both layerwise and end-to-end VQC outperform the random-init control (no training) by at least 5 absolute percentage points on both datasets (3-seed mean), confirming that training actually contributes — the ansatz itself is not memorizing class structure at initialization.

Does layerwise incremental training of a 4-qubit reps=5 VQC reach higher test accuracy or faster convergence than end-to-end training of the same ansatz on small UCI binary classification?

EfficientSU2(num_qubits=4, reps=5, entanglement='linear'). Training schedule: (1) train only the first reps=1 block via VQC.fit() for 80 COBYLA iterations; (2) freeze those parameters, add a fresh reps=1 block initialized to small N(0, 0.01) noise, train only the new block for 80 iterations; repeat until all 5 blocks are trained. Record the gradient norm at the start of each new layer's training.

EfficientSU2(num_qubits=4, reps=5, entanglement='linear'). Single VQC.fit() call training all 40 parameters simultaneously from random N(0, 0.1) initialization for 400 COBYLA iterations (5 x 80, matching the total iteration budget of the layerwise schedule).

Same EfficientSU2 ansatz, parameters drawn from Uniform[-pi, pi] and NEVER trained. Evaluate predict() directly on the test set. Floor for trainability — any trained model should beat this.

logistic_regression: sklearn.linear_model.LogisticRegression(max_iter=1000, random_state=seed). Linear classical baseline.

mlp_matched: sklearn.neural_network.MLPClassifier(hidden_layer_sizes=(8,), activation='relu', max_iter=500, random_state=seed). Parameter count: 4*8 + 8 + 8*1 + 1 = 49 parameters, within 20 percent of the VQC's 40 parameters.

Held-out 20 percent test split accuracy, 3-seed mean. Primary metric.

L2 norm of the gradient vector averaged across the first 10 optimization steps. For layerwise, averaged across the first 10 steps of each newly added block. For end-to-end, the first 10 steps of the single training run. Tests the Skolik mechanism.

Number of total COBYLA iterations to reach test accuracy >= 0.8 (or to budget 400 if never reached). Tests practical convergence speed.

sklearn.datasets.load_iris + PCA to 4 dimensions

Iris dataset restricted to classes {versicolor=1, virginica=2} (binary, 100 samples). PCA to 4 dimensions on standard-scaled features. 80/20 split. Approximately linearly separable; logistic regression should reach >=85 percent.

sklearn.datasets.load_breast_cancer + PCA to 4 dimensions

Wisconsin breast cancer dataset, 569 samples, 30 features reduced to 4 via PCA. 80/20 split. Non-trivially separable; logistic regression reaches around 0.92.

An empirical study of layerwise vs end-to-end training of a 4-qubit reps=5 EfficientSU2 VQC on UCI binary classification (iris-binary and breast-cancer). The agent must (a) implement the layerwise training schedule manually (train reps=1, freeze, add reps=1, train, ...), (b) implement the end-to-end baseline that trains all 5 reps together, (c) measure mean gradient norm during the first 10 optimization steps of each schedule to test the Skolik 2021 mechanism, and (d) compare against logistic regression + parameter-matched MLP baselines. Score H1/H2/H3 with numerical evidence.

Layerwise studies are scored on (i) correctness of the freeze-and-add mechanism (verifiable: the layerwise condition should have N optimizer.minimize() calls each operating on a subset of parameters, not 1 single call over all parameters), (ii) parameter counts matching across conditions (the layerwise and end-to-end VQCs must end with the same 40-parameter ansatz), (iii) the gradient-norm probe being measured at consistent points across conditions, (iv) the random-init control producing accuracy near 0.5 on both datasets (otherwise the ansatz is leaking labels through initialization).

Code-development bucket: layerwise freeze-and-add schedule implemented manually, classical baselines parameter-matched, gradient-norm probe consistent.

The layerwise condition trains the EfficientSU2(reps=5) ansatz by 5 sequential optimizer.minimize() calls. Each call trains only the parameters belonging to the newly added reps=1 block while the previous blocks have their parameters bound to their previously converged values via qiskit.QuantumCircuit.assign_parameters() on a partial dictionary. After all 5 calls the final fitted VQC has 40 trainable parameters, identical in count to the end-to-end VQC.

Mean gradient norm during the first 10 optimization steps is recorded per condition via the qiskit_machine_learning VQC callback or via a custom wrapper around the loss function that uses parameter-shift gradients. For layerwise, the metric is averaged across the first 10 steps of each newly added block (so total of 50 steps averaged, since 5 blocks x 10). For end-to-end, the metric is the first 10 steps of the single training run.

mlp_matched uses sklearn.neural_network.MLPClassifier(hidden_layer_sizes=(8,)) for ~49 parameters, within 20 percent of the VQC's 40 parameters. logistic_regression uses sklearn.linear_model.LogisticRegression(max_iter=1000). Both train on the same 80/20 train/test split as the VQC conditions using the same per-seed random_state.

Execution-validity bucket: all 30 cells ran and produced numerically valid outputs.

Numerical validity: test_accuracy in [0, 1] with non-degenerate predictions (no condition collapses to a single-class predictor on all test samples). The random_init_control condition produces test_accuracy approximately 0.5 +/- 0.1 on both datasets (otherwise label leakage in the untrained ansatz). mean_gradient_norm_first10 is strictly positive across all cells.

Quantitative test of H1. On at least 1 of 2 datasets, is layerwise test_accuracy >= end-to-end test_accuracy + 3 absolute pp (3-seed mean)? 100% if gap >= 3pp on at least 1 dataset, 67% if gap >= 1pp on at least 1 dataset, 33% if layerwise marginally faster on any dataset, 0% if end-to-end equals or beats layerwise on both datasets.

Quantitative test of H2. Is mean_gradient_norm_first10 of layerwise >= 5x mean_gradient_norm_first10 of end-to-end (3-seed mean, across both datasets combined)? 100% if ratio >= 5x, 67% if 2-5x, 33% if any positive ratio (layerwise > end-to-end), 0% otherwise.

Quantitative test of H3. Do both layerwise and end-to-end test_accuracy exceed random_init_control test_accuracy by >= 5 absolute pp on both datasets (3-seed mean)? 100% if both gaps >= 5pp on both datasets, 67% if both on 1 dataset, 33% if at least one VQC beats random anywhere, 0% if random matches or beats trained VQCs.

Writeup of at least 200 words (submission/README.md ## Agent-produced writeup section) with explicit supported / refuted / inconclusive verdict for each of H1/H2/H3 backed by specific 3-seed mean test_accuracy, mean_gradient_norm_first10, and iterations_to_target_accuracy values per (condition, dataset). References Skolik et al. Quantum 2021 and discusses whether the layerwise gradient-norm advantage matches their theoretical prediction.