Skip to main content
Log in

Compiling quantum programs

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

In this paper we study a possible compiler for a high-level imperative programming language for quantum computation, the quantum Guarded-Command Language (qGCL). It is important because it liberates us from thinking of quantum algorithms at the data-flow level, in the same way as happened for standard computation a few decades ago.

We make use of the normal-form approach to compiler design, introduced by Hoare, Jifeng and Sampaio. In this approach a source program is transformed, by means of algebraic manipulations, into a particular form which can be directly executed by a target machine. This entails the definition of a simple quantum hardware architecture, derived from Hoare et al.’s computing model.

Our work provides a general framework for the construction of a compiler for qGCL, focusing mainly on the correctness of the design. Here we do not deal with other topics such as efficiency of compiled code, factorisation of unitary transformations and compilation of quantum data structures.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Barenco, A.: A universal two-bit gate for quantum computation. Proc. Roy. Soc. Lond. A 449, 679–683 (1995)

    Google Scholar 

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

    Article  PubMed  Google Scholar 

  3. Beckman, D., Chari, A., Devabhaktuni, S., Preskill, J.: Efficient networks for quantum factoring. Phys. Rev. A 54(2), 1034 (1996)

    Article  PubMed  Google Scholar 

  4. Bowen, J., Jifeng, H., Page, I.: Hardware compilation. In: Bowen, J. (ed.), Towards Verified Systems, Chap. 10, pp. 193–207. Elsevier, Amsterdam (1994)

    Google Scholar 

  5. Deutsch, D.: Quantum computational networks. Proc. Roy. Soc. Lond. A 425, 73–90 (1989)

    Google Scholar 

  6. Deutsch, D., Barenco, A., Ekert, A.: Universality in quantum computation. Proc. Roy. Soc. Lond. A 449, 669–677 (1995)

    Google Scholar 

  7. Dijkstra, E.W.: Guarded commands, nondeterminacy and the formal derivation of programs. CACM 18, 453–457 (1975)

    Google Scholar 

  8. Feynman, R.P.: Simulating physics with computers. Int. J. Theor. Phys. 21(6/7), 467–488 (1982)

    MathSciNet  Google Scholar 

  9. Feynman, R.P.: Quantum mechanical computers. Found. Phys. 16(6), 507–531 (1986)

    Article  Google Scholar 

  10. Hoare, C., Jifeng, H., Sampaio, A.: Normal form approach to compiler design. Acta Inform. 30, 701–739 (1993)

    Article  Google Scholar 

  11. Isham, C.J.: Lectures on Quantum Theory. Imperial College Press, London (1997)

    Google Scholar 

  12. Jifeng, H., McIver, A., Seidel, K.: Probabilistic models for the guarded command language. Sci. Comput. Progr. 28, 171–192 (1997)

    Article  Google Scholar 

  13. McIver, A., Morgan, C.: Partial correctness for probabilistic demonic programs. Technical report, Oxford University Computing Laboratory. Acta Inform. (in press)

  14. Mitchison, G., Jozsa, R.: Counterfactual computation. Proc. Roy. Soc. Lond. A 457, 1175–1193 (2001)

    Google Scholar 

  15. Morgan, C.: Programming from Specifications. Prentice-Hall, Englewood Cliffs, NJ (1994)

    Google Scholar 

  16. Morgan, C., McIver, A.: pGCL: formal reasoning for random algorithms. South African Comput. J. 22, 14–27 (1999)

    Google Scholar 

  17. Morgan, C., McIver, A., Seidel, K.: Probabilistic predicate transformers. ACM Trans. Progr. Lang. Sys. 18(3), 325–353 (1996)

    Article  Google Scholar 

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

    Google Scholar 

  19. Page, I.: Constructing hardware-software systems from a single description. J. VLSI Signal Process. 12(1), 87–107 (1996)

    Article  Google Scholar 

  20. Reed, M., Simon, B.: Methods of Mathematical Physics. I: Functional Analysis. Acamedic, New York (1972)

    Google Scholar 

  21. Sanders, J.W., Zuliani, P.: Quantum Programming. Math. Progr. Construct. Springer LNCS 1837, 80–99 (2000)

    Google Scholar 

  22. Schumacher, B.: Quantum coding. Phys. Rev. A 51(4), 2738–2747 (1995)

    Article  PubMed  Google Scholar 

  23. von Neumann, J.: Mathematical Foundations of Quantum Mechanics. Princeton University Press, Princeton, NJ (1955)

    Google Scholar 

  24. Wootters, W.K., Zurek, W.H.: A single quantum cannot be cloned. Nature 299(5886), 802–803 (1982)

    Article  Google Scholar 

  25. Yokonuma, T.: Tensor Spaces and Exterior Algebra. American Mathematical Society, Providence, RI (1992)

    Google Scholar 

  26. Zuliani, P.: Formal reasoning for quantum mechanical nonlocality. Technical Report RR-01-05, Oxford University Computing Laboratory (in press). Available at http://web.comlab.ox.ac.uk/oucl/research/areas/probs/bibliography.html

  27. Zuliani, P.: Logical reversibility. IBM J. Res. Dev. 45(6), 807–818 (2001)

    Google Scholar 

  28. Zuliani, P.: Quantum Programming. PhD Thesis, Oxford University Computing Laboratory (2001). Available at http://www.comlab.ox.ac.uk

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paolo Zuliani.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zuliani, P. Compiling quantum programs. Acta Informatica 41, 435–474 (2005). https://doi.org/10.1007/s00236-005-0165-3

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-005-0165-3

Keywords

Navigation