|q⟩ Bad Qubits

advanced · Programming · Quantum Chemistry on Quantum Computers

Hartree–Fock Initial States

Every variational algorithm needs a starting state, and for molecules the natural choice is the Hartree–Fock (HF) reference. It is the best single-configuration description of the molecule and costs only a layer of XX gates to prepare — making it the universal initialization for VQE.

What Hartree–Fock is

Hartree–Fock approximates the many-electron wavefunction by a single Slater determinant: each electron occupies one spin-orbital, and the orbitals are optimized (self-consistently) to minimize the energy under the constraint that the wavefunction stays a single determinant. The HF procedure yields a set of ordered spin-orbital energies; the determinant fills the lowest NN of them with the NN electrons. This is the "Aufbau" filling familiar from introductory chemistry, applied to the self-consistent molecular orbitals.

The HF state as an occupation string

A single Slater determinant is exactly one occupation-number state. For H2\text{H}_2 in the STO-3G basis there are 4 spin-orbitals and 2 electrons, so the HF determinant fills orbitals 0 and 1:

ΨHF=a1a0vac=1100.|\Psi_{\text{HF}}\rangle = a_1^\dagger a_0^\dagger |\text{vac}\rangle = |1\,1\,0\,0\rangle.

Under Jordan–Wigner this maps to the qubit state with qubits 0 and 1 in 1|1\rangle and qubits 2, 3 in 0|0\rangle. Preparing it requires only an XX gate on each occupied orbital — no entanglement, no parameters.

Why HF is the right starting point

Hartree–Fock already recovers the bulk of the molecular energy (typically over 99%). The remaining piece is the correlation energy, which the off-diagonal terms of the Hamiltonian generate by mixing in other configurations such as the doubly-excited 0011|0\,0\,1\,1\rangle. A good ansatz therefore starts at ΨHF|\Psi_{\text{HF}}\rangle and applies parametrized rotations that add a small amount of those excited configurations — searching the neighbourhood of HF rather than all of Hilbert space.

In the two-qubit encoding

After tapering H2\text{H}_2 to two qubits (previous lesson), the HF determinant becomes the basis state 01|01\rangle. The single-parameter ansatz you will use for VQE rotates this toward cosθ201sinθ210\cos\tfrac{\theta}{2}|01\rangle - \sin\tfrac{\theta}{2}|10\rangle, sweeping between the HF configuration and its double excitation — exactly the two configurations the off-diagonal X0X1X_0X_1/Y0Y1Y_0Y_1 terms couple.

Try it

Prepare the 4-qubit Hartree–Fock reference state for H2\text{H}_2: 2 electrons in the 2 lowest spin-orbitals, i.e. qubits 0 and 1 in 1|1\rangle and qubits 2, 3 in 0|0\rangle. The grader checks the full statevector.

Run your code to see the quantum state.

The statevector should have a single non-zero amplitude at the occupation string with qubits 0 and 1 high — the Hartree–Fock determinant for molecular hydrogen.

Sign in on the full site to ask questions and join the discussion.