Abstract
As quantum computing evolves, many important questions emerge, such as how best to represent quantum programs, and how to promote interoperability between quantum program analysis tools. These questions arise naturally in the design of quantum transpilers, which translate between quantum programming languages. In this paper, we take a step towards answering these questions by identifying challenges and best practices in quantum transpiler design. We base these recommendations on our experience designing LinguaQuanta, a quantum transpiler between Quipper and OpenQASM. First, we provide categorical specifications for quantum transpilers, which aim to encapsulate the core principles of the UNIX philosophy. We then identify quantum circuit decompositions which we expect to be useful in quantum transpilation. With these foundations in place, we then discuss challenges faced during the implementation of LinguaQuanta, such as ancilla management and stability under round translation. To show that LinguaQuanta works in practice, a short tutorial is given for the example of quantum phase estimation. We conclude with recommendations for the future of LinguaQuanta, and for quantum software development tools more broadly.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Quipper also offers an imperative interface to these functional primitives.
- 2.
- 3.
The LSC requires that all qubits (resp. cbits) appear as a single array.
References
Amy, M., Maslov, D., Mosca, M., Roetteler, M.: A meet-in-the-middle algorithm for fast synthesis of depth-optimal quantum circuits. Trans. Comput.-Aided Des. Integr. Circuits Syst. 32(6), 818–830 (2013)
Axler, S.: Linear Algebra Done Right, 3rd edn. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-11080-6
Baksalary, O.M., Trenkler, G.: The Moore-Penrose inverse: a hundred years on a frontline of physics research. Eur. Phys. J. H 46, 2102–6467 (2021)
Barenco, A., et al.: Elementary gates for quantum computation. Phys. Rev. A 52, 3457–3467 (1995)
Bichsel, B., Baader, M., Gehr, T., Vechev, M.: Silq: a high-level quantum language with safe uncomputation and intuitive semantics. In: PLDI, pp. 286–300. ACM (2020)
Choi, C.Q.: An IBM quantum computer will soon pass the 1,000-qubit mark. IEEE Spectrum (2022). Accessed 12 June 2022
Circ (2023). https://quantumai.google/cirq. Accessed 13 June 2022
Clement, A., Heurtel, N., Mansfield, S., Perdrix, S., Valiron, B.: A complete equational theory for quantum circuits. In: LICS, pp. 1–13 (2023)
Coppersmith, D.: An approximate Fourier transform useful in quantum factoring. Technical report RC19642, IBM, 1994
Crooks, G.E.: Gates, states, and circuits. Technical report 014, Berkeley Institute for the Theoretical Sciences, 2022
Cross, A.W., Bishop, L.S., Smolin, J.A., Gambetta, J.M.: Open quantum assembly language, 2017
Cross, A., et al.: OpenQASM 3: a broader and deeper quantum assembly language. ACM Trans. Quantum Comput. 3(3) (2022)
Giles, B., Selinger, P.: Exact synthesis of multiqubit Clifford+\(T\) circuits. Phys. Rev. A 87, 032332 (2013)
Grebenshchikov, S., Lopes, N.P., Popeea, C., Rybalchenko, A.: Synthesizing software verifiers from proof rules. In: PLDI, pp. 405–416. ACM (2012)
Green, A.S., Lumsdaine, P.L.F., Ross, N.J., Selinger, P., Valiron, B.: An introduction to quantum programming in Quipper. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 110–124. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38986-3_10
Green, A.S., Lumsdaine, P.L., Ross, N.J., Selinger, P., Valiron, B.: Quipper: a scalable quantum programming language. SIGPLAN Not. 48(6), 333–342 (2013)
Kissinger, A., van der Wetering, J.: PyZX: large scale automated diagrammatic reasoning. EPTCS 318, 230–242 (2020)
Kissinger, A., Zamdzhiev, V.: Quantomatic: a proof assistant for diagrammatic reasoning. In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 326–336. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_22
Kitaev, A.: Quantum measurements and the abelian stabilizer problem, 1995
Kornell, A., Selinger, P.: Some improvements to product formula circuits for Hamiltonian simulation, 2023
Mac Lane, S.: Categories for the Working Mathematician. Springer, New York (2010). https://doi.org/10.1007/978-1-4757-4721-8
Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis & transformation. In: CGO, pp. 75–88. IEEE (2004)
LeBlond, T., Dean, C., Watkins, G., Bennink, R.S.: Realistic cost to execute practical quantum circuits using direct Clifford+T lattice surgery compilation, 2023
Liskov, B., Zilles, S.: Programming with abstract data types. SIGPLAN Not. 9(4), 50–59 (1974)
Mandelbaum, R.: Five years ago today, we put the first quantum computer on the cloud. Here’s how we did it. IBM Blog (2021). Accessed 12 June 2022
McClean, J.R., et al.: OpenFermion: the electronic structure package for quantum computers. Quantum Sci. Technol. 5(3), 034014 (2020)
McIlroy, M.D., Pinson, E.N., Tague, B.A.: UNIX time-sharing system: foreword. Bell Syst. Tech. J. 57(6), 1899–1904 (1978)
Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2011)
Ross, N.J.: The dawn of quantum programming. Quantum Views 2, 4 (2018)
Ross, N.J., Selinger, P.: Optimal ancilla-free Clifford+\(T\) approximation of z-rotations. Quantum Inf. Comput. 16(11–12), 901–953 (2016)
Salus, P.: A Quarter Century of UNIX. Addison-Wesley Professional, Boston (1994)
Selinger, P.: A survey of graphical languages for monoidal categories. In: Coecke, B. (eds.) New Structures for Physics. Lecture Notes in Physics, LNCS, vol. 813, pp. 289–355. Springer, Berlin, Heidelberg (2010). https://doi.org/10.1007/978-3-642-12821-9_4
Selinger, P.: Quantum circuits of \(T\)-depth one. Phys. Rev. A 87, 042302 (2013)
Selinger, P.: The Quipper System (2014). https://www.mathstat.dal.ca/~selinger/quipper/doc/. Accessed 06 June 2023
Seward, J., Nethercote, N.: Using Valgrind to detect undefined value errors with bit-precision. In: USENIX ATC, pp. 17–30. USENIX Assoc. (2005)
Sleator, T., Weinfurter, H.: Realizable universal quantum logic gates. Phys. Rev. Let. 74(20), 4087–4090 (1995)
Microsoft Azure Quantum Team. Announcing the Microsoft quantum development kit (2017). https://cloudblogs.microsoft.com/. Accessed 01 July 2023
Watkins, G., et al.: A high performance compiler for very large scale surface code computations, 2023
Wesley, S.: LinguaQuanta: towards a quantum transpiler between OpenQASM and Quipper (extended), 2024
Acknowledgements
We would like to thank Xiaoning Bian for his help during the early development stages of LinguaQuanta, and Peter Selinger for his perspectives on the categorical specification of LinguaQuanta. This research was sponsored in part by the United States Defense Advanced Research Projects Agency (DARPA) under the Quantum Benchmarking program, contract # HR001122C0066.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Wesley, S. (2024). LinguaQuanta: Towards a Quantum Transpiler Between OpenQASM and Quipper. In: Mogensen, T.Æ., Mikulski, Ł. (eds) Reversible Computation. RC 2024. Lecture Notes in Computer Science, vol 14680. Springer, Cham. https://doi.org/10.1007/978-3-031-62076-8_10
Download citation
DOI: https://doi.org/10.1007/978-3-031-62076-8_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-62075-1
Online ISBN: 978-3-031-62076-8
eBook Packages: Computer ScienceComputer Science (R0)