Subspace-Search VQE (SSVQE)
What You'll Learn:
- How to find multiple eigenstates in a single optimization, not sequentially
- How weighted cost functions assign energy levels to optimization slots
- Why orthogonality penalties are essential to prevent state collapse
- How SSVQE compares to VQD (sequential) and MC-VQE (contracted)
Level: Advanced | Time: 30 minutes | Qubits: 4 | Framework: Qiskit
Prerequisites
- H2 Excited States — VQD, overlap penalties
- H2 Ground State — VQE basics
The Idea
VQD finds states one at a time: ground state first, then first excited, then second. Each search depends on the previous one. If you want K states, you need K sequential optimizations.
SSVQE flips this: it optimizes all K states simultaneously in a single optimization. Each state gets its own ansatz circuit, and a weighted cost function ensures they naturally sort into energy order. The trick is simple — give the ground state the highest weight in the cost function. The optimizer, trying to minimize the weighted sum, will assign its lowest-energy solution to the highest-weighted slot.
CODEVQD (Sequential): SSVQE (Simultaneous): ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ │ Find │ → penalty → Find E₁ │ Find │ │ Find │ │ Find │ │ E₀ │ penalty → E₂ │ E₀ │ │ E₁ │ │ E₂ │ └───────┘ └───┬───┘ └───┬───┘ └───┬───┘ 3 optimizations └────┬────┘────┬────┘ 1 joint optimization
How It Works
The Cost Function
SSVQE minimizes a weighted sum of energies plus orthogonality penalties:
CODEL(θ) = Σₖ wₖ ⟨ψₖ(θₖ)|H|ψₖ(θₖ)⟩ + λ Σᵢ<ⱼ |⟨ψᵢ|ψⱼ⟩|² ↑ weighted energies ↑ orthogonality penalty
Weight Assignment
Weights control which slot gets which energy level:
| Slot | Weight | Assigned state |
|---|---|---|
| k=0 | w₀ = 3 | Ground state (lowest E → maximizes w₀ × E₀ reduction) |
| k=1 | w₁ = 2 | First excited |
| k=2 | w₂ = 1 | Second excited |
The optimizer minimizes 3×E₀ + 2×E₁ + 1×E₂. Since E₀ has the largest coefficient, the optimizer works hardest to minimize E₀ — naturally placing the ground state in slot 0.
Orthogonality Penalty
Without the penalty, all states would collapse to the ground state (minimizes all energies). The penalty term λ Σᵢ<ⱼ |⟨ψᵢ|ψⱼ⟩|² adds a large cost whenever two states overlap, forcing them apart.
Per-State Ansatz
Each state k has its own hardware-efficient ansatz with independent parameters θₖ:
CODEState k: ┌────────┐ ┌────────┐┌────────┐ q_0: ┤ RY(θₖ₀)├──■───────┤ RY(θₖ₄)├┤ RZ(θₖ₅)├── ... ├────────┤┌─┴─┐ ├────────┤├────────┤ q_1: ┤ RY(θₖ₁)├┤ X ├──■──┤ RY(θₖ₆)├┤ RZ(θₖ₇)├── ... ├────────┤└───┘┌─┴─┐├────────┤├────────┤ q_2: ┤ RY(θₖ₂)├─────┤ X ├┤ RY(θₖ₈)├┤ RZ(θₖ₉)├── ... ├────────┤ └───┘├────────┤├────────┤ q_3: ┤ RY(θₖ₃)├──────────┤ RY(...)├┤ RZ(...)├── ... └────────┘ └────────┘└────────┘
With 4 qubits, 2 layers, and 3 states: 20 parameters per state × 3 states = 60 total parameters.
The Math
Weight Theorem
For weights w₀ > w₁ > ... > wₖ₋₁ > 0, the global minimum of the weighted cost function assigns the k-th eigenstate to the k-th slot (assuming sufficient ansatz expressibility and perfect orthogonality).
Proof sketch: Suppose state 0 and state 1 are swapped. Then the cost would be w₀E₁ + w₁E₀ + ... Since E₀ < E₁ and w₀ > w₁, we have w₀E₁ + w₁E₀ > w₀E₀ + w₁E₁. So the swapped configuration has higher cost — the optimizer prefers the sorted assignment.
Transverse Field Ising Model
H = -Σᵢ ZᵢZᵢ₊₁ - h Σᵢ Xᵢ (h = 0.5)
At h = 0.5 (ordered phase), the ground state is near the ferromagnetic configuration. The spectrum has clear gaps between the lowest eigenvalues.
Expected Output
| State | SSVQE | Exact | Error |
|---|---|---|---|
| E₀ | ~-4.50 | -4.50 | < 0.1 |
| E₁ | ~-3.50 | -3.50 | < 0.2 |
| E₂ | ~-2.50 | varies | < 0.3 |
Max overlap between states: < 0.05 (near-orthogonal).
Running the Circuit
PYTHONfrom circuit import run_circuit, verify_ssvqe, compute_exact_eigenvalues # Exact reference exact = compute_exact_eigenvalues(n_states=3) print(f"Exact: {[f'{e:.4f}' for e in exact]}") # SSVQE: find 3 states simultaneously result = run_circuit(n_states=3, max_iterations=100, seed=42) for state in result['states']: print(f"E_{state['rank']}: {state['energy']:.4f}") print(f"Max overlap: {result['max_overlap']:.4f}") # Verification v = verify_ssvqe() for check in v["checks"]: status = "PASS" if check["passed"] else "FAIL" print(f"[{status}] {check['name']}: {check['detail']}")
Try It Yourself
-
Change weights: Use equal weights
[1, 1, 1]— do the states still sort correctly? (They shouldn't — the optimizer has no preference.) -
Increase penalty: Set
penalty_strength=100.0in the cost function. Does orthogonality improve? Does convergence slow down? -
5-qubit system: Run with
n_qubits=5. The parameter count jumps to 25 per state × 3 = 75 total. Does optimization still converge? -
Compare with VQD: Run the VQD algorithm circuit for the same Hamiltonian. Compare: which finds better excited states? Which is faster wall-clock?
What's Next
- VQD Algorithm — Sequential approach (fewer parameters, compounds errors)
- Multistate VQE — Contracted Hamiltonian approach
- H2 Excited States — Simplest VQD example
Comparison: SSVQE vs VQD vs MC-VQE
| Aspect | SSVQE | VQD | MC-VQE |
|---|---|---|---|
| Strategy | Joint optimization | Sequential | Contracted diag |
| Parameters | K × P (many) | K × P (sequential) | Few (rotations only) |
| Error propagation | Shared | Compounds | None |
| Parallelism | High (one opt) | Low (K opts) | High (one opt + diag) |
| Strong correlation | Moderate | Poor | Excellent |
| Overlap control | Explicit penalty | Deflation | Implicit (subspace) |
Applications
| Domain | Use case |
|---|---|
| Full spectrum | Find all low-lying states at once |
| Degenerate systems | Handle near-degenerate states gracefully |
| Quantum dynamics | Construct time-evolution propagators |
| Spectroscopy | Compute transition energies |
References
- Nakanishi, K.M., Mitarai, K., Fujii, K. (2019). "Subspace-search variational quantum eigensolver for excited states." Physical Review Research 1, 033062. DOI: 10.1103/PhysRevResearch.1.033062
- Higgott, O., Wang, D., Brierley, S. (2019). "Variational Quantum Computation of Excited States." Quantum 3, 156. DOI: 10.22331/q-2019-07-01-156