## A functional quantum programming language (2005)

### Cached

### Download Links

Venue: | In: Proceedings of the 20th Annual IEEE Symposium on Logic in Computer Science |

Citations: | 47 - 12 self |

### BibTeX

@INPROCEEDINGS{Grattage05afunctional,

author = {Jonathan James Grattage and James Chapman and Alex Green and Mark Jago and Wouter Swierstra and Mauro Jaskelioff},

title = {A functional quantum programming language},

booktitle = {In: Proceedings of the 20th Annual IEEE Symposium on Logic in Computer Science},

year = {2005},

pages = {249--258}

}

### OpenURL

### Abstract

This thesis introduces the language QML, a functional language for quantum computations on finite types. QML exhibits quantum data and control structures, and integrates reversible and irreversible quantum computations. The design of QML is guided by the categorical semantics: QML programs are in-terpreted by morphisms in the category FQC of finite quantum computations, which provides a constructive operational semantics of irreversible quantum computations, realisable as quantum circuits. The quantum circuit model is also given a formal categorical definition via the category FQC. QML integrates reversible and irreversible quantum computations in one language, using first order strict linear logic to make weakenings, which may lead to the collapse of the quantum wavefunction, explicit. Strict programs are free from measurement, and hence preserve superpositions and entanglement. A denotational semantics of QML programs is presented, which maps QML terms

### Citations

3188 | A method for obtaining digital signatures and public-key cryptosystems
- Rivest, Shamir, et al.
- 1977
(Show Context)
Citation Context .... For this reason, factorisation, and related problems such as discrete logarithms and order finding problems, have been the basis of many modern cryptosystems, including the widely used RSA protocol =-=[63]-=-. Shor’s factoring result means that by exploiting quantum mechanics, a quantum computer could decipher any secret message that was encrypted using certain popular cryptographic methods in only polyno... |

1512 |
Quantum computation and quantum information
- Nielsen, Chuang
- 2000
(Show Context)
Citation Context ...n [34]: “I think I can safely say that no one understands quantum mechanics” 1.4 Quantum programming Quantum programming is now a firmly established field, with many introductory text books available =-=[33, 36, 53, 57]-=-, and Preskill’s online course notes [58]. However, quantum programs are usually presented in a semi-formal style and on a very low level, usually as families of quantum circuits. This is demonstrated... |

1353 | Introduction to Functional Programming
- Bird, Wadler
- 1988
(Show Context)
Citation Context ...he language qGCL, which extends the probabilistic guarded command language by quantum primitives. A promising avenue of research is the integration of quantum programming with functional programming, =-=[40, 52, 64]-=-. Altenkirch, Vizotto and Sabry [84] have shown that quantum programming can be modelled using Haskell’s arrow library [37], presenting a high level, but constructive, view of quantum effects. Van Ton... |

860 | Algorithms for quantum computation: discrete logarithms and factoring
- Shor
- 1994
(Show Context)
Citation Context ...efficiency gains made possible by quantum computation were first demonstrated on a computationally interesting problem in 1994, when Peter Shor of AT&T developed a quantum algorithm for factorisation =-=[73]-=-. This algorithm is exponentially faster than any currently known classical algorithm, and proved to be the catalyst 1s1. introduction 2 for an explosion in the interest of quantum computers. Classica... |

702 | Quantum theory, the Church–Turing principle and the universal quantum computer
- Deutsch
- 1985
(Show Context)
Citation Context ...h, one of the pioneers in quantum computing following Feynman, published a paper that is now considered to be a landmark in physics, although it was largely ignored at the time. In this paper Deutsch =-=[22]-=- hypothesised that quantum computers could perform some tasks much more efficiently than classical computers, but the examples included in the paper were of limited use and application, and were not g... |

669 |
Can quantum-mechanical description of physical reality be considered complete? Phys. Rev
- Einstein, Podolsky, et al.
- 1935
(Show Context)
Citation Context ...he |epr〉 state is entangled, which means that the two individual qubits are now correlated. This is actually a well-known state, first formulated by Einstein, Podolsky, and Rosen as the “EPR paradox” =-=[23]-=-. Measuring the first qubit of this state would result in either 0 (with the resulting state |00〉) or 1 (|11〉), each with a probability of 1. In either case, sub2 sequently measuring the second qubit ... |

496 |
Logical reversibility of computation
- Bennett
- 1973
(Show Context)
Citation Context ... part of the system, does not decrease, and the second law of thermodynamics is not violated.s2.0.2 Logically reversible computation 2. reversible classical computation 16 In the early 1970s, Bennett =-=[10]-=- discovered a way of breaking computation down into reversible steps. A excellent summary of the importance of reversible computation is given in [16], also quoted in Abramsky’s work [1]: Reversible c... |

428 | Simulating physics with computers
- Feynman
- 1982
(Show Context)
Citation Context ...order of magnitude before useful algorithms can be run. 1.3 History of quantum computation The idea that quantum computing is possible was first put forward, independently, in 1982 by Richard Feynman =-=[25]-=- and Paul Benioff [7, 8]. Feynman’s main motivation was the simulation of other systems which are chiefly governed by quantum mechanics. He theorised that a quantum system could more naturally and qui... |

375 |
Irreversibility and heat generation in the computing process
- Landauer
- 1961
(Show Context)
Citation Context ...s, which do allow for irreversible processes, are a derived notion; a subsystem of a larger closed system. Is there some constraint in the physics of computation that forces irreversibility? Landauer =-=[46]-=- showed in 1961 that it is the act of erasing, or forgetting, information in a physical system that incurs energy loss, and it is from this ‘entropy increase’ that irreversibility stems. This is calle... |

323 | Quantum mechanics helps in searching for a needle in a haystack
- Grover
- 1997
(Show Context)
Citation Context ... sufficiently powerful quantum computers are ever made available. Two years later, in 1996, Lov Grover of Bell Labs discovered a quantum based algorithm for the fast searching of an unsorted database =-=[32]-=-. Grover’s algorithm is only polynomially faster than classical search algorithms, but it is provably better than the best classical algorithm [58]. It does not, like Shor’s algorithm, rely upon the u... |

300 | Dependent types in practical programming
- Xi, Pfenning
- 1999
(Show Context)
Citation Context ...ential practical implementations of quantum computational devices, is to allow quantum programs to be indexed by classical structures in a way akin to that proposed in the language Dependent ML (DML) =-=[86]-=-. DML is a language with dependent types where index expressions and actual programs are clearly separated. In the case of DML, this separation is required to deal with impurities in the actual progra... |

266 |
Categories for the Working Mathematician, Graduate Texts
- Lane
- 1971
(Show Context)
Citation Context ...ategory theory There are many advanced concepts available in category theory, but these are mostly unnecessary for the analysis here. Further information on category theory can be found in references =-=[47, 56]-=-. A category, C, is a collection, or class, of objects (a, b, c, ...), with a collection of unique morphisms, also called arrows, between them. For any two morphisms f ∈ a → b, g ∈ b → c, there exists... |

231 |
Conservative Logic
- Fredkin, Toffoli
- 1982
(Show Context)
Citation Context ...redkin and Tommaso Toffoli, the billiard ball model of computing can be used as an idealised system for modelling high-performance computational processes, and behaves according to conservative logic =-=[26]-=-, summarised here. 2.1.1 Conservative logic “Conservative logic” obeys fundamental physical principles (including reversibility), and as such provides a useful theoretical framework in which to consid... |

185 |
Basic category theory for computer scientists, Foundations of Computing Series
- Pierce
- 1991
(Show Context)
Citation Context ...ategory theory There are many advanced concepts available in category theory, but these are mostly unnecessary for the analysis here. Further information on category theory can be found in references =-=[47, 56]-=-. A category, C, is a collection, or class, of objects (a, b, c, ...), with a collection of unique morphisms, also called arrows, between them. For any two morphisms f ∈ a → b, g ∈ b → c, there exists... |

176 | Generalising monads to arrows
- Hughes
(Show Context)
Citation Context ... the integration of quantum programming with functional programming, [40, 52, 64]. Altenkirch, Vizotto and Sabry [84] have shown that quantum programming can be modelled using Haskell’s arrow library =-=[37]-=-, presenting a high level, but constructive, view of quantum effects. Van Tonder has proposed a quantum λ-calculus incorporating higher order programs [80, 81]; however, measurements are not considere... |

164 |
The view from the left
- McBride, McKinna
(Show Context)
Citation Context ... and Cond there is the requirement that the arity (number of wires) in each sub-circuit is the same, in order for them to be wired together correctly. In a dependently typed language, such as Epigram =-=[49]-=-, this could be enforced, but in Haskell these type constraints have to be checked by an auxiliary function. This is because Haskell’s type system does not allow data to appear in types; types can onl... |

162 | A categorical semantics of quantum protocols
- Abramsky, Coecke
- 2004
(Show Context)
Citation Context ...gests a semantics for a strict higher order quantum language based on vector bundles. At the current time it is not clear to us, whether the details of this construction work out. Abramsky and Coecke =-=[1]-=- have investigated a categorical semantics for quantum protocols using the compact closed structure of the category of finite dimensional Hilbert spaces. They suggest that their semantics may be relev... |

159 | Quantum computations: algorithms and error correction - Kitaev - 1997 |

156 |
Quantum computing
- Gruska
- 1999
(Show Context)
Citation Context ...n [34]: “I think I can safely say that no one understands quantum mechanics” 1.4 Quantum programming Quantum programming is now a firmly established field, with many introductory text books available =-=[33, 36, 53, 57]-=-, and Preskill’s online course notes [58]. However, quantum programs are usually presented in a semi-formal style and on a very low level, usually as families of quantum circuits. This is demonstrated... |

143 |
Die gegenwärtige Situation in der Quantenmechanik
- Schrödinger
- 1935
(Show Context)
Citation Context ...can exist in a superposition of states between heads and tails while it is covered, and only collapses to one state when observed, in a similar vein to the famous Schrödinger’s Cat thought-experiment =-=[67]-=-. If the quantum coin is measured, but the result not observed, it becomes a classical probabilistic coin. The quantum state has collapsed and our lack of knowledge about which state it collapsed into... |

135 |
Syntactic control of interference
- Reynolds
- 1978
(Show Context)
Citation Context ...coherence which is caused by thermal noise in a hypothetical quantum computer. As one of the referees has pointed out, control of decoherence is in spirit similar to Reynold’s control of interference =-=[13]-=-. 2 Related work There are a number of papers on simulating or integrating quantum programming within conventional functional programming, e.g. Mu and Bird’s early proposal on modelling quantum progra... |

133 |
Error correcting codes in quantum theory
- Steane
- 1996
(Show Context)
Citation Context ...escape [76]. These trapped atoms could then be used as quantum bits, as described in section 3.1.1. The problem of quantum error correction in physical systems is dealt with comprehensively by Steane =-=[75]-=- and Cory et al [18]. Optically trapped atoms have been used as qubit registers, notably in the operation of a cnot gate [50, 51]. Two qubits were stored in the internal and external degrees of freedo... |

131 |
Reversible Computing
- Toffoli
- 1980
(Show Context)
Citation Context ...-loss mechanisms, and these are currently being debated concerning the relevance of their contribution, if any. Other reversible computing frameworks include the kinematical model proposed by Toffoli =-=[78]-=-, the microscopic theory of Bennett [11], the quantum mechanical theory of Benioff [7, 8], and the structural approach of Abramsky [1]. 2.2 Reversible computations as circuits In this section an induc... |

126 |
The computer as a physical system: A microscopic quantum mechanical hamiltonian model of computers as represented by turing machines
- Benioff
- 1980
(Show Context)
Citation Context ...ore useful algorithms can be run. 1.3 History of quantum computation The idea that quantum computing is possible was first put forward, independently, in 1982 by Richard Feynman [25] and Paul Benioff =-=[7, 8]-=-. Feynman’s main motivation was the simulation of other systems which are chiefly governed by quantum mechanics. He theorised that a quantum system could more naturally and quickly simulate quantum sy... |

115 | Towards a quantum programming language
- Selinger
- 2002
(Show Context)
Citation Context ...rder, calculus is suggested, based on Hilbert bundles. It is currently not clear, however, how this calculus could be realised operationally, e.g. using quantum circuits. Selinger’s influential paper =-=[69]-=- introduces a single-assignment (essentially functional) quantum programming language, which is based on the separation of classical control and quantum data. The language proposed, QPL, is a simple q... |

100 | A one-way quantum computer - Raussendorf, Briegel |

81 | Monadic presentations of lambda-terms using generalized inductive types
- Altenkirch, Reus
- 1999
(Show Context)
Citation Context ...multiplication. This is defined as the >= operation (pronounced bind), as it has been shown that, although technically not a monad [82], vectors and linear operators correspond to a Kleisli structure =-=[4]-=-, whichs3. reversible quantum computation 44 is a more general notion, sometimes referred to as an indexed monad. The difference between monads and indexed monads is that the function is not required ... |

80 |
Quantum mechanical hamiltonian models of turing machines
- Benioff
- 1982
(Show Context)
Citation Context ...ore useful algorithms can be run. 1.3 History of quantum computation The idea that quantum computing is possible was first put forward, independently, in 1982 by Richard Feynman [25] and Paul Benioff =-=[7, 8]-=-. Feynman’s main motivation was the simulation of other systems which are chiefly governed by quantum mechanics. He theorised that a quantum system could more naturally and quickly simulate quantum sy... |

63 | Non-deterministic quantum programming
- Zuliani
- 2004
(Show Context)
Citation Context ...ented an imperative language QCL with quantum primitives and a syntax based on C [54]. This is considered to be the first real quantum programming language with a full definition. Sanders and Zuliani =-=[65]-=- proposed the language qGCL, which extends the probabilistic guarded command language by quantum primitives. A promising avenue of research is the integration of quantum programming with functional pr... |

62 |
Measurement of Conditional Phase Shifts for Quantum Logic
- Turchette, Hood, et al.
- 1995
(Show Context)
Citation Context ...e et al used the birefringence of a single atom coupled to an optical resonator. The phase shifts which resulted were used in a quantum phase gate, for which they report the truth table, in reference =-=[79]-=-. Brune et al [20] demonstrated quantum teleportation between two high Q cavities containing a superposition of microwave states. Quantum teleportation has also been demonstrated by Bouwmeester et al ... |

60 |
Experimental implementation of fast quantum searching
- Chuang, Gershenfeld, et al.
- 1998
(Show Context)
Citation Context ..., each with a nucleus, which may be used as an array of qubits which may interact with each other. Radio frequency fields may be used to identify and manipulate a single nucleus at a time. Chloroform =-=[17]-=- and cytosine molecules [38] have been used experimentally as quantum computers. A three qubit system has been developed by R. Laflamme and D. G. Cory [6, 44] based on malonic acid. Nanoscale architec... |

60 | Quantum Algorithms and the Fourier Transform - Jozsa - 1998 |

54 | A lambda calculus for quantum computation
- Tonder
(Show Context)
Citation Context ...an be modelled using Haskell’s arrow library [37], presenting a high level, but constructive, view of quantum effects. Van Tonder has proposed a quantum λ-calculus incorporating higher order programs =-=[80, 81]-=-; however, measurements are not considered as part of this language. In [81] a semantics for a finitary, but higher order, calculus is suggested, based on Hilbert bundles. It is currently not clear, h... |

49 | Conventions for quantum pseudocode
- Knill
- 1996
(Show Context)
Citation Context ...view of the current state of quantum programming languages in his review paper [27]. One of the first proposals towards a quantum programming language were Knill’s conventions for quantum pseudo-code =-=[43]-=-. Knill defines an imperative pseudocode suitable for implementation on a quantum random access machine (QRAM), which is also proposed in that research. The QRAM model is not formally defined, but it ... |

48 | A lambda calculus for quantum computation with classical control
- Selinger, Valiron
- 2006
(Show Context)
Citation Context ...d with operations on quantum data. Quantum data can be manipulated by using unitary operators or by measurement, which can affect the classical control flow. In more recent work, Selinger and Valiron =-=[72]-=- presented a functional language based on the classical control and quantum data paradigm. The language is based on call-by-value λ-calculus, and includes both classical ands1. introduction 9 quantum ... |

45 |
Demonstration of a fundamental quantum logic gate Phys
- Monroe
- 1995
(Show Context)
Citation Context ...ror correction in physical systems is dealt with comprehensively by Steane [75] and Cory et al [18]. Optically trapped atoms have been used as qubit registers, notably in the operation of a cnot gate =-=[50, 51]-=-. Two qubits were stored in the internal and external degrees of freedom of an optically trapped atom. Grover’s quantum search algorithm was realised in an optically trapped atom experiment [14]. A tr... |

43 |
Violation of Bell inequalities by photons more than 10 km apart
- Tittel, Brendel, et al.
- 1998
(Show Context)
Citation Context ... the first measurement. This correlation holds even if the two qubits are separated in any way. Experiments have shown that this correlation exists even when the two states are separated by over 10km =-=[77]-=-. This results demonstrates a key difference between quantum and classical systems, in which an entangled states3. reversible quantum computation 37 of two qubits cannot be expressed as the tensor pro... |

38 | Communicating quantum processes
- Gay, Nagarajan
- 2004
(Show Context)
Citation Context ...t b else b b ′′ = if had x ′ then z b ′ else b ′ This is a QML implementation of the circuit given for the teleportation algorithm in section 3.10. The language CQP of Communicating Quantum Processes =-=[28]-=- allows the modelling of channels, and the separation of the two components of the EPR pair, in an implementation of the teleportation algorithm. 6.7 Coproducts in QML In a previous version of QML (pr... |

38 |
Quantum Computing
- Hirvensalo
- 2001
(Show Context)
Citation Context ...n [34]: “I think I can safely say that no one understands quantum mechanics” 1.4 Quantum programming Quantum programming is now a firmly established field, with many introductory text books available =-=[33, 36, 53, 57]-=-, and Preskill’s online course notes [58]. However, quantum programs are usually presented in a semi-formal style and on a very low level, usually as families of quantum circuits. This is demonstrated... |

38 |
Measurement-based quantum computation with cluster states. Physical Review A 68:022312
- Raussendorf, Browne, et al.
- 2003
(Show Context)
Citation Context ...final step is an optimal method. Indeed, more recent low-level models of quantum computation make use of measurement as the tool to progress the computation at each step, using a measurement calculus =-=[19, 61]-=-. Separating the reversible and irreversible components of a computation in this way is unaccommodating to high level computational structures such as higher order types, continuations, recursive algo... |

36 | pGCL: Formal reasoning for random algorithms
- Morgan, McIver
- 1999
(Show Context)
Citation Context ...y’s proposal to structure embedded quantum programs using virtual values [14]. Yet another approach was suggested by Sanders and Zuliani [22], which extends the probabilistic guarded command language =-=[10]-=- by quantum registers and operations on quantum registers. Peter Selinger’s influential paper [15] introduces a single-assignment (essentially functional) quantum programming language, which is based ... |

35 | Experimental quantum teleportation
- Bouwmeester, Pan, et al.
- 1997
(Show Context)
Citation Context .... Brune et al [20] demonstrated quantum teleportation between two high Q cavities containing a superposition of microwave states. Quantum teleportation has also been demonstrated by Bouwmeester et al =-=[13]-=-. The passage of information has been shown to be more efficient in quantum matter than in classical matter by Mattle et al [48] who coded information using two entangled particles and performing func... |

29 | Quantum computation, categorical semantics and linear logic. arXiv:quant-ph/0312174v4
- Tonder, Dorca
- 2007
(Show Context)
Citation Context ...an be modelled using Haskell’s arrow library [37], presenting a high level, but constructive, view of quantum effects. Van Tonder has proposed a quantum λ-calculus incorporating higher order programs =-=[80, 81]-=-; however, measurements are not considered as part of this language. In [81] a semantics for a finitary, but higher order, calculus is suggested, based on Hilbert bundles. It is currently not clear, h... |

27 | Quantum programming languages: Survey and bibliography
- Gay
- 2006
(Show Context)
Citation Context ...d lead to new applications of quantum computing – as they have done in conventional programming. Gay provides a full overview of the current state of quantum programming languages in his review paper =-=[27]-=-. One of the first proposals towards a quantum programming language were Knill’s conventions for quantum pseudo-code [43]. Knill defines an imperative pseudocode suitable for implementation on a quant... |

27 |
An Introduction to Quantum Computing Algorithms, Birkhäuser
- Pittenger
- 2000
(Show Context)
Citation Context |

26 |
Implementation of a quantum algorithm on a nuclear magnetic resonance quantum computer
- Jones, Mosca
- 1998
(Show Context)
Citation Context ... may be used as an array of qubits which may interact with each other. Radio frequency fields may be used to identify and manipulate a single nucleus at a time. Chloroform [17] and cytosine molecules =-=[38]-=- have been used experimentally as quantum computers. A three qubit system has been developed by R. Laflamme and D. G. Cory [6, 44] based on malonic acid. Nanoscale architectures have also been conside... |

21 | Structured Quantum Programming - Ömer - 2003 |

20 |
Quantum information processing with atoms and photons
- MONROE
- 2002
(Show Context)
Citation Context ...ror correction in physical systems is dealt with comprehensively by Steane [75] and Cory et al [18]. Optically trapped atoms have been used as qubit registers, notably in the operation of a cnot gate =-=[50, 51]-=-. Two qubits were stored in the internal and external degrees of freedom of an optically trapped atom. Grover’s quantum search algorithm was realised in an optically trapped atom experiment [14]. A tr... |

19 | A structural approach to reversible computation
- Abramsky
(Show Context)
Citation Context ...70s, Bennett [10] discovered a way of breaking computation down into reversible steps. A excellent summary of the importance of reversible computation is given in [16], also quoted in Abramsky’s work =-=[1]-=-: Reversible computation: Landauer [46] has demonstrated that it is only the ‘logically irreversible’ operations in a physical computer that necessarily dissipate energy by generating a corresponding ... |

19 | Time and space bounds for reversible simulation
- Buhrman, Tromp, et al.
(Show Context)
Citation Context ...ssical computation 16 In the early 1970s, Bennett [10] discovered a way of breaking computation down into reversible steps. A excellent summary of the importance of reversible computation is given in =-=[16]-=-, also quoted in Abramsky’s work [1]: Reversible computation: Landauer [46] has demonstrated that it is only the ‘logically irreversible’ operations in a physical computer that necessarily dissipate e... |