VQE for HeH+ Molecule Ground State
Known limitation (October 2026): This demo's 2-qubit Hamiltonian is a simplified model, not the real HeH+ Hamiltonian, and its constant term is set to -2.8620 Ha, which is not HeH+'s FCI/STO-3G energy (PySCF gives -2.8516 Ha at R = 0.775 Å, 10.4 mHa higher). Every energy the code prints is an energy of this model, so the page shows VQE with a 3-parameter ansatz and three measurement bases, not HeH+'s energy. A corrected version is planned.
What You'll Learn:
- How VQE handles a heteronuclear molecule, and what changes in its qubit Hamiltonian
- How UCCSD-inspired ansatze differ from hardware-efficient ones
- Which Pauli terms the real parity-reduced HeH+ Hamiltonian has, and why this tutorial's simplified model uses XX and YY terms instead
- The cosmological significance of the first molecule in the universe
Level: Intermediate | Time: 20 minutes | Qubits: 2 | Framework: Qiskit
Prerequisites
- H2 Ground State — VQE fundamentals, Pauli measurements
- Bell State — CX entanglement basics
The Idea
Imagine the universe 100,000 years after the Big Bang. The cosmic plasma is cooling. Helium nuclei (Z=2) and protons (Z=1) are the most abundant species. As the temperature drops below ~4000 K, a helium atom can capture a proton to form HeH+ — the first molecular bond in the history of the universe.
HeH+ is a 2-electron system like H2, but with a twist: the nuclear charges are asymmetric (He has charge +2, H has charge +1). This breaks the homonuclear symmetry that simplified H2's Hamiltonian. The electrons are pulled more toward helium, creating a polar ionic bond instead of the symmetric covalent bond of H2.
For VQE, this asymmetry means:
- The Z₀ and Z₁ coefficients still have equal magnitude and opposite sign, just as in H2 (the equal magnitude comes from spin symmetry and the opposite signs from the parity encoding, not from the nuclear charges)
- Single-excitation terms (X₀, X₁, Z₀X₁, X₀Z₁) appear in the parity-reduced Hamiltonian; in H2 they vanish by symmetry. This tutorial's simplified model replaces them with an XX + YY exchange term
- The optimization landscape is less symmetric, requiring a more flexible ansatz
How It Works
The UCCSD-Inspired Ansatz
Instead of the hardware-efficient RY-CX-RY structure used for H2, HeH+ uses a UCCSD-inspired ansatz with a CX-RY-CX sandwich:
CODE┌──────────┐ ┌──────────┐ q_0: ┤ RY(θ₀) ├────■─────────────────────■──── ├──────────┤ ┌─┴─┐ ┌──────────┐ ┌─┴─┐ q_1: ┤ RY(θ₁) ├──┤ X ├───┤ RY(θ₂) ├─┤ X ├── └──────────┘ └───┘ └──────────┘ └───┘
The CX-RY(θ₂)-CX pattern implements a conditional rotation: qubit 1 is rotated by +θ₂ when qubit 0 is |0⟩ and by -θ₂ when qubit 0 is |1⟩ (the block equals exp(-iθ₂ Z₀Y₁/2)). Rotations of this kind are building blocks of the Unitary Coupled Cluster with Singles and Doubles (UCCSD) ansatz, which is chemically motivated rather than purely hardware-motivated.
With only 3 parameters, this compact ansatz can reach the ground state of the model Hamiltonian below.
The Hamiltonian: 6 Pauli Terms
This is a simplified model Hamiltonian, not the real one. Its coefficients do not match the parity-reduced STO-3G HeH+ Hamiltonian (for example, Z₀Z₁ is -0.094 there and +0.1358 here, and the real one has no Y₀Y₁ term), and its constant term is set so the lowest eigenvalue is -2.8620 Ha.
| Term | Coefficient | Physical meaning |
|---|---|---|
| I | -1.6225 | Constant offset (set so the lowest eigenvalue is -2.8620 Ha) |
| Z₀ | +0.5449 | Qubit 0 orbital energy |
| Z₁ | -0.5449 | Qubit 1 orbital energy |
| Z₀Z₁ | +0.1358 | Electron-electron correlation |
| X₀X₁ | +0.0872 | Exchange interaction (XX) |
| Y₀Y₁ | +0.0872 | Exchange interaction (YY) |
Key difference from H2: because helium and hydrogen differ, single-excitation terms (X₀, X₁, Z₀X₁, X₀Z₁) survive the parity reduction, while in H2 they vanish by symmetry. The real parity-reduced HeH+ Hamiltonian has no Y₀Y₁ term; this tutorial uses a simplified model that has an XX + YY exchange term instead, which is why it needs a third (YY) measurement circuit.
Step-by-Step: Measuring the Energy
Three measurement circuits (one more than H2):
- ZZ basis (computational): Gives ⟨Z₀⟩, ⟨Z₁⟩, ⟨Z₀Z₁⟩
- XX basis (H on both qubits): Gives ⟨X₀X₁⟩
- YY basis (S†H on both qubits): Gives ⟨Y₀Y₁⟩
PYTHONfrom circuit import run_circuit, optimize_vqe result = run_circuit() print(f"Energy: {result['energy']:.4f} Ha") opt = optimize_vqe(max_iterations=100, shots=2048, seed=42) print(f"Optimized: {opt['optimal_energy']:.4f} Ha")
The Math
Homonuclear vs. Heteronuclear
| Property | H2 (homonuclear) | HeH+ (heteronuclear) |
|---|---|---|
| Nuclear charges | +1, +1 | +2, +1 |
| Z symmetry | Z₀ = -Z₁ | Z₀ = -Z₁ (also) |
| Bond type | Covalent | Ionic (polar) |
| Single-excitation terms (X₀, X₁, Z₀X₁, X₀Z₁) | Vanish by symmetry | Present in the real Hamiltonian; left out of this model |
| YY term | Eliminated by parity | Absent in the real Hamiltonian; present in this model |
| Measurement circuits | 2 (ZZ, XX) | 3 (ZZ, XX, YY) |
| Parameters | 4 | 3 (UCCSD ansatz) |
Asymmetric Hamiltonian
The Z₀ and Z₁ coefficients have equal magnitude but opposite sign (+0.5449 vs -0.5449) in this simplified model. The real parity-reduced Hamiltonian has the same pattern (+0.5662 vs -0.5662 at 0.775 Å), as does H2; the opposite signs come from the parity encoding, not from the nuclear charges. The effect of the unequal nuclear charges appears instead as the extra single-excitation terms, which this model leaves out.
Expected Output
| Metric | Value |
|---|---|
| Real FCI/STO-3G energy of HeH+ (PySCF, R = 0.775 Å) | -2.8516 Ha |
Lowest eigenvalue of the model (the code's exact_ground_state) | -2.8620 Ha |
| VQE with optimized parameters (model energy) | -2.85 to -2.87 Ha |
| Bond length | 0.775 A |
| Chemical accuracy threshold | ±1.6 mHa |
Running the Circuit
PYTHONfrom circuit import run_circuit, optimize_vqe, verify_vqe # Quick evaluation result = run_circuit() print(f"Energy: {result['energy']:.4f} Ha (error: {result['error']:.4f})") # Optimization opt = optimize_vqe(max_iterations=100, shots=2048, seed=42) print(f"Optimized: {opt['optimal_energy']:.4f} Ha") # Verification v = verify_vqe() for check in v["checks"]: status = "PASS" if check["passed"] else "FAIL" print(f"[{status}] {check['name']}: {check['detail']}")
Try It Yourself
-
Compare with H2: Run both H2 and HeH+ VQE circuits. Notice HeH+ needs 3 measurement circuits (ZZ, XX, YY) while H2 needs only 2. Why?
-
Swap to hardware-efficient ansatz: Replace the UCCSD ansatz with RY-CX-RY (like H2). Does it still converge? Is it faster or slower?
-
Stretch the bond: Modify the Z coefficients to simulate a stretched bond (increase the asymmetry). How does the energy change?
-
Remove the YY term: Set Y₀Y₁ = 0 and re-optimize. How much does the ground state energy change? This quantifies the YY contribution.
Cosmological Significance
HeH+ was the first molecule to form in the universe:
- ~100,000 years after Big Bang: Temperature drops below ~4000 K
- Formation: He + H⁺ → HeH⁺ (radiative association)
- Role: Initiated molecular chemistry in the primordial gas
- 2019: First astrophysical detection in planetary nebula NGC 7027 by SOFIA telescope
The detection was published in Nature (Gusten et al., 2019) and ended a search that began in the late 1970s, when HeH+ (known in the laboratory since 1925) was first proposed to exist in astrophysical plasmas such as planetary nebulae.
What's Next
- LiH Ground State — Scale to 4 qubits with lithium hydride
- H2 Ground State — Review the simpler 2-qubit case
- QAOA MaxCut — Another variational algorithm for optimization
References
- Peruzzo, A. et al. (2014). "A variational eigenvalue solver on a photonic quantum processor." Nature Communications 5, 4213. DOI: 10.1038/ncomms5213
- Gusten, R. et al. (2019). "Astrophysical detection of the helium hydride ion HeH+." Nature 568, 357-359. DOI: 10.1038/s41586-019-1090-x
- 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