Optimal compilation of parametrised quantum circuits

John van de Wetering1, Richie Yeung2,3, Tuomas Laakkonen3, and Aleks Kissinger2

1University of Amsterdam
2University of Oxford
3Quantinuum

Find this paper interesting or want to discuss? Scite or leave a comment on SciRate.

Abstract

Parametrised quantum circuits contain phase gates whose phase is determined by a classical algorithm prior to running the circuit on a quantum device. Such circuits are used in variational algorithms like QAOA and VQE. In order for these algorithms to be as efficient as possible it is important that we use the fewest number of parameters. We show that, while the general problem of minimising the number of parameters is NP-hard, when we restrict to circuits that are Clifford apart from parametrised phase gates and where each parameter is used just once, we $can$ efficiently find the optimal parameter count. We show that when parameter transformations are required to be sufficiently well-behaved, the only rewrites that reduce parameters correspond to simple `fusions'. Using this we find that a previous circuit optimisation strategy by some of the authors [Kissinger, van de Wetering. PRA (2019)] finds the optimal number of parameters. Our proof uses the ZX-calculus. We also prove that the standard rewrite rules of the ZX-calculus suffice to prove any equality between parametrised Clifford circuits.

Quantum computer programs can be specified as circuits consisting of single-qubit rotation gates and multi-qubit entangling gates. Parametrised quantum circuits, where the angle of rotation for some gates are parametrised at an unspecified and arbitrary angle to be chosen at runtime, are an increasingly important construction for quantum algorithms. For instance, they are used by Variational Quantum Eigensolvers to find the ground state of a physical system. They are also used by the Quantum Approximate Optimisation Algorithm to solve combinatorial optimisation problems.

In both of these examples, removing redundant parametrised gates from the parametrised quantum circuit not only reduces the size of the quantum circuit, it also reduces the number of iterations the quantum circuit needs to be executed on the quantum computer. Therefore, reducing parameter count allows us to get a high quality output from the quantum computer in less time.

In this work we show that an earlier efficient circuit optimisation algorithm by some of the authors that is implemented in the software library PyZX is optimal for compiling parametrised quantum circuits. Specifically, given a parametrised quantum circuit as input, the algorithm always produces an equivalent circuit with optimal parameter count. Importantly, this optimality guarantee requires two assumptions: 1) the parameters of the parametrised gates are all used exactly one in the circuit, 2) the parameters of the new circuit are built from linear combinations of the parameters of the original circuit. While this second assumption might seem restrictive, we show that it actually encapsulates any smooth continuous transformation on the unit circle and so is rather general. We further show in this work that relaxing the first assumption makes the problem NP-hard, and hence that we don't expect there to exist an efficient optimisation algorithm that guarantees optimality.

► BibTeX data

► References

[1] M. Amy, D. Maslov, M. Mosca, and M. Roetteler. A meet-in-the-middle algorithm for fast synthesis of depth-optimal quantum circuits. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 32 (6): 818–830, 6 2013. ISSN 0278-0070. 10.1109/​TCAD.2013.2244643.
https:/​/​doi.org/​10.1109/​TCAD.2013.2244643

[2] Matthew Amy. Towards large-scale functional verification of universal quantum circuits. In Peter Selinger and Giulio Chiribella, editors, Proceedings of the 15th International Conference on Quantum Physics and Logic, Halifax, Canada, 3-7th June 2018, volume 287 of Electronic Proceedings in Theoretical Computer Science, pages 1–21. Open Publishing Association, 2019. 10.4204/​EPTCS.287.1.
https:/​/​doi.org/​10.4204/​EPTCS.287.1

[3] Matthew Amy and Michele Mosca. T-count optimization and Reed-Muller codes. Transactions on Information Theory, 2019. 10.1109/​TIT.2019.2906374. URL https:/​/​ieeexplore.ieee.org/​document/​8672175.
https:/​/​doi.org/​10.1109/​TIT.2019.2906374
https:/​/​ieeexplore.ieee.org/​document/​8672175

[4] Miriam Backens. The ZX-calculus is complete for stabilizer quantum mechanics. New Journal of Physics, 16 (9): 093021, 2014. 10.1088/​1367-2630/​16/​9/​093021.
https:/​/​doi.org/​10.1088/​1367-2630/​16/​9/​093021

[5] Miriam Backens and Aleks Kissinger. ZH: A complete graphical calculus for quantum computations involving classical non-linearity. In Peter Selinger and Giulio Chiribella, editors, Proceedings of the 15th International Conference on Quantum Physics and Logic, Halifax, Canada, 3-7th June 2018, volume 287 of Electronic Proceedings in Theoretical Computer Science, pages 18–34. Open Publishing Association, 2019. 10.4204/​EPTCS.287.2.
https:/​/​doi.org/​10.4204/​EPTCS.287.2

[6] Miriam Backens, Hector Miller-Bakewell, Giovanni de Felice, Leo Lobski, and John van de Wetering. There and back again: A circuit extraction tale. Quantum, 5: 421, 3 2021. ISSN 2521-327X. 10.22331/​q-2021-03-25-421.
https:/​/​doi.org/​10.22331/​q-2021-03-25-421

[7] Miriam Backens, Aleks Kissinger, Hector Miller-Bakewell, John van de Wetering, and Sal Wolffs. Completeness of the ZH-calculus. Compositionality, 5, 7 2023. ISSN 2631-4444. 10.32408/​compositionality-5-5.
https:/​/​doi.org/​10.32408/​compositionality-5-5

[8] Daniel E. Browne, Elham Kashefi, Mehdi Mhalla, and Simon Perdrix. Generalized flow and determinism in measurement-based quantum computation. New Journal of Physics, 9 (8): 250, 2007. 10.1088/​1367-2630/​9/​8/​250.
https:/​/​doi.org/​10.1088/​1367-2630/​9/​8/​250

[9] Bob Coecke and Ross Duncan. Interacting quantum observables. In Proceedings of the 37th International Colloquium on Automata, Languages and Programming (ICALP), Lecture Notes in Computer Science, 2008. 10.1007/​978-3-540-70583-3_25.
https:/​/​doi.org/​10.1007/​978-3-540-70583-3_25

[10] Bob Coecke and Ross Duncan. Interacting quantum observables: categorical algebra and diagrammatics. New Journal of Physics, 13: 043016, 2011. 10.1088/​1367-2630/​13/​4/​043016.
https:/​/​doi.org/​10.1088/​1367-2630/​13/​4/​043016

[11] Ross Duncan and Simon Perdrix. Rewriting Measurement-Based Quantum Computations with Generalised Flow. In Proceedings of ICALP, Lecture Notes in Computer Science, pages 285–296. Springer, 2010. 10.1007/​978-3-642-14162-1_24.
https:/​/​doi.org/​10.1007/​978-3-642-14162-1_24

[12] Ross Duncan, Aleks Kissinger, Simon Perdrix, and John van de Wetering. Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus. Quantum, 4: 279, 6 2020. ISSN 2521-327X. 10.22331/​q-2020-06-04-279.
https:/​/​doi.org/​10.22331/​q-2020-06-04-279

[13] Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. A quantum approximate optimization algorithm. arXiv preprint arXiv:1411.4028, 2014. URL https:/​/​arxiv.org/​abs/​1411.4028.
arXiv:1411.4028

[14] Vojtěch Havlíček, Antonio D Córcoles, Kristan Temme, Aram W Harrow, Abhinav Kandala, Jerry M Chow, and Jay M Gambetta. Supervised learning with quantum-enhanced feature spaces. Nature, 567 (7747): 209–212, 2019. 10.1038/​s41586-019-0980-2.
https:/​/​doi.org/​10.1038/​s41586-019-0980-2

[15] Luke E Heyfron and Earl T Campbell. An efficient quantum compiler that reduces T count. Quantum Science and Technology, 4 (015004), 2018. 10.1088/​2058-9565/​aad604.
https:/​/​doi.org/​10.1088/​2058-9565/​aad604

[16] Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. Diagrammatic Reasoning Beyond Clifford+T Quantum Mechanics. In Proceedings of the 33rd Annual ACM/​IEEE Symposium on Logic in Computer Science, LICS '18, pages 569–578, New York, NY, USA, 2018a. ACM. ISBN 978-1-4503-5583-4. 10.1145/​3209108.3209139.
https:/​/​doi.org/​10.1145/​3209108.3209139

[17] Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. A Complete Axiomatisation of the ZX-Calculus for Clifford+T Quantum Mechanics. In Proceedings of the 33rd Annual ACM/​IEEE Symposium on Logic in Computer Science, LICS '18, pages 559–568, New York, NY, USA, 2018b. ACM. ISBN 978-1-4503-5583-4. 10.1145/​3209108.3209131.
https:/​/​doi.org/​10.1145/​3209108.3209131

[18] Aleks Kissinger and John van de Wetering. Reducing the number of non-Clifford gates in quantum circuits. Physical Review A, 102: 022406, 8 2020. 10.1103/​PhysRevA.102.022406.
https:/​/​doi.org/​10.1103/​PhysRevA.102.022406

[19] Stach Kuijpers, John van de Wetering, and Aleks Kissinger. Graphical Fourier theory and the cost of quantum addition. arXiv preprint arXiv:1904.07551, 2019. URL https:/​/​arxiv.org/​abs/​1904.07551.
arXiv:1904.07551

[20] Tommy McElvanney and Miriam Backens. Complete flow-preserving rewrite rules for MBQC patterns with Pauli measurements. In Stefano Gogioso and Matty Hoban, editors, Proceedings 19th International Conference on Quantum Physics and Logic, Wolfson College, Oxford, UK, 27 June - 1 July 2022, volume 394 of Electronic Proceedings in Theoretical Computer Science, pages 66–82. Open Publishing Association, 2023. 10.4204/​EPTCS.394.5.
https:/​/​doi.org/​10.4204/​EPTCS.394.5

[21] Hector Miller-Bakewell. Finite Verification of Infinite Families of Diagram Equations. In Bob Coecke and Matthew Leifer, editors, Proceedings 16th International Conference on Quantum Physics and Logic, Chapman University, Orange, CA, USA., 10-14 June 2019, volume 318 of Electronic Proceedings in Theoretical Computer Science, pages 27–52. Open Publishing Association, 2020. 10.4204/​EPTCS.318.3.
https:/​/​doi.org/​10.4204/​EPTCS.318.3

[22] Yunseong Nam, Neil J Ross, Yuan Su, Andrew M Childs, and Dmitri Maslov. Automated optimization of large quantum circuits with continuous parameters. npj Quantum Information, 4 (1): 23, 2018. 10.1038/​s41534-018-0072-4.
https:/​/​doi.org/​10.1038/​s41534-018-0072-4

[23] Simon Perdrix and Quanlong Wang. Supplementarity is necessary for quantum diagram reasoning. In 41st International Symposium on Mathematical Foundations of Computer Science (MFCS 2016), volume 58 of Leibniz International Proceedings in Informatics (LIPIcs), pages 76:1–76:14, Krakow, Poland, 2016. 10.4230/​LIPIcs.MFCS.2016.76.
https:/​/​doi.org/​10.4230/​LIPIcs.MFCS.2016.76

[24] Alberto Peruzzo, Jarrod McClean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J Love, Alán Aspuru-Guzik, and Jeremy L O’brien. A variational eigenvalue solver on a photonic quantum processor. Nature communications, 5: 4213, 2014. 10.1038/​ncomms5213.
https:/​/​doi.org/​10.1038/​ncomms5213

[25] Boldizsár Poór, Robert I. Booth, Titouan Carette, John van de Wetering, and Lia Yeh. The Qupit Stabiliser ZX-travaganza: Simplified Axioms, Normal Forms and Graph-Theoretic Simplification. In Shane Mansfield, Benoit Valı̂ron, and Vladimir Zamdzhiev, editors, Proceedings of the Twentieth International Conference on Quantum Physics and Logic, Paris, France, 17-21st July 2023, volume 384 of Electronic Proceedings in Theoretical Computer Science, pages 220–264. Open Publishing Association, 2023. 10.4204/​EPTCS.384.13.
https:/​/​doi.org/​10.4204/​EPTCS.384.13

[26] Robert Raussendorf and Hans J. Briegel. A One-Way Quantum Computer. Physical Review Letters, 86: 5188–5191, 5 2001. 10.1103/​PhysRevLett.86.5188.
https:/​/​doi.org/​10.1103/​PhysRevLett.86.5188

[27] Robert Raussendorf, Dan E. Browne, and Hans J. Briegel. Measurement-based quantum computation on cluster states. Physical Review A, 68 (2): 22312, 2003. ISSN 1094-1622. 10.1103/​PhysRevA.68.022312.
https:/​/​doi.org/​10.1103/​PhysRevA.68.022312

[28] Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. Evaluating analytic gradients on quantum hardware. Physical Review A, 99 (3): 032331, 2019. 10.1103/​PhysRevA.99.032331.
https:/​/​doi.org/​10.1103/​PhysRevA.99.032331

[29] Sukin Sim, Peter D Johnson, and Alán Aspuru-Guzik. Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms. Advanced Quantum Technologies, 2 (12): 1900070, 2019. 10.1002/​qute.201900070.
https:/​/​doi.org/​10.1002/​qute.201900070

[30] Will Simmons. Relating Measurement Patterns to Circuits via Pauli Flow. In Chris Heunen and Miriam Backens, editors, Proceedings 18th International Conference on Quantum Physics and Logic, Gdansk, Poland, and online, 7-11 June 2021, volume 343 of Electronic Proceedings in Theoretical Computer Science, pages 50–101. Open Publishing Association, 2021. 10.4204/​EPTCS.343.4.
https:/​/​doi.org/​10.4204/​EPTCS.343.4

[31] John van de Wetering. ZX-calculus for the working quantum computer scientist. arXiv preprint arXiv:2012.13966, 2020. URL https:/​/​arxiv.org/​abs/​2012.13966.
arXiv:2012.13966

[32] John van de Wetering and Matt Amy. Optimising quantum circuits is generally hard. arXiv preprint arXiv:2310.05958, 2023. URL https:/​/​arxiv.org/​abs/​2310.05958.
arXiv:2310.05958

[33] Maarten Van Den Nest. Classical simulation of quantum computation, the gottesman-knill theorem, and slightly beyond. Quantum Info. Comput., 10 (3): 258–271, 2010. ISSN 1533-7146. 10.5555/​2011350.2011356.
https:/​/​doi.org/​10.5555/​2011350.2011356

[34] Vivien Vandaele, Simon Perdrix, and Christophe Vuillot. Optimal number of parametrized rotations and hadamard gates in parametrized clifford circuits with non-repeated parameters. arXiv preprint arXiv:2407.07846, 2024. URL https:/​/​arxiv.org/​abs/​2407.07846.
arXiv:2407.07846

[35] Renaud Vilmart. A Near-Minimal Axiomatisation of ZX-Calculus for Pure Qubit Quantum Mechanics. In 2019 34th Annual ACM/​IEEE Symposium on Logic in Computer Science (LICS), pages 1–10, 2019. 10.1109/​LICS.2019.8785765.
https:/​/​doi.org/​10.1109/​LICS.2019.8785765

[36] Fang Zhang and Jianxin Chen. Optimizing T gates in Clifford+T circuit as $\pi/​4$ rotations around Paulis. arXiv preprint arXiv:1903.12456, 2019. URL https:/​/​arxiv.org/​abs/​1903.12456.
arXiv:1903.12456

Cited by

[1] Stefanie Castillo, "The DiQuNET Architecture for the Control of Quantum Processors: The Case Study of Trapped Ions", IEEE Access 14, 42245 (2026).

[2] Giovanni de Felice, Boldizsár Poór, Cole Comfort, Lia Yeh, Mateusz Kupper, William Cashman, and Bob Coecke, "A dataflow programming framework for linear optical distributed quantum computing", Quantum 10, 1972 (2026).

[3] Avimita Chatterjee, Archisman Ghosh, and Swaroop Ghosh, 2026 27th International Symposium on Quality Electronic Design (ISQED) 1 (2026) ISBN:979-8-3315-8361-3.

[4] Emmanuel Hainry, Romain Péchoux, and Mário Silva, "A Polytime Quantum Programming Language", ACM Transactions on Quantum Computing 7 1, 1 (2026).

[5] Mikel Garcia de Andoin, Thorge Müller, and Gonzalo Camacho, "Hamiltonian simulation with explicit formulas for digital-analog quantum computing", Physical Review A 113 6, 062607 (2026).

[6] Lian Remme, Alexander Weinert, and Andre Waschk, 2025 IEEE International Conference on Quantum Software (QSW) 215 (2025) ISBN:979-8-3315-6720-0.

[7] Yusei Mori, Hideaki Hakoshima, and Keisuke Fujii, "Nontrivial Multiproduct Commutation Relation Toward Reducing T -Count in Sequential Pauli-Based Computation", PRX Quantum 7 2, 020345 (2026).

[8] Francisco J. R. Ruiz, Tuomas Laakkonen, Johannes Bausch, Matej Balog, Mohammadamin Barekatain, Francisco J. H. Heras, Alexander Novikov, Nathan Fitzpatrick, Bernardino Romera-Paredes, John van de Wetering, Alhussein Fawzi, Konstantinos Meichanetzidis, and Pushmeet Kohli, "Quantum Circuit Optimization with AlphaTensor", arXiv:2402.14396, (2024).

[9] John van de Wetering and Matt Amy, "Optimising quantum circuits is generally hard", arXiv:2310.05958, (2023).

[10] Boldizsár Poór, Razin A. Shaikh, and Quanlong Wang, "ZX-calculus is Complete for Finite-Dimensional Hilbert Spaces", arXiv:2405.10896, (2024).

[11] Giovanni de Felice, Boldizsár Poór, Lia Yeh, and William Cashman, "Fusion and flow: formal protocols to reliably build photonic graph states", arXiv:2409.13541, (2024).

[12] Davide Rattacaso, Daniel Jaschke, Marco Ballarin, Ilaria Siloi, and Simone Montangero, "Quantum algorithms for equational reasoning", arXiv:2508.21122, (2025).

[13] Aleks Kissinger and John van de Wetering, "Scalable Spider Nests (...Or How to Graphically Grok Transversal Non-Clifford Gates)", arXiv:2404.07828, (2024).

[14] Neil J. Ross and Scott Wesley, "Cutoff Theorems for the Equivalence of Parameterized Quantum Circuits (Extended)", arXiv:2506.20985, (2025).

[15] Vivien Vandaele, Simon Perdrix, and Christophe Vuillot, "Optimal number of parametrized rotations and Hadamard gates in parametrized Clifford circuits with non-repeated parameters", arXiv:2407.07846, (2024).

[16] Nicolas Heurtel, "A Complete Graphical Language for Linear Optical Circuits with Finite-Photon-Number Sources and Detectors", arXiv:2402.17693, (2024).

[17] Scott Wesley, "Enriched Categories for Parameterized Circuit Semantics", arXiv:2501.12481, (2025).

[18] Aleks Kissinger and John van de Wetering, "ZX-Flow: A Flexible Criterion for Deterministic Computation with ZX-Diagrams", arXiv:2603.09580, (2026).

[19] Richie Yeung, Aleks Kissinger, and Rob Cornish, "Equivariant Reinforcement Learning for Clifford Quantum Circuit Synthesis", arXiv:2605.10910, (2026).

[20] Giovanni de Felice, Boldizsár Poór, Cole Comfort, Lia Yeh, Mateusz Kupper, William Cashman, and Bob Coecke, "A dataflow programming framework for linear optical distributed quantum computing", arXiv:2601.08389, (2026).

The above citations are from Crossref's cited-by service (last updated successfully 2026-08-09 05:46:48) and SAO/NASA ADS (last updated successfully 2026-08-08 16:56:45). The list may be incomplete as not all publishers provide suitable and complete citation data.

Could not fetch ADS cited-by data during last attempt 2026-08-09 05:46:48: Cannot retrieve data from ADS due to rate limitations.