Automatic accuracy management of quantum programs via (near-)symbolic resource estimation

When compiling programs for fault-tolerant quantum computers, approximation errors must be taken into account. We propose a methodology that tracks such errors automatically and solves the optimization problem of finding accuracy parameters that guarantee a specified overall accuracy while aiming to minimize a custom implementation cost. The core idea is to extract constraint and cost functions directly from the high-level description of the quantum program. Then, our 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 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.

[1]  Mingsheng Ying Hoare Logic for Quantum Programs , 2009 .

[2]  Ryan Babbush,et al.  Exponentially more precise quantum simulation of fermions in the configuration interaction representation , 2015, 1506.01029.

[3]  David Brumley,et al.  Enhancing symbolic execution with veritesting , 2014, ICSE.

[4]  Viktor Kuncak,et al.  Sound compilation of reals , 2013, POPL.

[5]  Alexei Y. Kitaev,et al.  Quantum measurements and the Abelian Stabilizer Problem , 1995, Electron. Colloquium Comput. Complex..

[6]  D. Coppersmith An approximate Fourier transform useful in quantum factoring , 2002, quant-ph/0201067.

[7]  Kristan Temme,et al.  Supervised learning with quantum-enhanced feature spaces , 2018, Nature.

[8]  Frederic T. Chong,et al.  QuRE: The Quantum Resource Estimator toolbox , 2013, 2013 IEEE 31st International Conference on Computer Design (ICCD).

[9]  M. Mosca,et al.  A Meet-in-the-Middle Algorithm for Fast Synthesis of Depth-Optimal Quantum Circuits , 2012, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[10]  Pavel Panchekha,et al.  Automatically improving accuracy for floating point expressions , 2015, PLDI.

[11]  Shaopeng Zhu,et al.  Quantitative robustness analysis of quantum programs , 2018, Proc. ACM Program. Lang..

[12]  Alán Aspuru-Guzik,et al.  Quantum computational chemistry , 2018, Reviews of Modern Physics.

[13]  Krysta Marie Svore,et al.  Repeat-until-success: non-deterministic decomposition of single-qubit unitaries , 2013, Quantum Inf. Comput..

[14]  Earl T. Campbell,et al.  Unified framework for magic state distillation and multiqubit gate synthesis with reduced resource cost , 2016, 1606.01904.

[15]  M. Mariantoni,et al.  Surface codes: Towards practical large-scale quantum computation , 2012, 1208.0928.

[16]  Zhendong Su,et al.  Automatic detection of floating-point exceptions , 2013, POPL.

[17]  Benoît Valiron,et al.  Concrete resource analysis of the quantum linear-system algorithm used to compute the electromagnetic scattering cross section of a 2D target , 2015, Quantum Inf. Process..

[18]  David McKinnon,et al.  Exact synthesis of single-qubit unitaries over Clifford-cyclotomic gate sets , 2015, 1501.04944.

[19]  A. Kitaev,et al.  Universal quantum computation with ideal Clifford gates and noisy ancillas (14 pages) , 2004, quant-ph/0403025.

[20]  David Poulin,et al.  The Trotter step size required for accurate quantum simulation of quantum chemistry , 2014, Quantum Inf. Comput..

[21]  Peter W. Shor,et al.  Algorithms for quantum computation: discrete logarithms and factoring , 1994, Proceedings 35th Annual Symposium on Foundations of Computer Science.

[22]  Gilles Brassard,et al.  Quantum cryptography: Public key distribution and coin tossing , 2014, Theor. Comput. Sci..

[23]  Stéphane Beauregard Circuit for Shor's algorithm using 2n+3 qubits , 2003, Quantum Inf. Comput..

[24]  M. Troyer,et al.  Elucidating reaction mechanisms on quantum computers , 2016, Proceedings of the National Academy of Sciences.

[25]  E. Knill,et al.  Conventions for quantum pseudocode , 1996, 2211.02559.

[26]  Martin Rötteler,et al.  Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL , 2018, RWDSL2018.

[27]  Sylvie Boldo,et al.  Kahan's Algorithm for a Correct Discriminant Computation at Last Formally Proven , 2009, IEEE Transactions on Computers.

[28]  Thomas G. Draper Addition on a Quantum Computer , 2000, quant-ph/0008033.

[29]  G. Vallone,et al.  Advances in Quantum Cryptography , 2019, 1906.01645.

[30]  Margaret Martonosi,et al.  ScaffCC: a framework for compilation and analysis of quantum computing programs , 2014, Conf. Computing Frontiers.

[31]  I. Chuang,et al.  Hamiltonian Simulation by Qubitization , 2016, Quantum.

[32]  Benoît Valiron,et al.  Quipper: a scalable quantum programming language , 2013, PLDI.

[33]  Thierry Paul,et al.  Quantum computation and quantum information , 2007, Mathematical Structures in Computer Science.

[34]  Martin Rötteler,et al.  Managing approximation errors in quantum programs , 2018, ArXiv.

[35]  Matthias Troyer,et al.  ProjectQ: An Open Source Software Framework for Quantum Computing , 2016, ArXiv.