Expressibility Analysis of Variational Quantum Ansatze
Overview
Expressibility quantifies how uniformly a parameterized quantum circuit can explore the Hilbert space. An ansatz that produces states distributed close to the Haar-random measure is maximally expressive, meaning it can represent (in principle) any quantum state. This circuit implements the expressibility framework introduced by Sim et al. (2019) and compares three ansatz families of increasing complexity.
| Property | Value |
|---|---|
| Category | Ansatz |
| Difficulty | Advanced |
| Framework | Cirq |
| Qubits | 4 (configurable) |
| Depth | Variable |
| Gates | RY, RZ, RX, CZ, CNOT |
| Purpose | Analysis / Benchmarking |
Background
Why Expressibility Matters
Variational quantum algorithms (VQE, QAOA, QML classifiers) rely on parameterized circuits as function approximators. The expressibility of the chosen ansatz directly impacts:
- Accuracy ceiling: A more expressive ansatz can reach lower energy states or higher classification accuracy.
- Trainability trade-off: Highly expressive circuits are more susceptible to barren plateaus (McClean et al., 2018), where gradients vanish exponentially with qubit count.
- Hardware efficiency: The goal is to find ansatze that are expressive enough for the task while remaining shallow enough for near-term devices.
Expressibility provides a task-independent metric for comparing ansatz architectures before committing to expensive optimisation loops.
The Expressibility Metric
Following Sim et al. (2019, Eq. 5), expressibility is defined as the Kullback-Leibler (KL) divergence between the fidelity distribution of the ansatz and the Haar-random fidelity distribution:
Expr = D_KL( P_ansatz(F) || P_Haar(F) )
where the fidelity between two states prepared by the same ansatz with different parameters is:
F(theta_1, theta_2) = |<psi(theta_1)|psi(theta_2)>|^2
Lower KL divergence = higher expressibility (the ansatz distribution is closer to Haar random).
Haar-Random Reference
For an n-qubit system with Hilbert space dimension d = 2^n, the fidelity between two Haar-random states follows the Beta(1, d - 1) distribution analytically. As n grows, this distribution concentrates sharply near F = 0, reflecting the exponential growth of the state space. We estimate this reference distribution empirically by sampling random complex vectors from the isotropic Gaussian measure and normalising.
Methodology
Step 1: Fidelity Sampling
For each ansatz type and for each of n_samples iterations:
- Draw two independent parameter vectors uniformly from [0, 2*pi).
- Construct the ansatz circuit with each parameter set.
- Simulate both circuits to obtain statevectors.
- Compute fidelity:
F = |<psi_1|psi_2>|^2.
Step 2: Histogram Construction
Bin the fidelity samples into 50 equally spaced bins over [0, 1]. Add a small epsilon (1e-10) to each bin to avoid log(0) in the KL computation. Normalise to obtain a discrete probability distribution.
Step 3: KL Divergence
Compute:
D_KL(P || Q) = sum_i P(i) * log( P(i) / Q(i) )
where P is the ansatz distribution and Q is the Haar reference.
Step 4: Verification
The verify_expressibility() function checks:
- HEA is more expressive than the simple ansatz (entanglement helps).
- All KL divergence values are non-negative (mathematical invariant).
- All mean fidelity values lie in [0, 1] (physical constraint).
- The ranking matches the expected order: strongly_entangling > hea > simple.
Analysed Ansatze
Simple (Product States)
|psi> = RY(theta_1)|0> (x) RY(theta_2)|0> (x) ... (x) RY(theta_n)|0>
- Parameters per layer: n_qubits
- Entanglement: None
- Reachable states: Product states only (exponentially small fraction of Hilbert space)
- Expressibility: Low (high KL divergence)
Hardware-Efficient Ansatz (HEA)
Layer: [RY(theta) - RZ(theta) per qubit] -> [CZ ladder: q0-q1, q1-q2, ...]
- Parameters per layer: 2 * n_qubits
- Entanglement: Nearest-neighbour (linear topology)
- Reachable states: Entangled states within the light-cone of the CZ ladder
- Expressibility: Moderate
Strongly Entangling
Layer: [RX(theta) - RY(theta) - RZ(theta) per qubit] -> [All-to-all CNOT]
- Parameters per layer: 3 * n_qubits
- Entanglement: All-to-all (every pair connected)
- Reachable states: Dense coverage of Hilbert space
- Expressibility: High (low KL divergence)
Running the Circuit
Basic Usage
PYTHONfrom circuit import run_circuit result = run_circuit(n_qubits=4, n_layers=2, n_samples=200) for name, data in result["ansatze"].items(): print(f"{name}: KL = {data['expressibility']:.4f}") print(f"Ranking: {result['ranking']}")
Custom Configuration
PYTHON# Higher statistical accuracy (slower) result = run_circuit(n_qubits=3, n_layers=3, n_samples=500) # Quick exploration (faster, noisier estimates) result = run_circuit(n_qubits=2, n_layers=1, n_samples=50)
Verification
PYTHONresult = run_circuit(n_qubits=4, n_layers=2, n_samples=200) for check in result["verification"]["checks"]: status = "PASS" if check["passed"] else "FAIL" print(f"[{status}] {check['name']}: {check['message']}")
Expected Results
Typical expressibility values for 4 qubits, 2 layers, 200 samples:
| Ansatz | KL Divergence | Mean Fidelity | Entanglement |
|---|---|---|---|
| Simple | ~0.8 -- 1.2 | ~0.25 -- 0.40 | None |
| HEA | ~0.15 -- 0.50 | ~0.05 -- 0.20 | Linear (CZ) |
| Strongly Entangling | ~0.02 -- 0.15 | ~0.02 -- 0.10 | All-to-all (CNOT) |
Note: Exact values vary due to finite sampling. Increasing n_samples reduces variance.
Trade-offs and Design Considerations
| More Expressive | Less Expressive |
|---|---|
| Closer to Haar random | Restricted state space |
| Higher accuracy ceiling | Lower accuracy ceiling |
| More parameters, deeper circuits | Fewer parameters, shallower circuits |
| Greater barren plateau risk | Stronger gradient signal |
| Harder to train classically | Easier classical optimisation |
| More CNOT/CZ gates (noise) | Fewer entangling gates |
The "right" expressibility depends on the task. Overparameterised circuits waste resources; underparameterised ones cannot represent the target state.
Computational Complexity
| Component | Scaling |
|---|---|
| Statevector simulation | O(2^n) per circuit |
| Fidelity computation | O(2^n) per pair |
| Total per ansatz | O(n_samples * 2^n) |
| KL divergence | O(n_bins) |
For n > 20 qubits, statevector simulation becomes impractical; tensor network or sampling-based estimators are needed.
Applications
- Ansatz selection: Compare candidate architectures before running expensive VQE/QAOA optimisations.
- Circuit design: Quantify the effect of adding entangling gates or increasing depth.
- Benchmarking: Produce standardised expressibility rankings across frameworks.
- Barren plateau studies: Correlate expressibility with gradient variance (Hubregtsen et al., 2021).
- Hardware-aware design: Evaluate whether hardware connectivity constraints limit expressibility.
Limitations
- Finite sampling: KL divergence estimates are biased for small sample sizes. Use at least 200 samples for qualitative comparisons.
- Task independence: Expressibility measures general coverage, not task-specific suitability. A less expressive ansatz may outperform a more expressive one if it has an inductive bias matching the problem structure.
- Classical simulation: Limited to small qubit counts by statevector simulation cost.
- Single metric: Expressibility alone does not capture entangling capability (also defined in Sim et al. 2019) or trainability.
References
-
Sim, S., Johnson, P. D., & Aspuru-Guzik, A. (2019). "Expressibility and Entangling Capability of Parameterized Quantum Circuits for Hybrid Quantum-Classical Algorithms." Advanced Quantum Technologies, 2(12), 1900070. DOI: 10.1002/qute.201900070
-
Hubregtsen, T., Pichlmeier, J., Stecher, P., & Bertels, K. (2021). "Evaluation of parameterized quantum circuits: on the relation between classification accuracy, expressibility, and entangling capability." Quantum Science and Technology, 7(1), 015003. DOI: 10.1088/2058-9565/ac7346
-
McClean, J. R., Boixo, S., Smelyanskiy, V. N., Babbush, R., & Neven, H. (2018). "Barren plateaus in quantum neural network training landscapes." Nature Communications, 9, 4812. DOI: 10.1038/s41467-018-07090-4
-
Kandala, A., Mezzacapo, A., Temme, K., Takita, M., Brink, M., Chow, J. M., & Gambetta, J. M. (2017). "Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets." Nature, 549, 242--246. DOI: 10.1038/nature23879
-
Schuld, M., Sweke, R., & Meyer, J. K. (2021). "Effect of data encoding on the expressive power of variational quantum machine learning models." Physical Review A, 103(3), 032430. DOI: 10.1103/PhysRevA.103.032430