Barren Plateau Detection
Overview
Barren plateaus are flat regions in the optimization landscape where gradients vanish exponentially with system size. This circuit analyzes gradient behavior to detect and quantify barren plateaus.
| Property | Value |
|---|---|
| Category | Ansatz |
| Difficulty | Advanced |
| Framework | Cirq |
| Qubits | Variable |
| Purpose | Analysis |
The Problem
For deep random circuits:
CODEVar[∂L/∂θ] ∝ 2^(-αn)
Where:
- n: Number of qubits
- α: Decay exponent (α ≈ 1 for hardware-efficient ansatze)
Detection Method
- Sample random parameters θ
- Compute gradient ∂⟨O⟩/∂θ₀ using parameter-shift
- Collect variance across many samples
- Fit exponential decay vs. n
Circuit Under Analysis
CODELayer 1-L: ┌────────┐┌────────┐ q_0: ┤ RY(θ₀) ├┤ RZ(θ₁) ├──●─────── ├────────┤├────────┤┌─┴─┐ q_1: ┤ RY(θ₂) ├┤ RZ(θ₃) ├┤ X ├──●── ├────────┤├────────┤└───┘┌─┴─┐ q_2: ┤ RY(θ₄) ├┤ RZ(θ₅) ├─────┤ X ├ └────────┘└────────┘ └───┘
Running the Circuit
PYTHONfrom circuit import run_circuit result = run_circuit(max_qubits=6, n_layers=3) for n_q, data in result['qubit_analysis'].items(): print(f"{n_q} qubits: Var = {data['variance']:.6f}") print(f"Decay exponent: {result['decay_exponent']:.3f}") print(f"Barren plateau: {result['barren_plateau_detected']}")
Expected Results
| Qubits | Variance |
|---|---|
| 2 | ~0.1 |
| 3 | ~0.05 |
| 4 | ~0.02 |
| 5 | ~0.01 |
| 6 | ~0.005 |
Mitigation Strategies
1. Shallow Circuits
- Fewer layers → larger gradients
- Trade-off with expressibility
2. Local Cost Functions
- Measure local observables
- Avoid global entanglement
3. Layer-wise Training
- Train one layer at a time
- Gradually increase depth
4. Identity Initialization
- Start near identity circuit
- Gradients initially large
5. Correlated Parameters
- Share parameters across qubits
- Reduces effective randomness
Barren Plateau Causes
| Cause | Solution |
|---|---|
| Deep circuits | Reduce depth |
| Global cost | Local cost |
| Random init | Structured init |
| High expressibility | Restrict ansatz |