VQE for LiH Excited States — 4-Qubit VQD
Known limitation (October 2026): This demo's Hamiltonian is a simplified 4-qubit toy model, not an electronic-structure Hamiltonian for LiH: its ground state (-9.284 Ha) is about 1.4 Ha below LiH's real STO-3G energy (about -7.88 Ha), and its VQD does not conserve electron number, so the "excited state" it finds (exact value -8.487 Ha) holds one electron instead of two. The page still shows how VQD runs on 4 qubits with a multi-circuit Pauli measurement. A corrected version is planned.
What You'll Learn:
- How VQD scales from 2-qubit H2 to a 4-qubit problem
- How ionic-covalent character mixing affects LiH's excited states, and why this demo's simplified model cannot show it
- How to build multi-qubit measurement circuits for a 15-term Hamiltonian
- Why LiH is a standard benchmark for quantum chemistry on NISQ devices
Level: Advanced | Time: 35 minutes | Qubits: 4 | Framework: Qiskit
Prerequisites
- H2 Excited States — VQD algorithm, overlap penalties, β selection
- H2 Ground State — VQE fundamentals, Pauli measurement
- LiH Ground State — 4-qubit ansatz, multi-qubit measurement
The Idea
Hydrogen (H2) is quantum chemistry's "Hello World" — 2 electrons, 1 bond, 2 qubits. Lithium hydride (LiH) is the next step: 4 electrons, a polar bond, and a 4-qubit active space. The electronic structure is richer because LiH has both ionic character (Li⁺H⁻, electrons transferred to hydrogen) and covalent character (shared electrons).
At equilibrium (~1.6 A), the ground state is predominantly ionic. But as you stretch the bond, the ground state smoothly transitions to covalent character, while the excited state does the opposite. At ~3 A, the two potential energy curves nearly touch in an avoided crossing. Near such a crossing the wavefunction needs more than one electronic configuration, which single-reference classical methods handle poorly (a molecule this small is still solved exactly on a classical computer). The simplified model in this demo contains none of these effects; see the note at the top.
How It Works
The LiH Hamiltonian
This demo's simplified 4-qubit model (labelled as 2 electrons in 4 spin-orbitals) has a 15-term Hamiltonian (14 Pauli terms plus the identity):
| Term type | Count | Physical meaning |
|---|---|---|
| I | 1 | Core + nuclear energy constant |
| Z₀, Z₁, Z₂, Z₃ | 4 | Individual spin-orbital occupation energies |
| ZᵢZⱼ | 6 | Electron-electron correlation (all pairs) |
| X₀X₁, X₂X₃ | 2 | Toy spin-flip hopping within 1σ and within 2σ (see below) |
| Y₀Y₁, Y₂Y₃ | 2 | Toy spin-flip hopping, together with the XX terms |
In this toy model the XX and YY terms hop an electron between the spin-up and spin-down orbitals of the same level, which flips its spin. A real molecular Hamiltonian conserves spin and has no such terms; the terms that move electrons between orbitals in a real Hamiltonian include four-qubit ones (XXYY and similar) after the Jordan-Wigner mapping.
The 4-Qubit Ansatz
A UCCSD-inspired ansatz with CNOT-ladder entanglement:
CODELayer 1: CNOT ladder RZ rotations Reverse CNOT ┌────────┐ ┌────────┐ q_0: ┤ RY(θ₀) ├──■──────────────────────┤ RZ(θ₄) ├──────────────────── ├────────┤┌─┴─┐ ├────────┤ q_1: ┤ RY(θ₁) ├┤ X ├──■─────────────────┤ RZ(θ₅) ├──────────■──────── ├────────┤└───┘┌─┴─┐ ├────────┤ ┌─┴─┐ q_2: ┤ RY(θ₂) ├─────┤ X ├──■────────────┤ RZ(θ₆) ├──■────┤ X ├─────── ├────────┤ └───┘┌─┴─┐ ├────────┤┌─┴─┐ └───┘ q_3: ┤ RY(θ₃) ├──────────┤ X ├──────────┤ RZ(θ₇) ├┤ X ├────────────── └────────┘ └───┘ └────────┘└───┘
The CNOT ladder (0→1→2→3) creates a chain of entanglement. The reverse partial CNOT (2→3, 1→2) adds longer-range correlations, matching the structure of molecular orbital interactions.
VQD: Sequential State Finding
Same as H2 VQD, but with 16 parameters and more measurement circuits:
- Ground state: Standard VQE with 15-term energy evaluation
- Excited state: Minimize E + β|⟨ψ₁|ψ₀⟩|² with β = 3.0
Each energy evaluation requires 5 measurement circuits: 1 ZZ (computational), 2 XX (pairs 0-1 and 2-3), 2 YY (pairs 0-1 and 2-3).
The Math
Active Space
LiH has 4 electrons total, but the 1s² core of lithium is frozen. The active space contains 2 electrons in 4 spin-orbitals:
CODESpin-orbital mapping: q₀ → 1σ α (bonding, spin-up) q₁ → 1σ β (bonding, spin-down) q₂ → 2σ α (antibonding, spin-up) q₃ → 2σ β (antibonding, spin-down)
Ionic vs Covalent Character
In this simplified model the ground state is exactly one configuration:
|ψ_ground⟩ = |1100⟩ (written q₀q₁q₂q₃; Qiskit prints it as 0011)
Both electrons sit in 1σ. The model has no terms that move an electron between 1σ and 2σ (it conserves the electron count of each level separately), so no configuration with an electron in 2σ ever mixes into the ground state, and the ionic and covalent mixing of real LiH cannot appear. A real LiH Hamiltonian contains those orbital-mixing terms.
Avoided Crossing
As the bond stretches, the ionic and covalent energies approach each other. Quantum mechanics forbids the curves from actually crossing (for states of the same symmetry), creating an avoided crossing. The ground and excited states exchange character smoothly through this region. This demo's model has coefficients for one geometry only and no ionic-covalent coupling, so it cannot show an avoided crossing.
Expected Output
For the model Hamiltonian (its coefficients are labelled R = 1.6 A):
| Metric | Value |
|---|---|
| Ground state energy (exact, model) | -9.284 Ha (real LiH, FCI/STO-3G: about -7.88 Ha) |
| Lowest excited state (exact, model) | -8.487 Ha, a 1-electron state |
| Lowest excited state with 2 electrons (exact, model) | -7.977 Ha |
| Energy gap (model) | 0.797 Ha to the 1-electron state; 1.307 Ha within the 2-electron sector |
| VQD ground state (optimized) | -9.26 to -8.85 Ha in 6 runs |
| VQD excited state (optimized) | -8.74 to -8.39 Ha in 6 runs |
| Final overlap |⟨ψ₀|ψ₁⟩|² | < 0.1 (at most 0.017 in 6 runs) |
The VQD here does not conserve electron number. Without a number penalty, its excited-state search heads for the 1-electron state at -8.487 Ha: the excited states it returned held 1.07 to 1.38 electrons on average in 6 runs. Runs are not exactly repeatable, because seed fixes only the starting angles and the simulator's shots are not seeded.
Running the Circuit
PYTHONfrom circuit import run_circuit, optimize_vqd, verify_lih_vqd # Quick single evaluation result = run_circuit() print(f"Energy: {result['energy']:.4f} Ha") # Full VQD: ground + excited state opt = optimize_vqd(n_states=2, max_iterations=100, shots=2048, seed=42) print(f"Ground: {opt['states'][0]['energy']:.4f} Ha") print(f"Excited: {opt['states'][1]['energy']:.4f} Ha") print(f"Gap: {opt['gaps'][0]:.4f} Ha") # Verification suite v = verify_lih_vqd() for check in v["checks"]: status = "PASS" if check["passed"] else "FAIL" print(f"[{status}] {check['name']}: {check['detail']}")
Try It Yourself
-
Stretch the bond: This toy model has no bond-length dependence, so it cannot show the gap closing. Build a real LiH Hamiltonian at R = 1.6, 2.5 and 3.5 A instead (for example from PySCF integrals with a Jordan-Wigner mapping) and watch the gap between the two lowest singlet states shrink.
measure_energyonly measures the Z, ZZ, XX and YY terms used here, so it has to be extended for a real Hamiltonian. -
Potential energy surface: With a real Hamiltonian, compute the two lowest singlet energies at 5 bond lengths from 1.0 A to 4.0 A and plot both curves. In STO-3G the gap between them is smallest near 3 A (about 0.074 Ha in an exact FCI calculation), the avoided-crossing region.
-
Add a third state: Run
optimize_vqd(n_states=3)to find the second excited state. Is the second gap larger or smaller than the first? -
Compare with H2: The H2 VQD needs 2 qubits and 3 measurement circuits (ZZ, XX, YY) per energy evaluation. LiH needs 4 qubits and 5 circuits. How does the circuit count scale with the number of Pauli terms?
What's Next
- H2 Excited States — Simpler 2-qubit version of VQD
- SSVQE — Simultaneous multi-state optimization (alternative to sequential VQD)
- Multistate VQE — Multi-reference approach for strongly correlated systems
Applications
| Domain | Use case |
|---|---|
| Spectroscopy | Predicting LiH rovibrational spectra |
| Materials science | Lithium-containing battery materials |
| Hardware benchmarking | Standard test for 4+ qubit NISQ devices |
| Algorithm benchmarking | Small, exactly solvable test case for excited-state algorithms |
References
- Kandala, A. et al. (2017). "Hardware-efficient variational quantum eigensolver for small molecules." Nature 549, 242-246. DOI: 10.1038/nature23879
- Hempel, C. et al. (2018). "Quantum Chemistry Calculations on a Trapped-Ion Quantum Simulator." Physical Review X 8, 031022. DOI: 10.1103/PhysRevX.8.031022
- Higgott, O. et al. (2019). "Variational Quantum Computation of Excited States." Quantum 3, 156. DOI: 10.22331/q-2019-07-01-156
- O'Malley, P.J.J. et al. (2016). "Scalable quantum simulation of molecular energies." Physical Review X 6, 031007. DOI: 10.1103/PhysRevX.6.031007