Ising and QUBO Formulations
To run a problem on an annealer you must write it as the ground state of a diagonal Hamiltonian. Two equivalent classical encodings dominate: the Ising model (spins ) and QUBO (binary variables ). This lesson defines both, shows they are interchangeable, and computes a tiny ground-state energy by brute force.
The Ising energy
The Ising model assigns each variable a spin and an energy
with couplings and local fields . Quantizing means replacing each by the Pauli (eigenvalues ), giving the diagonal problem Hamiltonian
A negative coupling is ferromagnetic — it rewards aligned spins; a positive coupling is antiferromagnetic and rewards opposite spins.
QUBO
A Quadratic Unconstrained Binary Optimization problem uses binary variables and minimizes
The two forms are related by the linear change of variable
so and . Substituting maps any QUBO to an Ising model and back (up to an additive constant), which is why hardware vendors accept either form. Lucas's survey shows how graph coloring, max-cut, partitioning, and many other NP problems become Ising/QUBO instances.
A two-spin example
Take a single ferromagnetic coupling and no fields:
The four configurations give energies
The ground-state energy is , doubly degenerate: both spins up () or both down (). Ferromagnetic coupling, as expected, prefers alignment.
Try it
Brute-force the two-spin ferromagnet over all four spin configurations and return the minimum energy. The grader checks that you return .
The loop returns the ground-state energy , realized by the aligned states and .
Sign in on the full site to ask questions and join the discussion.