- Open Access
Penalty-free approach to accelerating constrained quantum optimization
Phys. Rev. A 112, 062605 – Published 2 December, 2025
DOI: https://doi.org/10.1103/fb5m-cl9m
Abstract
Traditional methods for handling (inequality) constraints in the quantum approximate optimization algorithm (QAOA) typically rely on penalty terms and slack variables, which increase problem complexity and expand the search space. More sophisticated mixer-based QAOA variants restrict the search within the feasible assignments but often suffer from prohibitive circuit complexity. This paper presents a penalty-free formalism for incorporating inequality constraints into the cost function of QAOA using an oracle-based subroutine that evaluates constraint satisfaction in an additional register, subsequently called indicator function QAOA (IF-QAOA). Applied to the knapsack problem, we demonstrate in numerical simulations the superior performance of IF-QAOA over conventional penalty-based approaches. Using advanced QAOA simulation techniques, we find that IF-QAOA achieves significantly higher solution quality and a faster time to solution in 82% of our benchmark cases, even though circuit depth is approximately three times larger. Analysis of the scaling behavior shows favorable scaling of IF-QAOA compared to penalty-based methods. Also, benchmarks against the recently developed quantum tree generator QAOA for knapsack problems (P. Christiansen et al., arXiv:2411.00518) demonstrated higher solution quality for circuits of similar depth. Additionally, this paper introduces a method for approximating the indicator function when the number of ancillary qubits is limited or the constraint function is noninteger. With a specialized simulation algorithm based on projective measurements, we empirically demonstrate that this formalism can encode general inequality constraints using a fixed number of ancillary qubits.
Physics Subject Headings (PhySH)
Article Text
References (77)
- Google Quantum AI and Collaborators, Quantum error correction below the surface code threshold, Nature(London) 638, 920 (2025).
- M. Liu, R. Shaydulin, P. Niroula, M. DeCross, S.-H. Hung, W. Y. Kon, E. Cervero-Martín, K. Chakraborty, O. Amer, S. Aaronson, A. Acharya, Y. Alexeev, K. J. Berg, S. Chakrabarti, F. J. Curchod, J. M. Dreiling, N. Erickson, C. Foltz, M. Foss-Feig, D. Hayes et al., Certified randomness using a trapped-ion quantum processor, Nature(London) 640 343 (2025).
- H. Markowitz, Portfolio selection, J. Fin. 7, 77 (1952).
- E. Grant, T. S. Humble, and B. Stump, Benchmarking quantum annealing controls with portfolio optimization, Phys. Rev. Appl. 15, 014012 (2021).
- G. Buonaiuto, F. Gargiulo, G. De Pietro, M. Esposito, and M. Pota, Best practices for portfolio optimization by quantum computing, experimented on real quantum devices, Sci. Rep. 13, 19434 (2023).
- D. Venturelli, D. J. J. Marchand, and G. Rojo, Quantum annealing implementation of job-shop scheduling, arXiv:1506.08479.
- S. Feld, C. Roch, T. Gabor, C. Seidel, F. Neukart, I. Galter, W. Mauerer, and C. Linnhoff-Popien, A hybrid solution method for the capacitated vehicle routing problem using a quantum annealer, Frontiers in ICT 6, 13 (2019).
- S. Yarkoni, E. Raponi, T. Bäck, and S. Schmitt, Quantum annealing for industry applications: Introduction and review, Rep. Prog. Phys. 85, 104001 (2022).
- A. Y. Wei, P. Naik, A. W. Harrow, and J. Thaler, Quantum algorithms for jet clustering, Phys. Rev. D 101, 094015 (2020).
- Y. Zhu, W. Zhuang, C. Qian, Y. Ma, D. E. Liu, M. Ruan, and C. Zhou, A novel quantum realization of jet clustering in high-energy physics experiments, Sci. Bulletin 70, 460 (2025).
- H. Okawa, X.-Z. Tao, Q.-G. Zeng, and M.-H. Yung, Quantum-annealing-inspired algorithms for multijet clustering, Phys. Lett. B 864, 139393 (2025).
- A. Abbas, A. Ambainis, B. Augustino, A. Bärtschi, H. Buhrman, C. Coffrin, G. Cortiana, V. Dunjko, D. J. Egger, B. G. Elmegreen, N. Franco, F. Fratini, B. Fuller, J. Gacon, C. Gonciulea, S. Gribling, S. Gupta, S. Hadfield, R. Heese, G. Kircher, T. Kleinert et al., Challenges and opportunities in quantum optimization, Nat. Rev. Phys. 6, 718 (2024).
- R. M. Karp, Reducibility among combinatorial problems, in Complexity of Computer Computations: Proceedings of a Symposium on the Complexity of Computer Computations, March 20–22, 1972, New York, edited by R. E. Miller, J. W. Thatcher, and J. D. Bohlinger (Springer US, Boston, 1972), pp. 85–103.
- F. Glover, G. Kochenberger, R. Hennig, and Y. Du, Quantum bridge analytics I: A tutorial on formulating and using QUBO models, Ann. Oper. Res. 314, 141 (2022).
- A. Lucas, Ising formulations of many NP problems, Front. Phys. 2, (2014).
- M. Born and V. Fock, Beweis des adiabatensatzes, Z. Phys. 51, 165 (1928).
- E. Farhi, J. Goldstone, S. Gutmann, and M. Sipser, Quantum computation by adiabatic evolution, arXiv:quant-ph/0001106.
- E. Farhi, J. Goldstone, and S. Gutmann, A quantum approximate optimization algorithm, arXiv:1411.4028.
- T. Shirai and N. Togawa, Compressed space quantum approximate optimization algorithm for constrained combinatorial optimization, IEEE Trans. Quant. Eng. 6, 3102214 (2025).
- S. Hadfield, Z. Wang, E. G. Rieffel, B. O'Gorman, D. Venturelli, and R. Biswas, Quantum approximate optimization with hard and soft constraints, Proceedings of the Second International Workshop on Post Moores Era Supercomputing, PMES'17 (Association for Computing Machinery, New York, 2017), pp. 15–21.
- P. D. de la Grand'rive and J.-F. Hullo, Knapsack problem variants of QAOA for battery revenue optimisation, arXiv:1908.02210.
- K. Kea, C. Huot, and Y. Han, Leveraging knapsack QAOA approach for optimal electric vehicle charging, IEEE Access 11, 109964 (2023).
- Y. Deller, S. Schmitt, M. Lewenstein, S. Lenk, M. Federer, F. Jendrzejewski, P. Hauke, and V. Kasper, Quantum approximate optimization algorithm for qudit systems, Phys. Rev. A 107, 062410 (2023).
- P. Christiansen, L. Binkowski, D. Ramacciotti, and S. Wilkening, Quantum tree generator improves QAOA state-of-the-art for the knapsack problem, arXiv:2411.00518.
- A. Glos, A. Krawiec, and Z. Zimborás, Space-efficient binary optimization for variational quantum computing, npj Quantum Inf. 8, 39 (2022).
- G. E. Crooks, Gradients of parameterized quantum gates using the parameter-shift rule and gate decomposition, arXiv:1905.13311.
- T. Jones and J. Gacon, Efficient calculation of gradients in classical simulations of variational quantum algorithms, arXiv:2009.02823.
- S. H. Sack and M. Serbyn, Quantum annealing initialization of the quantum approximate optimization algorithm, Quantum 5, 491 (2021).
- J. A. Montañez-Barrera and K. Michielsen, Toward a linear-ramp QAOA protocol: Evidence of a scaling advantage in solving some combinatorial optimization problems, npj Quantum Inf. 11, 131 (2025).
- H. Kellerer, U. Pferschy, and D. Pisinger, Knapsack Problems (Springer, Berlin, 2004).
- M. R. Garey and D. S. Johnson, Computers and Intractability; A Guide to the Theory of NP-Completeness (W. H. Freeman & Co., New York, 1990).
- S. Martello, D. Pisinger, and P. Toth, Dynamic programming and strong bounds for the 0-1 knapsack problem, Manag. Sci. 45, 414 (1999).
- P. J. Kolesar, A branch and bound algorithm for the knapsack problem, Manag. Sci. 13, 723 (1967).
- S. Martello and P. Toth, Knapsack problems: Algorithms and Computer Implementations, Wiley-Interscience Series in Discrete Mathematics and Optimization (J. Wiley, Chichester, 1990).
- L. K. Grover, A fast quantum mechanical algorithm for database search, Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing (Association for Computing Machinery, New York, NY, 1996), pp. 212–219.
- C. Durr and P. Hoyer, A quantum algorithm for finding the minimum, arXiv:quant-ph/9607014.
- A. Gilliam, S. Woerner, and C. Gonciulea, Grover adaptive search for constrained polynomial binary optimization, Quantum 5, 428 (2021).
- S. Wilkening, A.-I. Lefterovici, L. Binkowski, M. Perk, S. P. Fekete, and T. J. Osborne, A quantum algorithm for solving 0-1 Knapsack problems, npj Quantum Inf. 11, 146 (2025).
- T. Shirai and N. Togawa, Post-processing variationally scheduled quantum algorithm for constrained combinatorial optimization problems, IEEE Trans. Quant. Eng. 5, 3101114 (2024).
- C. Gambella and A. Simonetto, Multiblock ADMM heuristics for mixed-binary optimization on classical and quantum computers, IEEE Trans. Quant. Eng. 1, 3102022 (2020).
- Z. Zhao, L. Fan, and Z. Han, Hybrid quantum benders’ Decomposition for mixed-integer linear programming, in 2022 IEEE Wireless Communications and Networking Conference (WCNC) (IEEE Press, Austin, 2022), pp. 2536–2540.
- P. Mirkarimi, I. Shukla, D. C. Hoyle, R. Williams, and N. Chancellor, Quantum optimization with linear ising penalty functions for customer data science, Phys. Rev. Res. 6, 043241 (2024).
- C. Roch, A. Impertro, and C. Linnhoff-Popien, Cross entropy optimization of constrained problem Hamiltonians for quantum annealing, in Computational Science–ICCS 2021, edited by M. Paszynski, D. Kranzlmüller, V. V. Krzhizhanovskaya, J. J. Dongarra, and P. M. A. Sloot (Springer International Publishing, Cham, 2021), Vol. 12747, pp. 60–73.
- M. Hess, L. Palackal, A. Awasthi, and K. Wintersperger, Effective embedding of integer linear inequalities for variational quantum algorithms, 2024 IEEE International Conference on Quantum Computing and Engineering (QCE) (IEEE Computer Society, Piscataway, NJ, 2024), pp. 221–231.
- E. Gabbassov, G. Rosenberg, and A. Scherer, Lagrangian duality in quantum optimization: Overcoming QUBO limitations for constrained problems, Phys. Rev. Res. 7, 023305 (2025).
- J. A. Montañez-Barrera, D. Willsch, A. Maldonado-Romo, and K. Michielsen, Unbalanced penalization: A new approach to encode inequality constraints of combinatorial problems for quantum optimization algorithms, Quantum Sci. Technol. 9, 025022 (2024).
- W. van Dam, K. Eldefrawy, N. Genise, and N. Parham, Quantum optimization heuristics with an application to knapsack problems, in 2021 IEEE International Conference on Quantum Computing and Engineering (QCE) (IEEE Computer Society, Piscataway, NJ, 2021).
- A. Bottarelli, S. Schmitt, and P. Hauke, Inequality constraints in variational quantum circuits with qudits, Phys. Rev. Res. 7, 033202 (2025).
- T. G. Draper, Addition on a quantum computer, arXiv:quant-ph/0008033.
- S. Hadfield, Z. Wang, B. O'Gorman, E. G. Rieffel, D. Venturelli, and R. Biswas, From the quantum approximate optimization algorithm to a quantum alternating operator ansatz, Algorithms 12, 34 (2019).
- Z. Wang, N. C. Rubin, J. M. Dominy, and E. G. Rieffel, -mixers: Analytical and numerical results for QAOA, Phys. Rev. A 101, 012320 (2020).
- J. Cook, S. Eidenbenz, and A. Bärtschi, The quantum alternating operator ansatz on maximum K-vertex cover, in 2020 IEEE International Conference on Quantum Computing and Engineering (QCE) (IEEE Computer Society, Piscataway, NJ, 2020), pp. 83–92.
- N. P. Sawaya, A. T. Schmitz, and S. Hadfield, Encoding trade-offs and design toolkits in quantum algorithms for discrete optimization: Coloring, routing, scheduling, and other problems, Quantum 7, 1111 (2023).
- F. G. Fuchs, K. O. Lye, H. M. Nilsen, A. J. Stasik, and G. Sartor, Constrained mixers for the quantum approximate optimization algorithm, Algorithms 15, 202 (2022).
- Y. Ruan, Z. Yuan, X. Xue, and Z. Liu, Quantum approximate optimization for combinatorial problems with constraints, Inf. Sci. 619, 98 (2023).
- Z. H. Saleem, T. Tomesh, B. Tariq, and M. Suchara, Approaches to constrained quantum approximate optimization, SN Comput. Sci. 4, 183 (2023).
- A. Bärtschi and S. Eidenbenz, Grover mixers for QAOA: Shifting complexity from mixer design to state preparation, in 2020 IEEE International Conference on Quantum Computing and Engineering (QCE) (IEEE Computer Society, Piscatway, NJ, 2020), pp. 72–82.
- D. Cruz, R. Fournier, F. Gremion, A. Jeannerot, K. Komagata, T. Tosic, J. Thiesbrummel, C. L. Chan, N. Macris, M.-A. Dupertuis, and C. Javerzac-Galy, Efficient quantum algorithms for GHZ and W states, and implementation on the IBM quantum computer, Adv. Quantum Technol. 2, 1900015 (2019).
- D. Herman, R. Shaydulin, Y. Sun, S. Chakrabarti, S. Hu, P. Minssen, A. Rattew, R. Yalovetzky, and M. Pistoia, Constrained optimization via quantum zeno dynamics, Commun. Phys. 6, 219 (2023).
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information: 10th Anniversary Edition, 1st ed. (Cambridge University Press, Cambridge, 2012).
- D. Lykov, R. Shaydulin, Y. Sun, Y. Alexeev, and M. Pistoia, Fast simulation of high-depth QAOA circuits, Proceedings of the SC '23 Workshops of the International Conference on High Performance Computing, Network, Storage, and Analysis (Association for Computing Machinery, New York, NY, 2023), pp. 1443–1451.
- J. Golden, A. Baertschi, D. O'Malley, E. Pelofske, and S. Eidenbenz, JuliQAOA: Fast, flexible QAOA simulation, Proceedings of the SC '23 Workshops of The International Conference on High Performance Computing, Network, Storage, and Analysis, SC-W '23 (Association for Computing Machinery, New York, 2023), pp. 1454–1459.
- J. Stein, J. Blenninger, D. Bucher, P. J. Eder, E. Çetiner, M. Zorn, and C. Linnhoff-Popien, CUAOA: A novel cuda-accelerated simulation framework for the QAOA, 2024 IEEE International Conference on Quantum Computing and Engineering (QCE) (IEEE Computer Society, New York, 2024), pp. 280–285.
- P. L. Hammer, P. Hansen, and B. Simeone, Roof duality, complementation and persistency in quadratic 0–1 optimization, Math. Program. 28, 121 (1984).
- M. X. Goemans and D. P. Williamson, Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming, J. ACM 42, 1115 (1995).
- M. Ayodele, Penalty weights in QUBO formulations: Permutation problems, Evolutionary Computation in Combinatorial Optimization (Springer, Cham, 2022), pp. 159–174.
- D. C. Liu and J. Nocedal, On the limited memory BFGS method for large scale optimization, Math. Program. 45, 503 (1989).
- L. Zhou, S.-T. Wang, S. Choi, H. Pichler, and M. D. Lukin, Quantum approximate optimization algorithm: Performance, mechanism, and implementation on near-term devices, Phys. Rev. X 10, 021067 (2020).
- D. Bucher, N. Kraus, J. Blenninger, M. Lachner, J. Stein, and C. Linnhoff-Popien, Towards robust benchmarking of quantum optimization algorithms, 2024 IEEE International Conference on Quantum Computing and Engineering (QCE) (IEEE Computer Society, Piscataway, NJ, 2024), pp. 159–170.
- T. Albash and D. A. Lidar, Adiabatic quantum computation, Rev. Mod. Phys. 90, 015002 (2018).
- J. Jooken, P. Leyman, and P. De Causmaecker, A new class of hard problem instances for the 0–1 knapsack problem, Eur. J. Oper. Res. 301, 841 (2022).
- G. H. Low and I. L. Chuang, Optimal Hamiltonian simulation by quantum signal processing, Phys. Rev. Lett. 118, 010501 (2017).
- A. Gilyén, Y. Su, G. H. Low, and N. Wiebe, Quantum singular value transformation and beyond: Exponential improvements for quantum matrix arithmetics, Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (Association for Computing Machinery, New York, NY, 2019), pp. 193–204.
- J. Stein, L. Müller, L. Hölscher, G. Chnitidis, J. Jojo, A. Farea, M. S. Çelebi, D. Bucher, J. Wulf, D. Fischer, P. Altmann, C. Linnhoff-Popien, and S. Feld, Exponential quantum speedup for simulation-based optimization applications, arXiv:2305.08482.
- D. Bucher, dbucher97/fast-qaoa-c: Fast QAOA Simulation Framework (2025), Zenodo, https://doi.org/10.5281/zenodo.17399560.
- J. H. van Lint and R. M. Wilson, A Course in Combinatorics, 2nd ed. (Cambridge University Press, Cambridge, 2006).
- N. Biggs, E. K. Lloyd, R. J. Wilson, and R. J. Wilson, Graph Theory: 1736-1936, 1st ed. (Clarendon Press, Oxford, 1998).