Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Quadratic unconstrained binary optimization

Quadratic unconstrained binary optimization, or QUBO, minimizes a quadratic polynomial of binary variables; constraints can be encoded through additional terms.

Also called QUBO

Edition released Coverage: Overview · Technical · Research
On this page

Meaning and mechanism

A QUBO objective has the form C(x)=c+sum_i a_i x_i+sum_i<j b_ij x_i x_j with x_i in {0,1}. Because x_i squared equals x_i, diagonal quadratic terms can be absorbed into linear terms. A matrix representation needs a convention for whether off-diagonal entries are counted once or twice. That convention must be retained when comparing software outputs.

Mapping to Ising variables

Use x_i=(1-z_i)/2 with z_i in {+1,-1}. Substitution produces C(z)=c_prime+sum_i h_i z_i+sum_i<j J_ij z_i z_j. On qubits, replace z_i by Pauli Z_i. The additive constant changes reported energy but not the minimizing configuration. It still matters when checking a numerical result against the original cost.

Fully solved mapping

For C=3x0+2x1-4x0x1, substitution yields C=1.5-0.5 z0+0 z1-1 z0z1. At z0=z1=+1, corresponding to 00, the value is 0. At (+1,-1), corresponding to 01, it is 2. At (-1,+1) it is 3, and at (-1,-1) it is 1. All four values match the original polynomial. This asymmetric example catches a sign or bit-order error that a symmetric example could hide.

Limits and classical alternatives

A QUBO representation does not establish a quantum speedup. Classical branch-and-bound, local search, simulated annealing and specialized solvers can act on the same objective. High-order terms may require auxiliary variables or another encoding. Hardware connectivity and coefficient ranges can change the cost of implementing the mathematical instance.

Misconceptions

Unconstrained refers to the representation, not necessarily to the original application. Constraints may be hidden inside penalties, and an insufficient penalty can make an infeasible assignment optimal. Rescaling every coefficient preserves the exact mathematical optimizer but can change susceptibility to finite precision or physical noise.

Deriving the binary-to-spin transformation

For binary variables xi in{0,1}, define zi=1-2xi, so xi=(1-zi)/2 and zi in{+1,-1}. A linear term ai xi becomes ai/2-ai zi/2. A product bij xi xj becomes bij/4-bij zi/4-bij zj/4+bij zi zj/4. Summing all terms produces a constant offset, local fields and pair couplings. The constant does not change the minimizing bit string, but it is needed when comparing reported energy values.

For C=3x0+2x1-4x0x1, substitution gives C=1.5-0.5z0-z0z1. Evaluating z=(+1,+1),(+1,-1),(-1,+1),(-1,-1) yields 0,2,3,1 respectively. This exactly reproduces the binary table. The absence of a z1-only term results from cancellation; it is not a general feature of QUBO mappings.

Matrix conventions and a factor-of-two trap

The expression x transpose Q x depends on whether Q is upper triangular or symmetric. With symmetric Q, off-diagonal Qij and Qji both contribute to the same product xi xj. Thus a desired coefficient bij corresponds to Qij=Qji=bij/2 when both positions are present. With an upper-triangular convention, a single entry can carry the full coefficient. Diagonal terms satisfy xi squared=xi and therefore act as linear terms on binary inputs.

For example, Q=[[3,-2],[-2,2]] gives 3x0+2x1-4x0x1. An upper-triangular matrix [[3,-4],[0,2]] gives the same polynomial. Passing one convention to software expecting the other can double or halve a coupling. A reference code example must state which convention its matrix uses before presenting a numerical energy.

Encoding precision and physical realization

Multiplying every objective coefficient by a positive constant preserves exact minimizers, but physical and numerical implementations can respond differently. Limited coefficient precision, control errors, penalty scales and thermal or sampling effects depend on absolute and relative scales. A reduction that introduces many auxiliary variables can also increase resources or require enforcing additional constraints. QUBO is a mathematical form, not a guarantee that every instance fits an available device or is easy for a quantum method.

The four binary assignments map to their spin assignments and energies. The equivalent two-node graph represents interaction coefficients. Realizing it on a device is a separate task because an abstract interaction edge need not be a native hardware coupling.

Quadratic penalties can introduce interactions absent from the original objective

An exactly-one constraint on three binary variables has penalty A(x_0+x_1+x_2-1)^2. Using x_i^2=x_i, expansion gives A[1-x_0-x_1-x_2+2x_0x_1+2x_0x_2+2x_1x_2]. Even if the original objective has only linear terms, the constraint produces all three pair interactions. For n variables, the same expansion produces n(n-1)/2 pairs. This is the interaction graph of the encoded mathematical model; hardware may require further embedding or routing to realize it.

The penalty depends only on Hamming weight k. Its values for k=0,1,2,3 are respectively A,0,A,4A. Thus a state with three selected bits is penalized more than one with two selected bits, while zero selections and two selections receive the same penalty. Calling this merely a penalty for an invalid answer hides its quantitative structure. That structure can affect finite-temperature sampling and approximate optimization even when all exact feasible minimizers are unchanged.

A different reduction may introduce auxiliary variables to replace higher-order products. Such variables need their own consistency constraints. For example, replacing x_0x_1 by an auxiliary y is mathematically harmless only if the minimizing configurations enforce y=x_0x_1. Declaring a new bit to equal a product is not itself an enforcement mechanism. The resource accounting must include the extra variable, the required penalty terms and a justified penalty scale.

These examples explain why the original application size, logical QUBO size and physically implemented size are distinct. A compact original optimization statement can become dense after a valid reduction. Conversely, exploitable structure can permit a different representation. The encyclopedia should report the actual transformation used, with its constant offset and coefficient convention, instead of assigning a universal qubit count to the application name.

Sources

  • Edward Farhi; Jeffrey Goldstone; Sam Gutmann · · Research paper · Publication status unspecified · arXiv
    Verification scope

    A Quantum Approximate Optimization Algorithm
    Edward Farhi; Jeffrey Goldstone; Sam Gutmann · Research paper · Preprint recorded · arXiv

    Metadata and abstract checked ·

    Problem- and depth-specific approximation results; no general efficient solution of NP-hard problems follows.

  • Roman Orus; Samuel Mugel; Enrique Lizaso · Review article · Preprint recorded · arXiv
    Verification scope

    Available excerpt checked ·

    Historical prospective survey. Commercial forecasts are not adopted as established results; examples are mathematical, not financial advice.