Table of Contents
Fetching ...

Constraint-Aware Quantum Optimization via Hamming Weight Operators

Yajie Hao, Qiming Ding, Xiao Yuan, Xiaoting Wang

TL;DR

This work tackles constrained binary optimization under a hard linear constraint $\sum_i \omega_i x_i = b$ by replacing penalty-based constraint handling with a constraint-preserving mixer built from Hamming Weight Operators, thereby confining quantum evolution to the feasible subspace. It introduces Adaptive Hamming Weight Operator QAOA (AHWO-QAOA), which adaptively selects a sparse, problem-tailored set of constraint-preserving mixers from a pool to produce shallow, hardware-efficient circuits. Numerical experiments on portfolio optimization and two-jet clustering up to $n=20$ qubits show that AHWO-QAOA guarantees feasibility, achieves higher Approximation Ratios, and uses roughly half as many gates as penalty-based QAOA. The framework is modular and compatible with other QAOA variants, offering a scalable path toward practical constrained quantum optimization on near-term devices and potential applicability to broader variational algorithms such as VQE.

Abstract

Constrained combinatorial optimization with strict linear constraints underpins applications in drug discovery, power grids, logistics, and finance, yet remains computationally demanding for classical algorithms, especially at large scales. The Quantum Approximate Optimization Algorithm (QAOA) offers a promising quantum framework, but conventional penalty-based formulations distort optimization landscapes and demand deep circuits, undermining scalability on near-term hardware. In this work, we introduce Hamming Weight Operators, a new class of constraint-aware operators that confine quantum evolution strictly within the feasible subspace. Building on this idea, we develop Adaptive Hamming Weight Operator QAOA, which dynamically selects the most effective operators to construct shallow, problem-tailored circuits. We validate our approach on benchmark tasks from both finance and high-energy physics, specifically portfolio optimization and two-jet clustering with energy balance. Across these problems, our method inherently satisfies all constraints by construction, converges faster, and achieves higher Approximation Ratios than penalty-based QAOA, while requiring roughly half as many gates. By embedding constraint-aware operators into an adaptive variational framework, our approach establishes a scalable and hardware-efficient pathway for solving practical constrained optimization problems on near-term quantum devices.

Constraint-Aware Quantum Optimization via Hamming Weight Operators

TL;DR

This work tackles constrained binary optimization under a hard linear constraint by replacing penalty-based constraint handling with a constraint-preserving mixer built from Hamming Weight Operators, thereby confining quantum evolution to the feasible subspace. It introduces Adaptive Hamming Weight Operator QAOA (AHWO-QAOA), which adaptively selects a sparse, problem-tailored set of constraint-preserving mixers from a pool to produce shallow, hardware-efficient circuits. Numerical experiments on portfolio optimization and two-jet clustering up to qubits show that AHWO-QAOA guarantees feasibility, achieves higher Approximation Ratios, and uses roughly half as many gates as penalty-based QAOA. The framework is modular and compatible with other QAOA variants, offering a scalable path toward practical constrained quantum optimization on near-term devices and potential applicability to broader variational algorithms such as VQE.

Abstract

Constrained combinatorial optimization with strict linear constraints underpins applications in drug discovery, power grids, logistics, and finance, yet remains computationally demanding for classical algorithms, especially at large scales. The Quantum Approximate Optimization Algorithm (QAOA) offers a promising quantum framework, but conventional penalty-based formulations distort optimization landscapes and demand deep circuits, undermining scalability on near-term hardware. In this work, we introduce Hamming Weight Operators, a new class of constraint-aware operators that confine quantum evolution strictly within the feasible subspace. Building on this idea, we develop Adaptive Hamming Weight Operator QAOA, which dynamically selects the most effective operators to construct shallow, problem-tailored circuits. We validate our approach on benchmark tasks from both finance and high-energy physics, specifically portfolio optimization and two-jet clustering with energy balance. Across these problems, our method inherently satisfies all constraints by construction, converges faster, and achieves higher Approximation Ratios than penalty-based QAOA, while requiring roughly half as many gates. By embedding constraint-aware operators into an adaptive variational framework, our approach establishes a scalable and hardware-efficient pathway for solving practical constrained optimization problems on near-term quantum devices.
Paper Structure (11 sections, 19 equations, 6 figures)

This paper contains 11 sections, 19 equations, 6 figures.

Figures (6)

  • Figure 1: Comparison between penalty-based and Hamming Weight Operator approaches for enforcing constraints in QAOA. (a) Penalty-based QAOA distorts the energy landscape with steep barriers. (b) The Hamming Weight Operator directly restricts evolution to the feasible subspace, preserving stability and efficiency.
  • Figure 2: Workflow of the AHWO-QAOA. The algorithm begins by initializing the variational state with the current cost Hamiltonian $H_c$ and mixing Hamiltonian $H_m$. An operator pool $\mathcal{P}=\{M_1,M_2,\ldots,M_T\}$ is constructed from the linear constraints. At each iteration, the energy contribution of candidate operators is evaluated, and the operator with the largest contribution (lowest energy) is selected. The mixing Hamiltonian is then updated by including the chosen operator, and the variational ansatz is grown accordingly. This adaptive procedure continues until convergence is reached, thereby reducing circuit depth while preserving constraint satisfaction.
  • Figure 3: Performance comparison between AHWO-QAOA and penalty-based QAOA with penalty factors $\lambda=10$ and $\lambda=100$. Each panel corresponds to a system size of (a) 6 qubits, (b) 8 qubits, (c) 10 qubits, (d) 12 qubits, (e) 16 qubits, and (f) 20 qubits. The upper plots show the Constraint Ratio, i.e., the percentage of test cases that satisfy the linear constraints, while the lower plots show the Approximation Ratio, defined as $1 - |\langle H_c \rangle - E_0|/|E_0|$ and set to zero whenever $\langle H_s \rangle \neq b$. Results are averaged over 100 randomly generated problem instances for each system size. Penalty-based QAOA exhibits a trade-off between approximation performance and constraint satisfaction: small $\lambda$ yields higher Approximation Ratios but poor feasibility, while large $\lambda$ enforces constraints at the expense of performance. In contrast, AHWO-QAOA consistently satisfies all constraints across all problem sizes and achieves superior Approximation Ratios even with shallow circuits (e.g., one layer with 20 qubits), demonstrating its scalability.
  • Figure 4: Convergence behavior of AHWO-QAOA compared to penalty-based QAOA with penalty factors $\lambda=10$ and $\lambda=100$ for a 12-qubit instance. The vertical axis shows the Energy Deviation, defined as $|\langle H_c \rangle - E_0|$, where $\langle H_c \rangle$ is the expectation value of the cost Hamiltonian and $E_0$ its ground state energy. Each curve represents the mean over 100 random initializations of the variational parameters, and shaded regions indicate the variance across trials. Penalty-based QAOA converges slowly and exhibits large fluctuations, especially in early iterations, reflecting poor stability. In contrast, AHWO-QAOA converges significantly faster, with only minor fluctuations in the initial iterations due to its adaptive mechanism, and rapidly stabilizes to reach convergence in fewer iterations.
  • Figure 5: Comparison of quantum resource requirements between AHWO-QAOA (1 ansatz layer) and penalty-based QAOA (5 ansatz layers). The vertical axis shows the total number of quantum gates, and the horizontal axis indicates the number of qubits. Bars correspond to penalty-based QAOA, while dots represent AHWO-QAOA across 100 randomly generated problem instances. The results show that the gate count of penalty-based QAOA grows rapidly with system size, whereas AHWO-QAOA consistently requires fewer gates. At 20 qubits, AHWO-QAOA uses approximately half as many gates as penalty-based QAOA while simultaneously achieving superior performance in terms of Approximation Ratio and constraint satisfaction, thus significantly reducing quantum resource costs.
  • ...and 1 more figures