|q⟩ Bad Qubits

advanced · Programming · Quantum Annealing & Adiabatic Computing

Problem and Driver Hamiltonians

Every adiabatic or annealing algorithm is built from two Hamiltonians: a driver that is easy to start from, and a problem Hamiltonian whose ground state is the answer. This lesson defines both and shows how to prepare the driver's ground state in the simulator.

The driver (transverse-field) Hamiltonian

The standard driver on nn qubits applies a transverse field to every qubit:

HB=i=0n1Xi.H_B = -\sum_{i=0}^{n-1} X_i .

Because HBH_B is a sum of commuting single-qubit terms, its ground state factorizes. Each Xi-X_i is minimized by the +1+1 eigenstate of XX, which is

+=0+12=H0.|{+}\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}} = H|0\rangle .

So the ground state of HBH_B is the uniform superposition

+n=12nx=02n1x,|{+}\rangle^{\otimes n} = \frac{1}{\sqrt{2^n}} \sum_{x=0}^{2^n - 1} |x\rangle ,

prepared by one Hadamard per qubit. Its energy is E0=nE_0 = -n, since each term contributes 1-1.

The problem Hamiltonian

The problem Hamiltonian HPH_P is diagonal in the computational basis: every basis state x|x\rangle is already an eigenstate, with eigenvalue equal to a classical cost function C(x)C(x):

HPx=C(x)x.H_P\,|x\rangle = C(x)\,|x\rangle .

The ground state of HPH_P is therefore the bit string xx^\star that minimizes CC. A typical construction uses ZZ operators, for example a single-qubit field HP=Z0H_P = -Z_0 whose ground state is 0|0\rangle (eigenvalue 1-1), or two-body couplings ZiZjZ_i Z_j for interacting spins. Because HPH_P is diagonal, preparing its ground state is exactly the hard combinatorial problem you want to solve — which is why you start from the easy driver instead and interpolate.

Try it

Prepare the ground state of the 2-qubit driver HB=(X0+X1)H_B = -(X_0 + X_1). The grader checks the full statevector, so each of the four amplitudes should equal 1/21/2.

Run your code to see the quantum state.

After running, the statevector panel should show 00,01,10,11|00\rangle, |01\rangle, |10\rangle, |11\rangle each with amplitude 0.50.5 — the uniform superposition ++|{+}{+}\rangle.

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