Binary optimization and Ising encoding
The conversion of a binary objective into a diagonal spin Hamiltonian while preserving objective values up to declared constants and scale.
Also called QUBO to Ising mapping
On this page
Definition and significance
A binary optimization objective can be written in variables x_i in {0,1} or spin variables z_i in {+1,-1}. The substitution x_i=(1-z_i)/2 converts between these forms. The encoding supplies a mathematical objective for annealing or variational algorithms; it does not itself solve the optimization.
Mechanism and mathematical treatment
A quadratic objective sum_i a_i x_i+sum_(i<j) b_ij x_i x_j becomes a constant plus single-spin terms and pairwise z_i z_j terms. Every constant and sign should be retained in derivations, even if a constant can later be omitted from optimization dynamics.
Fully worked reference example
Let f(x0,x1)=x0+x1-2x0x1, which is XOR. Substituting gives f=(1-z0z1)/2. Equal spins have cost zero and unequal spins cost one. Thus maximizing the one-edge MaxCut objective is exactly maximizing this binary XOR, with no approximation.
Limitations and common misconceptions
Penalty terms used for constraints can require coefficients larger than the original objective range, affecting precision and noise sensitivity. QUBO, Ising and unconstrained optimization are related representations, not evidence of quantum speedup.
Scientific relationships
The diagonal cost operator can encode a binary objective.
A constrained three-variable objective
Consider selecting exactly one of three alternatives with benefits three, two, and one. Using binary variables x0, x1, x2, minimize f=-3x0-2x1-x2 subject to x0+x1+x2=1. A penalty formulation adds lambda times (x0+x1+x2-1) squared. The original feasible optimum is x=100 with value -3; the penalty must prevent an infeasible combination of benefits from beating or tying it.
The most competitive two-selection state is 110. Its objective is -5 and its penalty is lambda, so it beats the desired optimum when lambda<2 and ties it at lambda=2. The three-selection state has value -6+4lambda, and the empty state has value lambda. Thus lambda>2 suffices for this exact instance, and the strict inequality matters if the optimum must be feasible without a tie-breaking rule. A generic objective-range bound could be larger, but the explicit finite calculation gives a tighter requirement here.
Choose lambda=3. Expanding the binary square using x_i squared=x_i gives f_pen=3-6x0-5x1-4x2+6(x0x1+x0x2+x1x2). In basis order 000 through 111, its values are 3,-1,-2,0,-3,-1,-2,6. The unique minimum remains 100 with energy -3, and the next energy is -2. Both a feasible state and an infeasible state occur at that next energy, so an energy estimate close to optimal is not alone a certificate of feasibility for each sampled bit string.
Converting every coefficient to an Ising operator
Substitute x_i=(1-z_i)/2. The linear terms contribute constant -15/2 and spin coefficients 3, 5/2, and 2. The three quadratic terms contribute total constant 9/2, pair coefficients 3/2, and a negative linear contribution of three to every spin. Together with the initial constant three, the constants cancel exactly. The resulting cost operator is H=-(1/2)Z1-Z2+(3/2)(Z0Z1+Z0Z2+Z1Z2).
Evaluating this diagonal operator on the eight computational states reproduces the listed binary energies. For example, x=100 corresponds to spins (-1,+1,+1). The field terms total -3/2 and the pair sum is -1, giving another -3/2 and total -3. The empty state has all spins positive; its fields give -3/2 and its pairs give 9/2, producing three. Keeping these checks catches sign mistakes that can otherwise silently reverse the selected alternative.
If the largest permitted coupling magnitude is one, dividing the complete Hamiltonian by 3/2 preserves the minimizing bit string. The energy gap between the best and next values becomes 2/3 rather than one. An absolute coefficient error or statistical energy uncertainty must then be interpreted on that rescaled energy scale. Rescaling is mathematically harmless for the exact optimum but can change the practical precision required to distinguish candidates.
Penalties and feasible-space dynamics
Another formulation keeps the state entirely within the one-excitation sector, starting for example from |100> and using excitation-preserving exchange interactions. Then every ideal measurement is feasible, and the penalty term is identically zero throughout that sector. The mixer must actually connect the relevant feasible alternatives; a symmetry restriction that leaves disconnected components can exclude a better solution from the chosen initial component.
This alternative exchanges penalty engineering for state preparation and mixer construction. It is not automatically cheaper on a given gate set. Noise can also move probability outside the intended sector, so observed violations remain a separate physical possibility even when the ideal ansatz preserves the constraint. A classical validity check can reject such strings, but its acceptance rate and any conditioning bias need to be reported.
For this three-variable problem, exhaustive enumeration of eight strings solves the optimization immediately and supplies an exact reference distribution of costs. Larger comparisons should use classical methods that exploit the same structure, such as integer programming, dynamic programming, or constraint-specific combinatorial algorithms when applicable. Translating a model to an Ising operator establishes representational equivalence; it does not establish computational advantage or eliminate the combinatorial search.
Sources
Verification scope
Selected source text checked ·
Primary formal source anchor; original worked examples independently derived, not reported experiments.
Verification scope
Selected source text checked ·
Formal or reference-semantic source anchor only; no SDK execution, hardware run, or empirical advantage is asserted. Original worked examples are independent mathematical constructions.