Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Qubit Recycling Revisited

Published: 20 June 2024 Publication History

Abstract

Reducing the width of quantum circuits is crucial due to limited number of qubits in quantum devices. This paper revisit an optimization strategy known as qubit recycling (alternatively wire-recycling or measurement-and-reset), which leverages gate commutativity to reuse discarded qubits, thereby reducing circuit width. We introduce qubit dependency graphs (QDGs) as a key abstraction for this optimization. With QDG, we isolate the computationally demanding components, and observe that qubit recycling is essentially a matrix triangularization problem. Based on QDG and this observation, we study qubit recycling with a focus on complexity, algorithmic, and verification aspects. Firstly, we establish qubit recycling’s NP-hardness through reduction from Wilf’s question, another matrix triangularization problem. Secondly, we propose a QDG-guided solver featuring multiple heuristic options for effective qubit recycling. Benchmark tests conducted on RevLib illustrate our solver’s superior or comparable performance to existing alternatives. Notably, it achieves optimal solutions for the majority of circuits. Finally, we develop a certified qubit recycler that integrates verification and validation techniques, with its correctness proof mechanized in Coq.

References

[1]
Samson Abramsky and Bob Coecke. 2004. A Categorical Semantics of Quantum Protocols. In 19th IEEE Symposium on Logic in Computer Science (LICS 2004), 14-17 July 2004, Turku, Finland, Proceedings. IEEE Computer Society, 415–425. https://doi.org/10.1109/LICS.2004.1319636
[2]
Gadi Aleksandrowicz, Thomas Alexander, Panagiotis Barkoutsos, Luciano Bello, Yael Ben-Haim, David Bucher, Francisco Jose Cabrera-Hernández, Jorge Carballo-Franquis, Adrian Chen, Chun-Fu Chen, Jerry M. Chow, Antonio D. Córcoles-Gonzales, Abigail J. Cross, Andrew Cross, Juan Cruz-Benito, Chris Culver, Salvador De La Puente González, Enrique De La Torre, Delton Ding, Eugene Dumitrescu, Ivan Duran, Pieter Eendebak, Mark Everitt, Ismael Faro Sertage, Albert Frisch, Andreas Fuhrer, Jay Gambetta, Borja Godoy Gago, Juan Gomez-Mosquera, Donny Greenberg, Ikko Hamamura, Vojtech Havlicek, Joe Hellmers, Łukasz Herok, Hiroshi Horii, Shaohan Hu, Takashi Imamichi, Toshinari Itoko, Ali Javadi-Abhari, Naoki Kanazawa, Anton Karazeev, Kevin Krsulich, Peng Liu, Yang Luh, Yunho Maeng, Manoel Marques, Francisco Jose Martín-Fernández, Douglas T. McClure, David McKay, Srujan Meesala, Antonio Mezzacapo, Nikolaj Moll, Diego Moreda Rodríguez, Giacomo Nannicini, Paul Nation, Pauline Ollitrault, Lee James O’Riordan, Hanhee Paik, Jesús Pérez, Anna Phan, Marco Pistoia, Viktor Prutyanov, Max Reuter, Julia Rice, Abdón Rodríguez Davila, Raymond Harry Putra Rudy, Mingi Ryu, Ninad Sathaye, Chris Schnabel, Eddie Schoute, Kanav Setia, Yunong Shi, Adenilton Silva, Yukio Siraichi, Seyon Sivarajah, John A. Smolin, Mathias Soeken, Hitomi Takahashi, Ivano Tavernelli, Charles Taylor, Pete Taylour, Kenso Trabing, Matthew Treinish, Wes Turner, Desiree Vogt-Lee, Christophe Vuillot, Jonathan A. Wildstrom, Jessica Wilson, Erick Winston, Christopher Wood, Stephen Wood, Stefan Wörner, Ismail Yunus Akhalwaya, and Christa Zoufal. 2019. Qiskit: An Open-source Framework for Quantum Computing. https://doi.org/10.5281/zenodo.2562111
[3]
Matthew Amy, Martin Roetteler, and Krysta M. Svore. 2017. Verified Compilation of Space-Efficient Reversible Circuits. In Computer Aided Verification - 29th International Conference, CAV 2017, Heidelberg, Germany, July 24-28, 2017, Proceedings, Part II, Rupak Majumdar and Viktor Kuncak (Eds.) (Lecture Notes in Computer Science, Vol. 10427). Springer, 3–21. https://doi.org/10.1007/978-3-319-63390-9_1
[4]
Jrgen Bang-Jensen and Gregory Z. Gutin. 2008. Digraphs: Theory, Algorithms and Applications. isbn:1848009976 https://doi.org/10.1007/978-1-84800-998-1
[5]
Suresh Bolusani, Mathieu Besançon, Ksenia Bestuzheva, Antonia Chmiela, João Dionísio, Tim Donkiewicz, Jasper van Doornmalen, Leon Eifler, Mohammed Ghannam, Ambros Gleixner, Christoph Graczyk, Katrin Halbig, Ivo Hedtke, Alexander Hoen, Christopher Hojny, Rolf van der Hulst, Dominik Kamp, Thorsten Koch, Kevin Kofler, Jurgen Lentz, Julian Manns, Gioni Mexi, Erik Mühmer, Marc E. Pfetsch, Franziska Schlösser, Felipe Serrano, Yuji Shinano, Mark Turner, Stefan Vigerske, Dieter Weninger, and Lixing Xu. 2024. The SCIP Optimization Suite 9.0. Optimization Online. https://optimization-online.org/2024/02/the-scip-optimization-suite-9-0/
[6]
Graham R. Brightwell and Peter Winkler. 1991. Counting Linear Extensions is #P-Complete. In Proceedings of the 23rd Annual ACM Symposium on Theory of Computing, May 5-8, 1991, New Orleans, Louisiana, USA, Cris Koutsougeras and Jeffrey Scott Vitter (Eds.). ACM, 175–181. https://doi.org/10.1145/103418.103441
[7]
John Bruno and Ravi Sethi. 1976. Code Generation for a One-Register Machine. J. ACM, 23, 3 (1976), jul, 502–510. issn:0004-5411 https://doi.org/10.1145/321958.321971
[8]
Bob Coecke and Aleks Kissinger. 2017. Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning. Cambridge University Press. isbn:9781316219317 https://doi.org/10.1017/9781316219317
[9]
Matthew DeCross, Eli Chertkov, Megan Kohagen, and Michael Foss-Feig. 2023. Qubit-Reuse Compilation with Mid-Circuit Measurement and Reset. Phys. Rev. X, 13 (2023), Dec, 041057. https://doi.org/10.1103/PhysRevX.13.041057
[10]
Yongshan Ding, Xin-Chuan Wu, Adam Holmes, Ash Wiseth, Diana Franklin, Margaret Martonosi, and Frederic T. Chong. 2020. SQUARE: Strategic Quantum Ancilla Reuse for Modular Quantum Programs via Cost-Effective Uncomputation. In 2020 ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA). 570–583. https://doi.org/10.1109/ISCA45697.2020.00054
[11]
Pavel Etingof, Shlomo Gelaki, Dmitri Nikshych, and Victor Ostrik. 2016. Tensor categories. American Mathematical Soc. https://bookstore.ams.org/surv-205
[12]
Guillaume Fertin, Irena Rusu, and Stéphane Vialette. 2015. Obtaining a Triangular Matrix by Independent Row-Column Permutations. In Algorithms and Computation - 26th International Symposium, ISAAC 2015, Nagoya, Japan, December 9-11, 2015, Proceedings, Khaled M. Elbassioni and Kazuhisa Makino (Eds.) (Lecture Notes in Computer Science, Vol. 9472). Springer, 165–175. https://doi.org/10.1007/978-3-662-48971-0_15
[13]
Austin G. Fowler, Matteo Mariantoni, John M. Martinis, and Andrew N. Cleland. 2012. Surface codes: Towards practical large-scale quantum computation. Phys. Rev. A, 86 (2012), Sep, 032324. https://doi.org/10.1103/PhysRevA.86.032324
[14]
Ramaswamy Govindarajan, Hongbo Yang, José Nelson Amaral, Chihong Zhang, and Guang R. Gao. 2003. Minimum Register Instruction Sequencing to Reduce Register Spills in Out-of-Order Issue Superscalar Architectures. IEEE Trans. Computers, 52, 1 (2003), 4–20. https://doi.org/10.1109/TC.2003.1159750
[15]
Ramsey W. Haddad. 1990. Triangularization: a two-processor scheduling problem. Ph. D. Dissertation. Stanford University, USA. https://searchworks.stanford.edu/view/507223
[16]
Chris Heunen and Jamie Vicary. 2019. Categories for Quantum Theory: An Introduction. Oxford University Press. isbn:9780198739623 https://doi.org/10.1093/oso/9780198739623.001.0001
[17]
Kesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu, and Michael Hicks. 2021. A Verified Optimizer for Quantum Circuits. Proc. ACM Program. Lang., 5, POPL (2021), Article 37, Jan, 29 pages. https://doi.org/10.1145/3434318
[18]
Fei Hua, Yuwei Jin, Yan-Hao Chen, Suhas Vittal, Kevin Krsulich, Lev S. Bishop, John Lapeyre, Ali Javadi-Abhari, and Eddy Z. Zhang. 2023. CaQR: A Compiler-Assisted Approach for Qubit Reuse through Dynamic Circuit. In Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 3, ASPLOS 2023, Vancouver, BC, Canada, March 25-29, 2023, Tor M. Aamodt, Natalie D. Enright Jerger, and Michael M. Swift (Eds.). ACM, 59–71. https://doi.org/10.1145/3582016.3582030
[19]
Dominik Janzing, Pawel Wocjan, and Thomas Beth. 2003. Identity check is QMA-complete. https://doi.org/10.48550/ARXIV.QUANT-PH/0305050
[20]
Hanru Jiang. 2024. PLDI2024 Artifact: Qubit Recycling Revisited. https://doi.org/10.5281/zenodo.10721283
[21]
A. B. Kahn. 1962. Topological Sorting of Large Networks. Commun. ACM, 5, 11 (1962), nov, 558–562. issn:0001-0782 https://doi.org/10.1145/368996.369025
[22]
Aleks Kissinger and John van de Wetering. 2020. PyZX: Large Scale Automated Diagrammatic Reasoning. Electronic Proceedings in Theoretical Computer Science, 318 (2020), May, 229–241. https://doi.org/10.4204/eptcs.318.14
[23]
Elena Di Lavore and Paweł Sobociński. 2023. Monoidal Width. arxiv:2212.13229.
[24]
Xavier Leroy. 2009. Formal Verification of a Realistic Compiler. Commun. ACM, 52, 7 (2009), Jul, 107–115. issn:0001-0782 https://doi.org/10.1145/1538788.1538814
[25]
Zhengwei Liu, Alex Wozniakowski, and Arthur M. Jaffe. 2017. Quon 3D language for quantum information. Proceedings of the National Academy of Sciences, 114, 10 (2017), 2497–2502. https://doi.org/10.1073/pnas.1621345114 arxiv:https://www.pnas.org/doi/pdf/10.1073/pnas.1621345114.
[26]
Yunseong Nam, Neil J. Ross, Yuan Su, Andrew M. Childs, and Dmitri Maslov. 2018. Automated optimization of large quantum circuits with continuous parameters. npj Quantum Information, 4, 1 (2018), 23. isbn:2056-6387 https://doi.org/10.1038/s41534-018-0072-4
[27]
Alexandru Paler, Robert Wille, and Simon J. Devitt. 2016. Wire recycling for quantum circuit optimization. Phys. Rev. A, 94 (2016), Oct, 042337. https://doi.org/10.1103/PhysRevA.94.042337
[28]
Alex Parent, Martin Roetteler, and Krysta M. Svore. 2015. Reversible circuit compilation with space constraints. arxiv:1510.00377.
[29]
Daniel Patterson and Amal Ahmed. 2019. The next 700 Compiler Correctness Theorems (Functional Pearl). Proc. ACM Program. Lang., 3, ICFP (2019), Article 85, Jul, 29 pages. https://doi.org/10.1145/3341689
[30]
John Preskill. 2018. Quantum Computing in the NISQ era and beyond. Quantum, 2 (2018), Aug., 79. issn:2521-327X https://doi.org/10.22331/q-2018-08-06-79
[31]
Robert Rand, Jennifer Paykin, Dong-Ho Lee, and Steve Zdancewic. 2018. ReQWIRE: Reasoning about Reversible Quantum Circuits. In Proceedings 15th International Conference on Quantum Physics and Logic, QPL 2018, Halifax, Canada, 3-7th June 2018, Peter Selinger and Giulio Chiribella (Eds.) (EPTCS, Vol. 287). 299–312. https://doi.org/10.4204/EPTCS.287.17
[32]
Silvain Rideau and Xavier Leroy. 2010. Validating Register Allocation and Spilling. In Compiler Construction, 19th International Conference, CC 2010, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2010, Paphos, Cyprus, March 20-28, 2010. Proceedings, Rajiv Gupta (Ed.) (Lecture Notes in Computer Science, Vol. 6011). Springer, 224–243. https://doi.org/10.1007/978-3-642-11970-5_13
[33]
Movahhed Sadeghi, Soheil Khadirsharbiyani, and Mahmut Taylan Kandemir. 2022. Quantum Circuit Resizing. arxiv:2301.00720.
[34]
Peter Selinger. 2004. Towards a Quantum Programming Language. Mathematical. Structures in Comp. Sci., 14, 4 (2004), aug, 527–586. issn:0960-1295 https://doi.org/10.1017/S0960129504004256
[35]
Peter Selinger. 2005. Dagger Compact Closed Categories and Completely Positive Maps: (Extended Abstract). In Proceedings of the 3rd International Workshop on Quantum Programming Languages, QPL 2005, DePaul University, Chicago, USA, June 30 - July 1, 2005, Peter Selinger (Ed.) (Electronic Notes in Theoretical Computer Science, Vol. 170). Elsevier, 139–163. https://doi.org/10.1016/j.entcs.2006.12.018
[36]
Runzhou Tao, Yunong Shi, Jianan Yao, Xupeng Li, Ali Javadi-Abhari, Andrew W. Cross, Frederic T. Chong, and Ronghui Gu. 2022. Giallar: push-button verification for the qiskit Quantum compiler. In PLDI ’22: 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, San Diego, CA, USA, June 13 - 17, 2022, Ranjit Jhala and Isil Dillig (Eds.). ACM, 641–656. https://doi.org/10.1145/3519939.3523431
[37]
Sid Ahmed Ali Touati. 2005. On the Optimality of Register Saturation. Electron. Notes Theor. Comput. Sci., 132, 1 (2005), 131–148. https://doi.org/10.1016/j.entcs.2005.01.033
[38]
John Wiegley. 2022. An axiom-free formalization of category theory in Coq. https://github.com/jwiegley/category-theory. Version 1.0.0
[39]
H.S. Wilf. 1997. On Crossing Numbers, and some Unsolved Problems. Cambridge University Press, 557–562. https://doi.org/10.1017/CBO9780511662034.049
[40]
Robert Wille, Daniel Groß e, Lisa Teuber, Gerhard W. Dueck, and Rolf Drechsler. 2008. RevLib: An Online Resource for Reversible Functions and Reversible Circuits. In 38th IEEE International Symposium on Multiple-Valued Logic (ISMVL 2008), 22-23 May 2008, Dallas, Texas, USA. IEEE Computer Society, 220–225. https://doi.org/10.1109/ISMVL.2008.43

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 8, Issue PLDI
June 2024
2198 pages
EISSN:2475-1421
DOI:10.1145/3554317
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 June 2024
Published in PACMPL Volume 8, Issue PLDI

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Certified Compilation
  2. Complexity
  3. Quantum Circuit Optimization

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 286
    Total Downloads
  • Downloads (Last 12 months)286
  • Downloads (Last 6 weeks)82
Reflects downloads up to 01 Nov 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media