Skip to main content

LinguaQuanta: Towards a Quantum Transpiler Between OpenQASM and Quipper

  • Conference paper
  • First Online:
Reversible Computation (RC 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14680))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Quipper also offers an imperative interface to these functional primitives.

  2. 2.

    https://github.com/onestruggler/qasm-quipper.

  3. 3.

    The LSC requires that all qubits (resp. cbits) appear as a single array.

References

  1. 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)

    Google Scholar 

  2. Axler, S.: Linear Algebra Done Right, 3rd edn. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-11080-6

  3. 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)

    Google Scholar 

  4. Barenco, A., et al.: Elementary gates for quantum computation. Phys. Rev. A 52, 3457–3467 (1995)

    Article  Google Scholar 

  5. 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)

    Google Scholar 

  6. Choi, C.Q.: An IBM quantum computer will soon pass the 1,000-qubit mark. IEEE Spectrum (2022). Accessed 12 June 2022

    Google Scholar 

  7. Circ (2023). https://quantumai.google/cirq. Accessed 13 June 2022

  8. Clement, A., Heurtel, N., Mansfield, S., Perdrix, S., Valiron, B.: A complete equational theory for quantum circuits. In: LICS, pp. 1–13 (2023)

    Google Scholar 

  9. Coppersmith, D.: An approximate Fourier transform useful in quantum factoring. Technical report RC19642, IBM, 1994

    Google Scholar 

  10. Crooks, G.E.: Gates, states, and circuits. Technical report 014, Berkeley Institute for the Theoretical Sciences, 2022

    Google Scholar 

  11. Cross, A.W., Bishop, L.S., Smolin, J.A., Gambetta, J.M.: Open quantum assembly language, 2017

    Google Scholar 

  12. Cross, A., et al.: OpenQASM 3: a broader and deeper quantum assembly language. ACM Trans. Quantum Comput. 3(3) (2022)

    Google Scholar 

  13. Giles, B., Selinger, P.: Exact synthesis of multiqubit Clifford+\(T\) circuits. Phys. Rev. A 87, 032332 (2013)

    Article  Google Scholar 

  14. Grebenshchikov, S., Lopes, N.P., Popeea, C., Rybalchenko, A.: Synthesizing software verifiers from proof rules. In: PLDI, pp. 405–416. ACM (2012)

    Google Scholar 

  15. 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

    Chapter  Google Scholar 

  16. 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)

    Google Scholar 

  17. Kissinger, A., van der Wetering, J.: PyZX: large scale automated diagrammatic reasoning. EPTCS 318, 230–242 (2020)

    Article  MathSciNet  Google Scholar 

  18. 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

    Chapter  Google Scholar 

  19. Kitaev, A.: Quantum measurements and the abelian stabilizer problem, 1995

    Google Scholar 

  20. Kornell, A., Selinger, P.: Some improvements to product formula circuits for Hamiltonian simulation, 2023

    Google Scholar 

  21. Mac Lane, S.: Categories for the Working Mathematician. Springer, New York (2010). https://doi.org/10.1007/978-1-4757-4721-8

  22. Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis & transformation. In: CGO, pp. 75–88. IEEE (2004)

    Google Scholar 

  23. LeBlond, T., Dean, C., Watkins, G., Bennink, R.S.: Realistic cost to execute practical quantum circuits using direct Clifford+T lattice surgery compilation, 2023

    Google Scholar 

  24. Liskov, B., Zilles, S.: Programming with abstract data types. SIGPLAN Not. 9(4), 50–59 (1974)

    Article  Google Scholar 

  25. 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

    Google Scholar 

  26. McClean, J.R., et al.: OpenFermion: the electronic structure package for quantum computers. Quantum Sci. Technol. 5(3), 034014 (2020)

    Google Scholar 

  27. McIlroy, M.D., Pinson, E.N., Tague, B.A.: UNIX time-sharing system: foreword. Bell Syst. Tech. J. 57(6), 1899–1904 (1978)

    Article  Google Scholar 

  28. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2011)

    Google Scholar 

  29. Ross, N.J.: The dawn of quantum programming. Quantum Views 2, 4 (2018)

    Article  Google Scholar 

  30. Ross, N.J., Selinger, P.: Optimal ancilla-free Clifford+\(T\) approximation of z-rotations. Quantum Inf. Comput. 16(11–12), 901–953 (2016)

    MathSciNet  Google Scholar 

  31. Salus, P.: A Quarter Century of UNIX. Addison-Wesley Professional, Boston (1994)

    Google Scholar 

  32. 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

  33. Selinger, P.: Quantum circuits of \(T\)-depth one. Phys. Rev. A 87, 042302 (2013)

    Article  Google Scholar 

  34. Selinger, P.: The Quipper System (2014). https://www.mathstat.dal.ca/~selinger/quipper/doc/. Accessed 06 June 2023

  35. Seward, J., Nethercote, N.: Using Valgrind to detect undefined value errors with bit-precision. In: USENIX ATC, pp. 17–30. USENIX Assoc. (2005)

    Google Scholar 

  36. Sleator, T., Weinfurter, H.: Realizable universal quantum logic gates. Phys. Rev. Let. 74(20), 4087–4090 (1995)

    Article  MathSciNet  Google Scholar 

  37. Microsoft Azure Quantum Team. Announcing the Microsoft quantum development kit (2017). https://cloudblogs.microsoft.com/. Accessed 01 July 2023

  38. Watkins, G., et al.: A high performance compiler for very large scale surface code computations, 2023

    Google Scholar 

  39. Wesley, S.: LinguaQuanta: towards a quantum transpiler between OpenQASM and Quipper (extended), 2024

    Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Scott Wesley .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics