Acta Informatica

, Volume 41, Issue 7–8, pp 435–474 | Cite as

Compiling quantum programs

  • Paolo Zuliani


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.


Data Structure Computational Mathematic Programming Language General Framework Quantum Computation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Barenco, A.: A universal two-bit gate for quantum computation. Proc. Roy. Soc. Lond. A 449, 679–683 (1995)Google Scholar
  2. 2.
    Barenco, A. et al.: Elementary gates for quantum computation. Phys. Rev. A 52(5), 3457–3467 (1995)CrossRefPubMedGoogle Scholar
  3. 3.
    Beckman, D., Chari, A., Devabhaktuni, S., Preskill, J.: Efficient networks for quantum factoring. Phys. Rev. A 54(2), 1034 (1996)CrossRefPubMedGoogle Scholar
  4. 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. 5.
    Deutsch, D.: Quantum computational networks. Proc. Roy. Soc. Lond. A 425, 73–90 (1989)Google Scholar
  6. 6.
    Deutsch, D., Barenco, A., Ekert, A.: Universality in quantum computation. Proc. Roy. Soc. Lond. A 449, 669–677 (1995)Google Scholar
  7. 7.
    Dijkstra, E.W.: Guarded commands, nondeterminacy and the formal derivation of programs. CACM 18, 453–457 (1975)Google Scholar
  8. 8.
    Feynman, R.P.: Simulating physics with computers. Int. J. Theor. Phys. 21(6/7), 467–488 (1982)MathSciNetGoogle Scholar
  9. 9.
    Feynman, R.P.: Quantum mechanical computers. Found. Phys. 16(6), 507–531 (1986)CrossRefGoogle Scholar
  10. 10.
    Hoare, C., Jifeng, H., Sampaio, A.: Normal form approach to compiler design. Acta Inform. 30, 701–739 (1993)CrossRefGoogle Scholar
  11. 11.
    Isham, C.J.: Lectures on Quantum Theory. Imperial College Press, London (1997)Google Scholar
  12. 12.
    Jifeng, H., McIver, A., Seidel, K.: Probabilistic models for the guarded command language. Sci. Comput. Progr. 28, 171–192 (1997)CrossRefGoogle Scholar
  13. 13.
    McIver, A., Morgan, C.: Partial correctness for probabilistic demonic programs. Technical report, Oxford University Computing Laboratory. Acta Inform. (in press)Google Scholar
  14. 14.
    Mitchison, G., Jozsa, R.: Counterfactual computation. Proc. Roy. Soc. Lond. A 457, 1175–1193 (2001)Google Scholar
  15. 15.
    Morgan, C.: Programming from Specifications. Prentice-Hall, Englewood Cliffs, NJ (1994)Google Scholar
  16. 16.
    Morgan, C., McIver, A.: pGCL: formal reasoning for random algorithms. South African Comput. J. 22, 14–27 (1999)Google Scholar
  17. 17.
    Morgan, C., McIver, A., Seidel, K.: Probabilistic predicate transformers. ACM Trans. Progr. Lang. Sys. 18(3), 325–353 (1996)CrossRefGoogle Scholar
  18. 18.
    Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2000)Google Scholar
  19. 19.
    Page, I.: Constructing hardware-software systems from a single description. J. VLSI Signal Process. 12(1), 87–107 (1996)CrossRefGoogle Scholar
  20. 20.
    Reed, M., Simon, B.: Methods of Mathematical Physics. I: Functional Analysis. Acamedic, New York (1972)Google Scholar
  21. 21.
    Sanders, J.W., Zuliani, P.: Quantum Programming. Math. Progr. Construct. Springer LNCS 1837, 80–99 (2000)Google Scholar
  22. 22.
    Schumacher, B.: Quantum coding. Phys. Rev. A 51(4), 2738–2747 (1995)CrossRefPubMedGoogle Scholar
  23. 23.
    von Neumann, J.: Mathematical Foundations of Quantum Mechanics. Princeton University Press, Princeton, NJ (1955)Google Scholar
  24. 24.
    Wootters, W.K., Zurek, W.H.: A single quantum cannot be cloned. Nature 299(5886), 802–803 (1982)CrossRefGoogle Scholar
  25. 25.
    Yokonuma, T.: Tensor Spaces and Exterior Algebra. American Mathematical Society, Providence, RI (1992)Google Scholar
  26. 26.
    Zuliani, P.: Formal reasoning for quantum mechanical nonlocality. Technical Report RR-01-05, Oxford University Computing Laboratory (in press). Available at
  27. 27.
    Zuliani, P.: Logical reversibility. IBM J. Res. Dev. 45(6), 807–818 (2001)Google Scholar
  28. 28.
    Zuliani, P.: Quantum Programming. PhD Thesis, Oxford University Computing Laboratory (2001). Available at

Copyright information

© Springer-Verlag 2005

Authors and Affiliations

  1. 1.Department of Computer SciencePrinceton UniversityPrincetonUSA

Personalised recommendations