Quantum Modeler Methodology
The implemented formulations, bounded QAOA search, exact classical checks, and resource projections.
Execution and formulation
Max-Cut, Knapsack and Custom QUBO use ideal, noiseless classical statevector simulation with at most 8 qubits. Each executes p=1 QAOA and performs a separate exhaustive classical check. No quantum hardware or quantum advantage is demonstrated. Worked examples make the algebra independently checkable.
Binary variables and Ising convention
xᵢ ∈ {0,1}; Zᵢ has eigenvalue +1 on |0⟩ and −1 on |1⟩. Thus xᵢ = (I−Zᵢ)/2. This maps classical assignments to computational-basis states.
QUBO representation
E(x) = c + Σᵢ aᵢxᵢ + Σᵢ<ⱼ bᵢⱼxᵢxⱼ is minimized. The constant changes reported energies but not minimizing assignments. Since xᵢ²=xᵢ, diagonal matrix coefficients belong in the linear array. Pair coefficients occur once; the input is a sparse coefficient list, not a full matrix.
Custom QUBO accepts one coefficient per variable, up to 28 distinct pairs, and finite coefficients/constant of magnitude at most 1,000,000. A reversed pair is normalized to i<j; supplying both (i,j) and (j,i), or any duplicate, is rejected, not summed. Diagonal pair entries are rejected. To convert a matrix xᵀQx, use aᵢ=Qᵢᵢ and bᵢⱼ=Qᵢⱼ+Qⱼᵢ. A symmetric matrix therefore contributes twice each off-diagonal entry.
AutomationGlance validates the QUBO that you provide. It cannot infer unstated business constraints. Constraints must be encoded in the QUBO, typically using appropriate penalty terms. Custom QUBO is unconstrained binary minimization; it does not attach a separate business-feasibility meaning to an assignment.
Auditable QUBO → Ising mapping
xᵢxⱼ = (I−Zᵢ−Zⱼ+ZᵢZⱼ)/4. Substitution gives H = C·I + Σᵢ hᵢZᵢ + Σᵢ<ⱼ JᵢⱼZᵢZⱼ, with
- C = c + ½Σᵢaᵢ + ¼Σᵢ<ⱼbᵢⱼ
- hᵢ = −aᵢ/2 − ¼Σⱼ≠ᵢ b₍ᵢⱼ₎ (each incident pair once)
- Jᵢⱼ = bᵢⱼ/4.
Each basis eigenvalue of H equals the original E(x). Compilation divides nonconstant coefficients by s=max(1,max|hᵢ|,max|Jᵢⱼ|). This preserves ground states. Reported energies use the original, unscaled QUBO. The constant's global phase is omitted from the circuit.
Max-Cut
The graph is an unweighted simple undirected graph with 2–8 executed vertices. Edges have distinct in-range endpoints; duplicate undirected edges are rejected. Empty graphs are permitted. Bit xᵢ selects the partition of vertex i; an edge is cut if its endpoint bits differ.
Maximize C(x)=Σ₍ᵢⱼ₎∈E (xᵢ+xⱼ−2xᵢxⱼ). The cost Hamiltonian is H꜀=Σ₍ᵢⱼ₎∈E (I−ZᵢZⱼ)/2. The product uses this maximization convention directly, rather than silently minimizing C. One cost interaction exp(−iγ(I−ZᵢZⱼ)/2), ignoring global phase, compiles to CX(i,j), RZ(j,−γ), CX(i,j). Measured bitstrings are candidate graph partitions.
Knapsack
Select items xᵢ to maximize Σvᵢxᵢ with Σwᵢxᵢ≤C. Weights are integers 1–127, values 1–1000, capacity 1–127, with 1–7 items and total encoded width ≤8. Duplicate items are distinct optional selections. Binary slack sₖ has weights 2ᵏ for k=0…floor(log₂C), so q=n+floor(log₂C)+1.
The minimized encoding is E(x,s)=−Σvᵢxᵢ+A(Σwᵢxᵢ+Σ2ᵏsₖ−C)², with fixed A=Σvᵢ+1. This is expanded using x²=x. With combined weights d=(w₀,…,1,2,4,…), the constant is AC², linear coefficients are A(dᵢ²−2Cdᵢ) minus the item value (zero for slack), and pair coefficients are 2Adᵢdⱼ.
For integer inputs, any nonzero equality residual costs at least A, exceeding all possible item rewards. Every feasible item selection can represent its remaining capacity as slack. Thus the exact encoded ground state maximizes feasible value. A feasible selection (weight≤C) can still have the wrong slack and a positive penalty; feasibleProbability and constraintSatisfiedProbability measure different events. The reported conditional expected feasible value averages only over feasible mass.
Penalty formulations depend on suitable coefficients. Here the fixed A has an integer-input guarantee for exact ground states, but a shallow circuit can sample infeasible assignments and large penalties can obscure value differences. No-feasible-sample results keep the measured best and approximation ratio null; the classical answer is never substituted. A zero exact value also has a null ratio.
QAOA: one layer and bounded grid search
Start from |0…0⟩ and apply H to every qubit to prepare |+⟩ⁿ. The ansatz is exp(−iβΣXᵢ) exp(−iγH꜀)|+⟩ⁿ. Apply cost first, then RX(2β) on each qubit, then terminal computational-basis sampling. Parameters are numeric radians; only p=1 (one γ and one β) is supported.
For QUBO/Knapsack, the normalized cost uses RZ(2γhᵢ/s) and CX–RZ(2γJᵢⱼ/s)–CX. Max-Cut uses the sign described above without this QUBO normalization.
| Model | Grid | Selection |
|---|---|---|
| Max-Cut | γ=kπ/8, β=lπ/8; k,l=0…7 | Maximize exact expected cut; improvements >10⁻¹² |
| Knapsack / QUBO | γ=kπ/4, β=lπ/8; k,l=0…7 | Minimize original expected energy; improvements >10⁻¹⁰ |
At most 64 combinations are evaluated, beta varying first; ties retain the first pair. QuantumModel__MaxEvaluations clamps the budget to 1–64 and selects a prefix of that order. Search uses full state probabilities, not noisy shot estimates. This is a fixed grid, not an adaptive variational optimizer. Only the final selected circuit is sampled (1–100,000 shots); modeler seed defaults to 42. An explicit seed and the same backend/runtime reproduce counts; seed does not change the selected angles.
Classical validation
Independent exhaustive enumeration checks at most 256 assignments. Max-Cut enumerates all partitions; Knapsack enumerates item selections with direct capacity checks; Custom QUBO enumerates its supplied energy. These establish the optimum for the supplied bounded model, not an unstated business problem or a projected large instance.
Custom QUBO reports the raw minimum and ground states within tolerance 10⁻⁹+10⁻¹⁴(|c|+Σ|a|+Σ|b|). Its additive optimality gap is best sampled energy minus exact minimum; ratios are inappropriate for arbitrary signed energies. Max-Cut reports best sampled cut/exact cut, with a null ratio when the exact cut is zero. A sampled optimum is not guaranteed.
Executed, projected, logical and physical scale
EXECUTED means an allocated statevector of width ≤8. PROJECTED means symbolic resource arithmetic on requested target sizes; no target graph, solution or statevector was constructed. A projection being small enough to execute does not mean it was executed.
- Max-Cut logical variables: N vertices; p=1 gate estimate 2N+3M when M target edges is supplied; otherwise interaction/gate counts are unknown.
- Knapsack: q=n+ceil(log₂(C+1)); dense pair bound q(q−1)/2; gate bound 3q+3q(q−1)/2.
- Custom QUBO: q target variables, m target pairs; gate upper bound 3q+3m.
These counts include H preparation and cost/mixer gates, exclude measurement and hardware compilation, and do not establish physical circuit depth. QAOA layer count p is not hardware depth. Target topology, native gates, routing and parallel scheduling would be required for a physical depth estimate. No physical-qubit or error-correction overhead estimate is implemented.
An ideal dense complex-double statevector alone needs 16×2^q bytes: 8 qubits need 4 KiB; 30 need 16 GiB. Simulation also allocates work arrays and results. Symbolic 2^q strings for larger targets describe this exponential growth; they do not claim available memory or executable scale.
Bit ordering and artifacts
Logical assignments display x0…xN−1 left to right; q0 is the most significant bit of statevector indexing. Knapsack puts item bits first, then slack bits of weights 1,2,4,… . For three modeler variables, 100 selects x0 only. Exports measure xi → q[i] → c[i]; Qiskit commonly displays a single classical register as c[N−1]…c[0], yielding 001 for that same assignment. Reverse only after checking the actual register/measurement mapping; arbitrary subsets need explicit conversion. No external hardware or SDK execution is claimed.
All modelers export DSL and OpenQASM 2.0. Custom QUBO additionally exports automationglance.qubo.v1 JSON, with objective/order/provenance metadata; extract coefficient fields when making a strict API request. Edits invalidate old exports until rebuilt. See export compatibility and sources and implementation references.