Abstract
Approximation errors must be taken into account when compiling quantum programs into a low-level gate set. We present a methodology that tracks such errors automatically and then optimizes accuracy parameters to guarantee a specified overall accuracy while aiming to minimize the implementation cost in terms of quantum gates. The core idea of our approach is to extract functions that specify the optimization problem directly from the high-level description of the quantum program. Then, custom compiler passes optimize these functions, turning them into (near-)symbolic expressions for (1) the total error and (2) the implementation cost (e.g., total quantum gate count). All unspecified parameters of the quantum program will show up as variables in these expressions, including accuracy parameters. After solving the corresponding optimization problem, a circuit can be instantiated from the found solution. We develop two prototype implementations, one in C++ based on Clang/LLVM, and another using the Q# compiler infrastructure. We benchmark our prototypes on typical quantum computing programs, including the quantum Fourier transform, quantum phase estimation, and Shor's algorithm.
Supplemental Material
- Gadi Aleksandrowicz and et al. 2019. Qiskit: An Open-source Framework for Quantum Computing. (Jan. 2019 ). https: //doi.org/10.5281/zenodo.2562110 Google Scholar
Cross Ref
- Matthew Amy, Dmitri Maslov, Michele Mosca, and Martin Roetteler. 2013. 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 (Jun 2013 ), 818-830. https://doi.org/10.1109/tcad. 2013.2244643 Google Scholar
Digital Library
- Matthew Amy, Martin Roetteler, and Krysta M. Svore. 2017. Verified Compilation of Space-Eficient Reversible Circuits. In Computer Aided Verification-29th International Conference, CAV. 3-21. https://doi.org/10.1007/978-3-319-63390-9_1 Google Scholar
Cross Ref
- Thanassis Avgerinos, Alexandre Rebert, Sang Kil Cha, and David Brumley. 2014. Enhancing symbolic execution with veritesting. In 36th International Conference on Software Engineering, ICSE ' 14. 1083-1094. https://doi.org/10.1145/2568225. 2568293 Google Scholar
Digital Library
- Ryan Babbush, Dominic W. Berry, Yuval R. Sanders, Ian D. Kivlichan, Artur Scherer, Annie Y. Wei, Peter J. Love, and Alán Aspuru-Guzik. 2017. Exponentially more precise quantum simulation of fermions in the configuration interaction representation. Quantum Science and Technology 3, 1 ( 2017 ), 015006. https://doi.org/10.1088/2058-9565/aa9463 Google Scholar
Cross Ref
- Earl T. Barr, Thanh Vo, Vu Le, and Zhendong Su. 2013. Automatic detection of floating-point exceptions. ACM SIGPLAN Notices 48, 1, 549-560. https://doi.org/10.1145/2480359.2429133 Google Scholar
Digital Library
- Stephane Beauregard. 2002. Circuit for Shor's algorithm using 2n+3 qubits. Quantum information & computation 3 ( 06 2002 ).Google Scholar
- Charles H. Bennett and Gilles Brassard. 2014. Quantum cryptography: Public key distribution and coin tossing. Theoretical Computer Science 560 (dec 2014 ), 7-11. https://doi.org/10.1016/j.tcs. 2014. 05.025 Google Scholar
Digital Library
- Ethan Bernstein and Umesh Vazirani. 1997. Quantum Complexity Theory. SIAM J. Comput. 26, 5 (oct 1997 ), 1411-1473. https://doi.org/10.1137/s0097539796300921 Google Scholar
Digital Library
- S. Boldo. 2009. Kahan's Algorithm for a Correct Discriminant Computation at Last Formally Proven. IEEE Trans. Comput. 58, 2 ( 2009 ), 220-225. https://doi.org/10.1109/tc. 2008.200 Google Scholar
Digital Library
- Sergey Bravyi and Alexei Kitaev. 2005. Universal quantum computation with ideal Cliford gates and noisy ancillas. Physical Review A 71 ( Feb 2005 ), 022316. Issue 2. https://doi.org/10.1103/PhysRevA.71.022316 Google Scholar
Cross Ref
- Earl T. Campbell and Mark Howard. 2017. Unified framework for magic state distillation and multiqubit gate synthesis with reduced resource cost. Physical Review A 95, 2 (Feb 2017 ). https://doi.org/10.1103/physreva.95.022316 Google Scholar
Cross Ref
- John H. Conway and Richard K. Guy. 1996. The Book of Numbers. Springer New York. https://doi.org/10.1007/978-1-4612-4072-3 Google Scholar
Cross Ref
- Don Coppersmith. 2002. An approximate Fourier transform useful in quantum factoring. arXiv:quant-ph/0201067 [quant-ph]Google Scholar
- Eva Darulova and Viktor Kuncak. 2014. Sound compilation of reals. ACM SIGPLAN Notices 49, 1, 235-248. https: //doi.org/10.1145/2578855.2535874 Google Scholar
Digital Library
- Thomas G. Draper. 2000. Addition on a quantum computer. arXiv preprint quant-ph/0008033 ( 2000 ). arXiv:quant-ph/0008033Google Scholar
- Austin G. Fowler, Matteo Mariantoni, John M. Martinis, and Andrew N. Cleland. 2012. Surface codes: Towards practical large-scale quantum computation. Physical Review A 86, 3 (Sep 2012 ). https://doi.org/10.1103/physreva.86.032324 Google Scholar
Cross Ref
- Alexander S. Green, Peter LeFanu Lumsdaine, Neil J. Ross, Peter Selinger, and Benoît Valiron. 2013. Quipper. ACM SIGPLAN Notices 48, 6, 333-342. https://doi.org/10.1145/2499370.2462177 Google Scholar
Digital Library
- Thomas Häner, Martin Roetteler, and Krysta M. Svore. 2018. Managing approximation errors in quantum programs. ( 2018 ). arXiv: 1807.02336 [quant-ph]Google Scholar
- Vojtěch Havlíček, Antonio D. Córcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, and Jay M. Gambetta. 2019. Supervised learning with quantum-enhanced feature spaces. Nature 567, 7747 (Mar 2019 ), 209-212. https://doi.org/10.1038/s41586-019-0980-2 Google Scholar
Cross Ref
- Shih-Han Hung, Kesha Hietala, Shaopeng Zhu, Mingsheng Ying, Michael Hicks, and Xiaodi Wu. 2019. Quantitative robustness analysis of quantum programs. Proceedings of the ACM on Programming Languages 3, POPL ( 2019 ), 31 : 1-31 : 29. https://doi.org/10.1145/3290344 Google Scholar
Digital Library
- Ali Javadi-Abhari, Shruti Patil, Daniel Kudrow, Jef Heckey, Alexey Lvov, Frederic Chong, and Margaret Martonosi. 2014. ScafCC: a framework for compilation and analysis of quantum computing programs. Proceedings of the 11th ACM Conference on Computing Frontiers, CF 2014 (05 2014 ). https://doi.org/10.1145/2597917.2597939 Google Scholar
Digital Library
- Alexei Kitaev. 1995. Quantum measurements and the Abelian Stabilizer Problem. arXiv preprint arXiv:quant-ph/9511026 ( 1995 ). arXiv:quant-ph/9511026 [quant-ph]Google Scholar
- Vadym Kliuchnikov, Dmitri Maslov, and Michele Mosca. 2013. Fast and eficient exact synthesis of single qubit unitaries generated by Cliford and gates. Quantum Information & Computation 13 ( June 2013 ), 607-630.Google Scholar
- E. Knill. 1996. Conventions for quantum pseudocode. Technical Report. https://doi.org/10.2172/366453 Google Scholar
Cross Ref
- Guang Hao Low and Isaac L. Chuang. 2019. Hamiltonian Simulation by Qubitization. Quantum 3 (jul 2019 ), 163. https: //doi.org/10.22331/q-2019-07-12-163 Google Scholar
Cross Ref
- Sam McArdle, Suguru Endo, Alán Aspuru-Guzik, Simon C. Benjamin, and Xiao Yuan. 2020. Quantum computational chemistry. Rev. Mod. Phys. 92 (Mar 2020 ), 015003. Issue 1. https://doi.org/10.1103/RevModPhys.92.015003 Google Scholar
Cross Ref
- Michael A. Nielsen and Isaac L. Chuang. 2000. Quantum Computation and Quantum Information. Cambridge University Press. https://doi.org/10.1017/CBO9780511976667 Google Scholar
Cross Ref
- Adam Paetznick and Krysta M. Svore. 2014. Repeat-until-Success : Non-Deterministic Decomposition of Single-Qubit Unitaries. Quantum Information & Computation 14, 15-16 ( 2014 ), 1277-1301.Google Scholar
Cross Ref
- Pavel Panchekha, Alex Sanchez-Stern, James R. Wilcox, and Zachary Tatlock. 2015. Automatically improving accuracy for lfoating point expressions. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation-PLDI 2015. ACM Press. https://doi.org/10.1145/2737924.2737959 Google Scholar
Digital Library
- Jennifer Paykin, Robert Rand, and Steve Zdancewic. 2017. QWIRE: A Core Language for Quantum Circuits. SIGPLAN Not. 52, 1, 846-858. https://doi.org/10.1145/3093333.3009894 Google Scholar
Digital Library
- Stefano Pirandola, Ulrik L. Andersen, Leonardo Banchi, Mario Berta, Darius Bunandar, Roger Colbeck, Dirk R. Englund, Tobias Gehring, Cosmo Lupo, Carlo Ottaviani, Jason Pereira, Mohsen Razavi, Jesni S. Shaari, Marco Tomamichel, Vladyslav C. Usenko, Giuseppe Vallone, Paolo Villoresi, and Petros Wallden. 2020. Advances in Quantum Cryptography. Advances in Optics and Photonics ( 2020 ). https://doi.org/10.1364/AOP.361502 Google Scholar
Cross Ref
- David Poulin, Matthew B. Hastings, Dave Wecker, Nathan Wiebe, Andrew C. Doberty, and Matthias Troyer. 2015. The Trotter Step Size Required for Accurate Quantum Simulation of Quantum Chemistry. Quantum Information & Computation 15, 5-6 ( 2015 ), 361-384.Google Scholar
- Markus Reiher, Nathan Wiebe, Krysta M. Svore, Dave Wecker, and Matthias Troyer. 2017. Elucidating reaction mechanisms on quantum computers. Proceedings of the National Academy of Sciences 114, 29 ( 2017 ), 7555-7560. https://doi.org/10. 1073/pnas.1619152114 Google Scholar
Cross Ref
- Neil J. Ross and Peter Selinger. 2016. Optimal ancilla-free Cliford+ T approximation of z-rotations. Quantum Information & Computation 16, 11 & 12 ( 2016 ), 901-953.Google Scholar
- Artur Scherer, Benoît Valiron, Siun-Chuon Mau, Scott Alexander, Eric van den Berg, and Thomas E. Chapuran. 2017. Concrete resource analysis of the quantum linear-system algorithm used to compute the electromagnetic scattering cross section of a 2D target. Quantum Information Processing 16, 3 (Jan 2017 ). https://doi.org/10.1007/s11128-016-1495-5 Google Scholar
Digital Library
- Peter W. Shor. 1994. Algorithms for quantum computation: discrete logarithms and factoring. In Proceedings 35th Annual Symposium on Foundations of Computer Science. 124-134. https://doi.org/10.1109/SFCS. 1994.365700 Google Scholar
Digital Library
- Jonathan M. Smith, Neil J. Ross, Peter Selinger, and Benoît Valiron. 2014. Quipper: concrete resource estimation in quantum algorithms. arXiv:1412.0625Google Scholar
- Damian S. Steiger, Thomas Häner, and Matthias Troyer. 2018. ProjectQ: an open source software framework for quantum computing. Quantum 2 ( Jan 2018 ), 49. https://doi.org/10.22331/q-2018-01-31-49 Google Scholar
Cross Ref
- Martin Suchara, John Kubiatowicz, Arvin I. Faruque, Frederic T. Chong, Ching-Yi Lai, and Gerardo Paz. 2013. QuRE: The Quantum Resource Estimator toolbox. In 2013 IEEE 31st International Conference on Computer Design, ICCD 2013. 419-426. https://doi.org/10.1109/ICCD. 2013.6657074 Google Scholar
Cross Ref
- Krysta M. Svore, Alan Geller, Matthias Troyer, John Azariah, Christopher Granade, Bettina Heim, Vadym Kliuchnikov, Mariia Mykhailova, Andres Paz, and Martin Roetteler. 2018. Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL. In Real World Domain Specific Languages Workshop. 7: 1-7 : 10. https://doi.org/10.1145/3183895.3183901 Google Scholar
Digital Library
- John Watrous. 2009. Semidefinite Programs for Completely Bounded Norms. Theory of Computing 5, 11 ( 2009 ), 217-238. https://doi.org/10.4086/toc. 2009.v005a011 Google Scholar
Cross Ref
- Wolfram Research Inc. 2019. Mathematica, Version 12.0. https://www.wolfram.com/mathematica Champaign, IL.Google Scholar
- Mingsheng Ying. 2011. Floyd-hoare logic for quantum programs. ACM Trans. Program. Lang. Syst. 33, 6 ( 2011 ), 19 : 1-19 : 49. https://doi.org/10.1145/2049706.2049708 Google Scholar
Digital Library
Index Terms
Enabling accuracy-aware Quantum compilers using symbolic resource estimation
Recommendations
Visualization of the Quantum Fourier Transform Using a Quantum Computer Simulator
The quantum Fourier transform (QFT) is a key subroutine of quantum algorithms for factoring and simulation and is the heart of the hidden-subgroup problem, the solution of which is expected to lead to the development of new quantum algorithms. The QFT ...
Quantum walks: a comprehensive review
Quantum walks, the quantum mechanical counterpart of classical random walks, is an advanced tool for building quantum algorithms that has been recently shown to constitute a universal model of quantum computation. Quantum walks is now a solid field of ...
Quantum entanglement as a new information processing resource
AbstractQuantum entanglement, a special correlation that can exist between subsystems of quantum multipartite systems, is increasingly seen as one of the most specific physical resources of quantum world. It is a resource that is not only behind the fact ...






Comments