← Atlas

Algorithms · Optimization · Ising encoding

Ising formulations of NP-complete and NP-hard problems

Given a hard combinatorial problem, rewrite it as an Ising spin model whose lowest-energy spin configurations are exactly that problem's solutions, so that a machine which minimizes energy can be pointed at the problem at all.

Attested & literatureUpdated

View frozen graph

  • Record typeLiterature reference
  • Reference implementationtraveling_salesman_problem
  • Reported costAt most cubic in the size of the problem, counted in spins — an encoding size, not a running time. No speedup is claimed: the abstract states no time to solution, no query or gate count and no comparison with classical solvers, and its only forward-looking statement is that the work may be useful in designing adiabatic quantum optimization algorithms.
  • Papers1

This record, used inside a worked example

This page says mappings to the Ising model — here is a concrete, runnable instance of it.

QAOA, p=1, MaxCut on a 4-cycle

4 qubits on a 4-cycle (edges 0-1, 1-2, 2-3, 3-0), one QAOA layer with gamma=pi/8, beta=3*pi/8.

q0q1q2q3Hadamard layer(4)QAOA MaxCut layer

Where it ends up

  • 010127%
  • 101027%
  • 00118%
  • 01108%
  • 12 more outcomes31%

0101 and 1010 are the two optimal cuts of a 4-cycle (alternating around the ring); at these angles measuring the register returns one of them clearly more often than any other cut.

Open that example in Studio

This record, used inside a worked example

This page says an Ising Hamiltonian whose ground states are the problem's solutions — here is a concrete, runnable instance of it.

VQE on a 2-qubit transverse-field Ising Hamiltonian

2 qubits, H = Z⊗Z + 0.5*(X⊗I + I⊗X), a stated toy Hamiltonian (not a molecule), minimised with a hardware-efficient ansatz.

q0q1RY(π/2)RY(5π/4)CXRY(0)RY(0)

Where it ends up

  • 1043%
  • 0143%
  • 007%
  • 117%

At these angles the ansatz's energy ⟨H⟩ reaches E0 = −√2, the Hamiltonian's exact ground energy; a real VQE run reaches these angles by repeating measure-the-energy then update-the-angles, not by a closed-form solution.

Open that example in Studio

Quantum vs classical

Classical baseline

Compare Optimization · Ising encoding with the strongest classical method for the same instance, input budget, and output metric.

Quantum claim

This reference exposes a quantum circuit pattern; it does not imply an application-level speedup without a matched benchmark.

How to compare

Report input loading, circuit depth, repetitions, classical preprocessing, post-processing, and wall-clock time together.

References

  • Ising formulations of many NP problems

    Andrew Lucas · 2013

    Primary source. It collects and extends mappings to the Ising model from partitioning, covering and satisfiability into formulations for many NP-complete and NP-hard problems, including all of Karp's 21, and states that the required number of spins is at most cubic in the size of the problem in every case. Consult it for the individual constructions, their penalty terms and weights, and for which problems it treats: the abstract names them only as a class.

Attested & literature
  • Peer-reviewed paper
Method
Curation only. This record documents the algorithm a published reference implementation demonstrates, not the demonstration itself: nothing in Leona runs Qmod. The primary reference's title, authors and submission year were read from its arXiv abs page, and the complexity claim taken from a clause of that paper's abstract (abstract of arXiv:1302.5843: "In each case, the required number of spins is at most cubic in the size of the problem." The scope of "each case" is set by the preceding clause, "Ising formulations for many NP-complete and NP-hard problems, including all of Karp's 21 NP-complete problems". The same abstract states no running time and no classical comparison; its closing claim is "This work may be useful in designing adiabatic quantum optimization algorithms." The demonstration this record covers states no complexity bound of its own.). No circuit was constructed, simulated or run.
Result
Pass · the record's problem statement and primary reference agree with the sources named above.
Caveat
This is a literature record: no Hamiltonian was constructed, no instance was encoded, and nothing was compiled, simulated, annealed or run here. It documents the algorithm a published reference implementation demonstrates and does not reproduce that demonstration; nothing in Leona runs Qmod, and the record carries no detail about what that implementation's files contain. What the paper supplies is an encoding, not a solver: an Ising formulation fixes what a ground state means and says nothing about how long any method — adiabatic evolution, annealing, a variational ansatz, or a classical heuristic — needs to reach it, so no speedup over classical optimization follows from anything quoted here, and the problems remain NP-hard after the mapping. The cubic figure is an upper bound stated across the problems the paper covers, with no per-problem spin count, no constant factor, and nothing about the coupling graph, the coupling precision, or the penalty weights a device would need to realize a given formulation. The abstract names Karp's 21 NP-complete problems as a class and does not name the travelling salesman problem individually, so this record does not claim on the abstract's authority that the problem named by the demonstration's directory is among those enumerated there; a reader who needs that formulation should look it up in the paper itself.
Ising formulations of many NP problems ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
Citation metadata only; source publication terms apply
ising modelnp-completecombinatorial optimizationspin encodingadiabatic

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.