Quantum programming

Quantum programming

Quantum programming is a set of computer programming languages that allow the expression of quantum algorithms using high-level constructs. The point of quantum languages is not so much to provide a tool for programmers, but to provide tools for researchers to understand better how quantum computation works and how to formally reason about quantum algorithms.

Efforts are underway to develop functional programming languages for quantum computing. Examples include Selinger's QPL [http://www.mathstat.dal.ca/~selinger/papers.html#qpl Peter Selinger: Papers ] ] , and the Haskell-like language QML by Altenkirch and Grattage [http://www.cs.nott.ac.uk/~jjg/qml.html Jonathan Grattage: QML Research ] ] [http://sneezy.cs.nott.ac.uk/qml QML: A Functional Quantum Programming Language ] ] . Higher-order quantum programming languages, based on lambda calculus, have been proposed by van Tonder [ [http://epubs.siam.org/SICOMP/volume-33/art_43216.html Cookies Required ] ] , Selinger and Valiron [ [http://www.mathstat.dal.ca/~selinger/papers/#qlambda Peter Selinger: Papers ] ] and by Arrighi and Dowek [ [http://www.arxiv.org/abs/quant-ph/0612199 Linear-algebraic lambda-calculus: higher-order, encodings and confluence] ] .

Simon Gay's [http://www.dcs.gla.ac.uk/~simon/quantum Quantum Programming Languages Survey] has more information on the current state of research and a comprehensive bibliography of resources.

Imperative quantum programming languages

Quantum pseudocode

Quantum pseudocode proposed by E. Knill is the first formalised language for description of quantum algorithms was introduced and, moreover, it was tightly connected with a model of quantum machine called Quantum Random Access Machine (QRAM).

Quantum computing language

QCL (Quantum Computer Language) is one of the first implemented quantum programming languages. Its syntax resembles syntax of the C programming language and classical data types are similar to data types in C.

The basic built-in quantum data type in QCL is the qreg (quantum register). It can be interpreted as an array of qubits (quantum bits).

qureg x1 [2] ; // 2-qubit quantum register x1 qureg x2 [2] ; // 2-qubit quantum register x2 H(x1); // Hadamard operation on x1 H(x2 [1] ); // Hadamard operation on the first qubit of the register x2

Since the qcl interpreter uses qlib simulation library, it is possible to observe the internal state of the quantum machine during execution of the quantum program.

qcl> dump : STATE: 4 / 32 qubits allocated, 28 / 32 qubits free 0.35355 |0> + 0.35355 |1> + 0.35355 |2> + 0.35355 |3> + 0.35355 |8> + 0.35355 |9> + 0.35355 |10> + 0.35355 |11>

Note that the dump operation is different from measurement, since it does not influence the state of the quantum machine and can be realised only using a simulator.

The QCL standard library provides standard quantum operators used in quantum algorithms such as:

* controlled-not with many target qubits,
* Hadamard operation on many qubits,
* parse and controlled phase.

But the most important feature of QCL is the support for user-defined operators and functions. Like in modern programming languages, it is possible to define new operations which can be used to manipulate quantum data. For example:

operator diffuse (qureg q) { H(q); // Hadamard Transform Not(q); // Invert q CPhase(pi, q); // Rotate if q=1111.. !Not(q); // undo inversion !H(q); // undo Hadamard Transform }

defines inverse about the mean operator used in Grover's algorithm. This allows one to define algorithms on a higher level of abstraction and extend the library of functions available for programmers.

Q language

Q Language is the second implemented imperative quantum programming language.

Q Language was implemented as an extension of C++ programming language. It provides classes for basic quantum operations like QHadamard,QFourier, QNot, and QSwap, which are derived from the base class Qop.New operators can be defined using C++ class mechanism.

Quantum memory is represented by class Qreg.

Qreg x1(); // 1-qubit quantum register with initial value 0 Qreg x2(2,0); // 2-qubit quantum register with initial value 0

Computation process is executed using provided simulator. Noisy environment can besimulated using parameters of the simulator.


Quantum Guarded Command Language (qGCL) was defined by P. Zuliani in his PhD thesis. It is based on Guarded Command Language created by Edsger Dijkstra.

It can be described as a language of quantum programmes specification.

Functional quantum programming languages

During the last few years many quantum programming languages based on the functional programming paradigm were proposed. Functional programming languages are well-suited for reasoning about programs.


QFC and QPL are two closely related quantum programming languages defined by Peter Selinger. They differ only in their syntax: QFC uses a flow chart syntax, whereas QPL uses a textual syntax. These languages have classical control flow, but can operate on quantum or classical data. Selinger gives a denotational semantics for these languages in a category of


[http://sneezy.cs.nott.ac.uk/QML/ QML] is a Haskell-like quantum programming language by Altenkirch and Grattage [ [http://www.cs.nott.ac.uk/~jjg/qml.html Jonathan Grattage: QML Research ] ] [cite web |title=QML: A Functional Quantum Programming Language |url=http://sneezy.cs.nott.ac.uk/qml] . Unlike Selinger's QPL, this language takes duplication, rather than discarding, of quantum information as a primitive operation. Duplication in this context is understood to be the operation that maps |phi angle to |phi angleotimes|phi angle, and is not to be confused with the impossible operation of cloning; the authors claim it is akin to how sharing is modelled in classical languages. QML also introduces both classical andquantum control operators, whereas most other languages rely on classical control.

An operational semantics for QML is given in terms of quantum circuits, while a denotational semantics is presented in terms of superoperators, and these are shown to agree. Both the operational and denotational semantics have been implemented (classically) in Haskell [ [http://sneezy.cs.nott.ac.uk/qml/compiler QML: A Functional Quantum Programming Language ] ] .

Quantum lambda calculi

Quantum lambda calculi are extensions of the lambda calculus, introduced by Alonzo Church and Stephen Cole Kleene in the 1930s. The purpose of quantum lambda calculi is to extend quantum programming languages with a theory of higher-order functions.

The first attempt to define a quantum lambda calculus was made by Philip Maymin in 1996.His lambda-q calculus is powerful enough to express any quantum computation. However, this language can efficiently solve NP-complete problems, and therefore appears to be strictly stronger than the standard quantum computational models (such as the quantum Turing machine or the quantum circuit model). Therefore, Maymin's lambda-q calculus is probably not implementable on a physical device.

In 2003, André van Tonder defined an extension of the lambda calculus suitable for proving correctness of quantum programs. He also provided an implementation in the Scheme programming language [cite web |author=André van Tonder |title=A lambda calculus for quantum computation |url=http://www.het.brown.edu/people/andre/qlambda] .

In 2004, Selinger and Valiron defined a strongly typed lambda calculus for quantum computation with a type system based on linear logic.


External links

* [http://www.comlab.ox.ac.uk/people/bob.coecke/DCM_QPL_08.html 5th International Workshop on Quantum Physics and Logic]
* [http://www.mathstat.dal.ca/~selinger/qpl2006/ 4th International Workshop on Quantum Programming Languages]
* [http://www.mathstat.dal.ca/~selinger/qpl2005/ 3rd International Workshop on Quantum Programming Languages]
* [http://www.mathstat.dal.ca/~selinger/qpl2004/ 2rd International Workshop on Quantum Programming Languages]
* [http://www.dcs.gla.ac.uk/~simon/quantum/ Bibliography on Quantum Programming Languages]
* [http://www.quantiki.org/wiki/index.php/Quantum_Programming_Language Quantum programming language] in [http://www.quantiki.org/ Quantiki]

Wikimedia Foundation. 2010.

Нужно сделать НИР?

Look at other dictionaries:

  • Quantum information — For the journal with this title, see Historical Social Research. In quantum mechanics, quantum information is physical information that is held in the state of a quantum system. The most popular unit of quantum information is the qubit, a two… …   Wikipedia

  • Quantum channel — In quantum information theory, a quantum channel is a communication channel which can transmit quantum information, as well as classical information. An example of quantum information is the state of a qubit. An example of classical information… …   Wikipedia

  • Quantum finite automata — In quantum computing, quantum finite automata or QFA are a quantum analog of probabilistic automata. They are related to quantum computers in a similar fashion as finite automata are related to Turing machines. Several types of automata may be… …   Wikipedia

  • Quantum mind — theories are based on the premise that quantum mechanics is necessary to fully understand the mind and brain, particularly concerning an explanation of consciousness. This approach is considered a minority opinion in science, although it does… …   Wikipedia

  • Programming paradigm — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concu …   Wikipedia

  • Programming the Universe — Infobox Book name = Programming the Universe: A Quantum Computer Scientist Takes On the Cosmos title orig = translator = image caption = author = Seth Lloyd illustrator = cover artist = country = language = series = subject = Quantum mechanics,… …   Wikipedia

  • Quantum GIS — Infobox Software name = Quantum GIS caption = Quantum GIS on Microsoft Windows developer = QGIS Development Team programming language = C++ latest release version = 0.11.0 latest release date = release date and age|2008|7|09 operating system =… …   Wikipedia

  • Quantum sort — A quantum sort is any sorting algorithm that runs on a quantum computer. Any comparison based quantum sorting algorithm would take at least Omega(n log n) steps [cite conference author = P. Høyer, J. Neerbek, Y. Shi title = Quantum complexities… …   Wikipedia

  • One-way quantum computer — The one way or measurement based quantum computer is a method of quantum computing that first prepares an entangled resource state, usually a cluster state or graph state, then performs single qubit measurements on it. It is one way because the… …   Wikipedia

  • Nuclear magnetic resonance quantum computer — Molecule of alanine used in NMR implementation of quantum computing. Qubits are implemented by spin states of the black carbon atoms NMR quantum computing uses the spin states of molecules as qubits. NMR differs from other implementation …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”