-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Source: SpinGlass
Target: KLocalHamiltonian
Motivation: Embeds the classical Ising model into the quantum local Hamiltonian framework as a diagonal (purely classical) special case. This establishes SpinGlass as a strict subproblem of KLocalHamiltonian and bridges the repository's classical optimization models to the quantum complexity hierarchy.
Reference:
- Barahona, F. (1982). "On the computational complexity of Ising spin glass models." J. Phys. A, 15(10), 3241. (NP-hardness of Ising ground-state problem)
- Lucas, A. (2014). "Ising formulations of many NP problems." Frontiers in Physics, 2, 5. (Ising ↔ combinatorial optimization dictionary)
Reduction Algorithm
Notation:
- Source (SpinGlass):
$n$ spin variables$s_0, \dots, s_{n-1} \in {-1, +1}$ ; interaction graph$G = (V, E)$ with$|V| = n$ ,$|E| = m$ ; couplings$J_{ij}$ per edge$(i,j) \in E$ ; on-site fields$h_i$ per vertex$i \in V$ . All coefficients are integers or rationals with denominators bounded by$\text{poly}(n)$ . Binary representation:$x_i \in {0, 1}$ ,$s_i = 2x_i - 1$ (so$x_i = 0 \to s_i = -1$ ,$x_i = 1 \to s_i = +1$ ). Hamiltonian:$H_{\text{Ising}}(s) = \sum_{(i,j) \in E} J_{ij} , s_i , s_j + \sum_{i \in V} h_i , s_i$ . - Target (KLocalHamiltonian):
$n$ qubits, Hamiltonian terms$H_1, \dots, H_p$ , thresholds$a, b$ .
Convention: qubit computational basis config_to_spins: s = 2x - 1).
Variable mapping:
Each spin variable
Constraint/objective transformation:
- For each edge
$(i,j) \in E$ with coupling$J_{ij}$ , construct a 2-local diagonal term:
where
This reproduces
- For each vertex
$i \in V$ with field$h_i \neq 0$ , construct a 1-local diagonal term:
The local
The sign flip (
- Set thresholds: the decision version of Ising ground energy asks "is OPT
$\leq E$ ?" for a given threshold$E$ . Set$a = E$ and$b = E + \Delta$ where$\Delta$ is determined by the coefficient encoding:-
Integer couplings/fields: all energy levels are integers, so
$\Delta = 1$ suffices. -
Rational couplings/fields with denominators bounded by
$\text{poly}(n)$ (the standard assumption in combinatorial Ising / Barahona / Lucas settings): let$D$ be the least common denominator of all$J_{ij}$ and$h_i$ . Then$D \leq \text{poly}(n)$ , so choosing$\Delta = 1/D \geq 1/\text{poly}(n)$ satisfies the KLocalHamiltonian promise gap requirement. Equivalently, multiply all coefficients by$D$ to integerize, then use$\Delta = 1$ on the scaled instance.
-
Integer couplings/fields: all energy levels are integers, so
Total Hamiltonian:
Correctness
where
The ground-state energy of
Size Overhead
| Target metric (code name) | Polynomial (using symbols above) |
|---|---|
num_qubits |
num_spins) |
num_terms |
|
| locality |
|
matrix_dim per term |
|
Each term is encoded as: qubit indices (1 or 2 integers) plus a constant-size local matrix (
Validation Method
- Compute Ising energy
$H_{\text{Ising}}(s)$ for all$2^n$ configurations viaSpinGlass::compute_energy, and verify it matches the diagonal of the constructed$H$ - Cross-check ground-state energy: the minimum over SpinGlass brute-force solutions equals the minimum eigenvalue of
$H$ - Test with known instances: antiferromagnetic chain (unique/degenerate ground states), frustrated triangle (6-fold degeneracy), random instances up to
$n = 16$ - Verify all terms are diagonal: each
$H_j$ should satisfy$H_j = \text{diag}(\cdots)$ with no off-diagonal entries
Example
Source: SpinGlass on antiferromagnetic triangle
n = 3 spins, graph = K_3 (complete graph on 3 vertices)
Edges: {(0,1), (1,2), (0,2)}, m = 3
Couplings: J_01 = 1, J_12 = 1, J_02 = 1 (all antiferromagnetic)
Fields: h_0 = 0, h_1 = 0, h_2 = 0 (no external field)
H_Ising(s) = s_0*s_1 + s_1*s_2 + s_0*s_2
This is the classic frustrated antiferromagnet: no assignment can simultaneously satisfy all three antiferromagnetic couplings.
Target: KLocalHamiltonian instance
Three 2-local terms (no 1-local terms since all fields are zero):
num_qubits = 3, num_terms = 3, k = 2
threshold_a = -1, threshold_b = 0
Verification (all 8 configurations)
| 000 | |||||
| 001 | |||||
| 010 | |||||
| 011 | |||||
| 100 | |||||
| 101 | |||||
| 110 | |||||
| 111 |
Ground-state energy =
Since ground energy