Constraint penalties in quantum optimization
A constraint penalty modifies an objective so that violating a constraint carries an additional cost, ideally making the desired optimum feasible.
On this page
Definition and significance
Many real problems require exactly one choice, capacity limits, conservation or route consistency. Encoding only the reward or cost leaves out the problem. A penalty is a mathematical device for incorporating feasibility into an unconstrained objective. Its strength must be large enough to prevent profitable violations, while preserving useful numerical resolution.
How the construction works
For an equality g(x)=0, a common penalty is A g(x)^2 with A positive. The penalty vanishes on feasible assignments. A sufficient A can be chosen from a bound on the largest objective improvement obtainable by violating the constraint, divided by the smallest positive penalty value. This is a sufficient bound, often conservative; there is no universal penalty coefficient for all problems.
Solved threshold example
Minimize f(x0,x1)=-3x0-2x1 subject to x0+x1=1. With penalty A(x0+x1-1)^2, the costs are A,-2,-3,A-5 for 00,01,10,11. The desired optimum is 10 with cost -3. To make 11 strictly worse, require A-5>-3, hence A>2. At A=2 there is a tie with an infeasible solution; at A=1 the infeasible 11 wins. Taking A=3 yields costs 3,-2,-3,-2 and a unique feasible optimum.
Numerical and hardware limitations
A very large A can compress the useful objective differences after coefficient normalization. Finite coefficient precision, analog control error or noisy expectation estimation may then obscure distinctions among feasible candidates. Alternative encodings or feasibility-preserving mixers can avoid some penalties, but introduce other implementation costs. Explain the tradeoff in terms of the actual representation.
Misconceptions and interpretation
A low penalized energy does not by itself state feasibility unless the constraint value is also reported. Candidate repair changes the algorithm and its runtime. If a report silently repairs invalid samples before scoring them, the repair procedure belongs in the comparison. The penalty model must be checked against all feasible and relevant infeasible cases for a small verification instance.
A sufficient penalty condition
Suppose a constrained binary minimization has objective f(x) and a nonnegative penalty P(x) that is zero on feasible candidates. If every infeasible candidate has P(x)>=pmin>0, and a known feasible candidate has value fF, then any coefficient A satisfying f(x)+A P(x)>fF for all infeasible x excludes those candidates from being global minimizers. A coarse sufficient condition uses a lower bound fLB on all objective values: A>(fF-fLB)/pmin. It can be conservative, but it makes the logic explicit.
The relevant bound depends on the objective range and penalty gap. An arbitrarily chosen large number is not a proof of equivalence. Equality at the threshold may leave an infeasible state tied with the best feasible state; a strict inequality or explicit tie rule matters.
Exact threshold for a two-variable example
Let f=-3x0-2x1 and require x0+x1=1. Use P=(x0+x1-1) squared. The four penalized values are A for 00, -2 for 01, -3 for 10 and A-5 for 11. The best feasible candidate is 10 at-3. Candidate11 is worse only when A-5>-3, giving A>2. Candidate00 is worse whenever A>-3, so it is not the controlling constraint for a positive penalty. At A=2,11 and 10 tie. At A=3, their values are -2 and -3 and the feasible minimizer is isolated.
This complete enumeration proves the threshold for this example. It does not justify using A=3 for a larger objective with different coefficients or constraints. Multiple penalties can interact, and a candidate violating several constraints may receive a different total penalty gap.
Why excessive penalties can be harmful
Exact mathematical equivalence is only one concern. If a physical implementation rescales all coefficients to fit a bounded control range, a very large penalty can compress the energy differences among feasible candidates. Those differences can become harder to resolve relative to calibration error or finite numerical precision. A penalty should therefore be sufficiently strong for the reduction while preserving useful resolution when possible.
A diagram can show penalized energies as lines versus A. In the solved example, the infeasible11 line crosses the feasible10 level at A=2. The crossing makes the strict threshold visible. A second annotation can explain that the diagram concerns the mathematical objective; hardware error bars would require an independently specified device model. No visitor is asked to tune A or run an experiment.
A feasible optimum need not dominate a finite-temperature distribution
The proof that a penalty preserves an exact minimizer concerns zero-temperature optimization of the mathematical objective. A sampler can still return many infeasible strings when there are many such states or when the penalty gap is not large compared with its effective energy scale. In an idealized Boltzmann distribution, a state of energy E has unnormalized weight exp(-beta E). The total probability of a class depends on both its energies and the number of states in that class.
Consider one feasible ground configuration with energy zero and M infeasible configurations all at energy Delta>0, with no other states. The feasible probability is 1/[1+M exp(-beta Delta)]. For M=100 and beta Delta=5, it is approximately 0.597445, despite every infeasible state having strictly higher energy. Requiring feasible probability at least 0.95 gives M exp(-beta Delta)<=1/19, or beta Delta>=ln(19M). With M=100 this threshold is approximately 7.549609.
This deliberately simple model illustrates entropy competing with an energy penalty. It is not a claim that a particular annealer, variational circuit or noisy gate device samples an exact Boltzmann distribution. Such a claim requires independent evidence. It also does not replace the earlier mathematical proof of the correct minimizer: exact equivalence and favorable sampling probability are different requirements.
When a study reports results conditioned on feasibility, its denominator should remain visible. A model that yields excellent feasible candidates once in a thousand attempts may have a very different end-to-end cost from a method that is feasible almost every time. Scientific discussion should keep penalty correctness, energy resolution, sample distribution and decoding cost distinct even though they interact in a practical implementation.
Sources
Verification scope
A Quantum Approximate Optimization Algorithm
Edward Farhi; Jeffrey Goldstone; Sam Gutmann · Research paper · Preprint recorded · arXivMetadata and abstract checked ·
Problem- and depth-specific approximation results; no general efficient solution of NP-hard problems follows.