Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-x24gv Total loading time: 0 Render date: 2024-05-04T08:16:06.494Z Has data issue: false hasContentIssue false

5 - The Quantum IO Monad

Published online by Cambridge University Press:  05 July 2014

Thorsten Altenkirch
Affiliation:
University of Nottingham
Alexander S. Green
Affiliation:
University of Nottingham
Simon Gay
Affiliation:
University of Glasgow
Ian Mackie
Affiliation:
Imperial College London
Get access

Summary

Abstract

The quantum IO monad is a purely functional interface to quantum programming implemented as a Haskell library. At the same time it provides a constructive semantics of quantum programming. The QIO monad separates reversible (i.e., unitary) and irreversible (i.e., probabilistic) computations and provides a reversible let operation (ulet), allowing us to use ancillas (auxiliary qubits) in a modular fashion. QIO programs can be simulated either by calculating a probability distribution or by embedding it into the IO monad using the random number generator. As an example we present a complete implementation of Shor's algorithm.

5.1 Introduction

We present an interface from a pure functional programming language, Haskell, to quantum programming: the quantum IO monad, and use it to implement Shor's factorization algorithm. The implementation of the QIO monad provides a constructive semantics for quantum programming, i.e., a functional program that can also be understood as a mathematical model of quantum computing. Actually, the Haskell QIO library is only a first approximation of such a semantics; we would like to move to a more expressive language that is also logically sound. Here we are thinking of a language such as Agda (Norell 2007), which is based on Martin Löf's type theory. We have already investigated this approach of functional specifications of effects in a classical context (Swierstra and Altenkirch 2007, 2008; Swierstra 2008). At the same time the QIO monad provides a high-level interface to a hypothetical quantum computer.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2009

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Altenkirch, T., and Grattage, J. (2005) A functional quantum programming language. In Proceedings of the 20th Annual IEEE Symposium on Logic in Computer Science (LICS). IEEE Computer Society. Also arXiv:quant-ph/0409065.Google Scholar
Arrighi, P., and Dowek, G. (2008) Linear-algebraic A-calculus: higher-order, encodings, and confluence. In Rewriting Techniques and Applications: 19th International Conference, RTA 2008 Hagenberg, Austria, July 15-17, 2008, Proceedings, page 17. Springer.CrossRefGoogle Scholar
Coq Development Team (2004) The Coq Proof Assistant Reference Manual. LogiCal Project. Version 8.0.
Danos, V, Kashefi, E., and Panangaden, P (2007) The measurement calculus. Journal of the ACM 54(2). Preliminary version in arXiv:quant-ph/0412135.CrossRefGoogle Scholar
Deutsch, D. (1985) Quantum theory, the Church-Turing principle and the universal quantum computer. Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences 400(1818):97-117.Google Scholar
Gay, S. J. (2006) Quantum programming languages: survey and bibliography. Mathematical Structures in Computer Science 16(4).CrossRefGoogle Scholar
Green, A. (2008) The Quantum IO Monad, source code and examples. http://www.cs.nott.ac.ukTasg/QIO/.Google Scholar
Hutton, G. (2007) Programming in Haskell. Cambridge University Press.CrossRefGoogle Scholar
Jones, S. P. (2003) Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press.Google Scholar
Karczmarczuk, J. (2003) Structure and interpretation of quantum mechanics - a functional framework. In Proceedings of the ACM SIGPLAN Workshop on Haskell. ACM Press.Google Scholar
Mu, S.-C., and Bird, R. (2001) Functional quantum programming. In Proceedings of the 2nd Asian Workshop on Programming Languages and Systems.Google Scholar
Nielsen, M. A., and Chuang, I. L. (2000) Quantum Computation and Quantum Information. Cambridge University Press.Google Scholar
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory. Ph.D. thesis, Department of Computer Science and Engineering, Chalmers University of Technology, SE-412 96 Göteborg, Sweden.Google Scholar
Rivest, R. L., Shamir, A., and Adelman, L. M. (1977) A method for obtaining digital signatures and public-key cryptosystems. Technical Report MIT/LCS/TM-82.Google Scholar
Rüdiger, R. (2007) Quantum programming languages: An introductory overview. The Computer Journal 50(2):134–150.CrossRefGoogle Scholar
Sabry, A. (2003) Modelling quantum computing in Haskell. In Proceedings of the ACM SIGPLAN Workshop on Haskell. ACM Press.Google Scholar
Shor, P. (1994) Algorithms for quantum computation: discrete logarithms and factoring. In Proceedings, 35th Annual Symposium on Foundations of Computer Science. IEEE Press.Google Scholar
Sittampalam, G. (2008) Restricted monads in Haskell, Live Journal entry. http://hsenag. livejournal.com/11803.html.Google Scholar
Swierstra, W. (2008) A Functional Specification of Effects. Ph.D. thesis, University of Nottingham.Google Scholar
Swierstra, W., and Altenkirch, T. (2007) Beauty in the beast: A functional semantics of the awkward squad. In Haskell '07: Proceedings of the ACM SIGPLAN workshop on Haskell.Google Scholar
Swierstra, W., and Altenkirch, T. (2008) Dependent types for distributed arrays. Presented at Trends in Functional Programming (TFP 2008). Submitted for final proceedings.Google Scholar
Vedral, V, Barenco, A., and Ekert, A. (1995) Quantum networks for elementary arithmetic operations.Google Scholar
Vizzotto, J. K., Altenkirch, T., and Sabry, A. (2006) Structuring quantum effects: Superoperators as arrows. Mathematical Structures in Computer Science 16(3). Also arXiv:quant-ph/0501151.CrossRefGoogle Scholar

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×