**Quantum programming** is the process of assembling sequences of instructions, called quantum programs, that are capable of running on a quantum computer. Quantum programming languages help express quantum algorithms using high-level constructs.^{[1]}

Quantum instruction sets

Quantum instruction sets are used to turn higher level algorithms into physical instructions that can be executed on quantum processors. Sometimes these instructions are specific to a given hardware platform, e.g. ion traps or superconducting qubits.

**cQASM**

cQASM,^{[2]} also known as common QASM, is a hardware-agnostic QASM which guarantees the interoperability between all the quantum compilation and simulation tools. It was introduced by the QCA Lab at TUDelft.

**Quil**

Quil is an instruction set architecture for quantum computing that first introduced a shared quantum/classical memory model. It was introduced by Robert Smith, Michael Curtis, and William Zeng in *A Practical Quantum Instruction Set Architecture*.^{[3]} Many quantum algorithms (including quantum teleportation, quantum error correction, simulation,^{[4][5]} and optimization algorithms^{[6]}) require a shared memory architecture.

**OpenQASM**

OpenQASM^{[7]} is the intermediate representation introduced by IBM for use with Qiskit and the IBM Q Experience.

**Blackbird**

Blackbird^{[8][9]} is a quantum instruction set and intermediate representation used by Xanadu and Strawberry Fields. It is designed to represent continuous-variable quantum programs that can run on photonic quantum hardware.

Quantum software development kits

Quantum software development kits provide collections of tools to create and manipulate quantum programs.^{[10]} They also provide the means to simulate the quantum programs or prepare them to be run using cloud-based quantum devices.

**SDKs with access to quantum processors**

The following software development kits can be used to run quantum circuits on prototype quantum devices, as well as on simulators.

**Ocean**

An Open Source suite of tools developed by D-Wave. Written mostly in the Python programming language, it enables users to formulate problems in Ising Model and Quadratic Unconstrained Binary Optimization formats (QUBO). Results can be obtained by submitting to an online quantum computer in Leap, D-Wave’s real-time Quantum Application Environment, customer-owned machines, or classical samplers.

**ProjectQ**

An Open Source project developed at the Institute for Theoretical Physics at ETH, which uses the Python programming language to create and manipulate quantum circuits.^{[11]} Results are obtained either using a simulator, or by sending jobs to IBM quantum devices.

**Qiskit**

An Open Source project developed by IBM.^{[12]} Quantum circuits are created and manipulated using Python, Swift or Java. Results are obtained either using simulators that run on the user’s own device, simulators provided by IBM or prototype quantum devices provided by IBM. As well as the ability to create programs using basic quantum operations, higher level algorithms are available within the Qiskit Aqua package.^{[13]} Qiskit is based on the OpenQASM standard for representing quantum circuits, and will support pulse level control of quantum systems as specified by the OpenPulse standard.^{[14]}

**Forest**

An Open Source project developed by Rigetti, which uses the Python programming language to create and manipulate quantum circuits. Results are obtained either using simulators or prototype quantum devices provided by Rigetti. As well as the ability to create programs using basic quantum operations, higher level algorithms are available within the Grove package.^{[15]} Forest is based on the Quil instruction set.

**t|ket> **

A quantum programming environment and optimizing compiler developed by Cambridge Quantum Computing that targets simulators and several quantum hardware back-ends, released in December 2018.^{[16]}

**SDKs based on simulators**

Public access to quantum devices is currently planned for the following SDKs, but not yet implemented.

**Quantum Development Kit**

A project developed by Microsoft^{[17]} as part of the .NET Framework. Quantum programs can be written and run within Visual Studio and VSCode.

**Cirq**

An Open Source project developed by Google, which uses the Python programming language to create and manipulate quantum circuits. Results are obtained using simulators that run on the user’s own device.

**Strawberry Fields**

An open-source Python library developed by Xanadu for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.^{[18][19]} Three simulators are provided – one in the Fock basis, one using the Gaussian formulation of quantum optics,^{[20]} and one using the TensorFlow machine learning library.

Quantum programming languages

There are two main groups of quantum programming languages: imperative quantum programming languages and functional quantum programming languages.

**Imperative languages**

The most prominent representatives of the imperative languages are QCL,^{[21]} LanQ^{[22]} and Q|SI>.^{[23]}

**QCL**

Quantum Computation Language (QCL) is one of the first implemented quantum programming languages.^{[24]} The most important feature of QCL is the support for user-defined operators and functions. Its syntax resembles the syntax of the C programming language and its classical data types are similar to primitive data types in C. One can combine classical code and quantum code in the same program.

**Quantum pseudocode**

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

**Q# **

A language developed by Microsoft to be used with the Quantum Development Kit.^{[25]}

**Q|SI> **

Q|SI> is a platform embedded in .Net language supporting quantum programming in a quantum extension of while-language.^{[23][26]} This platform includes a compiler of the quantum while-language^{[27]} and a chain of tools for the simulation of quantum computation, optimisation of quantum circuits, termination analysis of quantum programs,^{[28]} and verification of quantum programs.^{[29][30]}

**Q language**

Q Language is the second implemented imperative quantum programming language.^{[31]} 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*

The computation process is executed using a provided simulator. Noisy environments can be simulated using parameters of the simulator.

**qGCL**

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 programs specification.

**QMASM**

Quantum Macro Assembler (QMASM) is a low-level language specific to quantum annealers such as the D-Wave.^{[32]}

**Scaffold**

Scaffold is C-like language, that compiles to QASM and OpenQASM. It is built on top of the LLVM Compiler Infrastructure to perform optimizations on Scaffold code before generating a specified instruction set.^{[33][34]}

**Silq**

Silq is a high-level programming language for quantum computing with a strong static type system, developed at ETH Zürich.^{[35][36]}

**Functional languages**

Efforts are underway to develop functional programming languages for quantum computing. Functional programming languages are well-suited for reasoning about programs. Examples include Selinger’s QPL,^{[37]} and the Haskell-like language QML by Altenkirch and Grattage.^{[38][39]} Higher-order quantum programming languages, based on lambda calculus, have been proposed by van Tonder,^{[40]} Selinger and Valiron^{[41]} and by Arrighi and Dowek.^{[42]}

**QFC and QPL**

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 superoperators.

**QML**

QML is a Haskell-like quantum programming language by Altenkirch and Grattage.^{[43][38]} 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 {\displaystyle |\phi \rangle } to {\displaystyle |\phi \rangle \otimes |\phi \rangle }, and is not to be confused with the impossible operation of cloning; the authors claim it is akin to how sharing is modeled in classical languages. QML also introduces both classical and quantum 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.^{[44]}

**LIQUi|>**

LIQUi|> (pronounced *liquid*) is a quantum simulation extension on the F# programming language.^{[45]} It is currently being developed by the Quantum Architectures and Computation Group (QuArC)^{[46]} part of the StationQ efforts at Microsoft Research. LIQUi|> seeks to allow theorists to experiment with quantum algorithm design before physical quantum computers are available for use.^{[47]}

It includes a programming language, optimization and scheduling algorithms, and quantum simulators. LIQUi|> can be used to translate a quantum algorithm written in the form of a high-level program into the low-level machine instructions for a quantum device.^{[48]}

**Quantum lambda calculi**

Quantum lambda calculi are extensions of the classical 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.^{[49]} 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^{[citation needed]}.

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.^{[50]}

In 2004, Selinger and Valiron defined a strongly typed lambda calculus for quantum computation with a type system based on linear logic.^{[51]}

**Quipper**

Quipper was published in 2013.^{[52][53]} It is implemented as an embedded language, using Haskell as the host language.^{[54]} For this reason, quantum programs written in Quipper are written in Haskell using provided libraries. For example, the following code implements preparation of a superposition

**import** **Quipper**

spos **::** Bool **->** Circ Qubit

spos b **=** **do** q **<-** qinit b

r **<-** hadamard q

return r

References

**^***Jarosław Adam Miszczak (2012). High-level Structures in Quantum Computing. ISBN 9781608458516.***^***Bertels, K.; Almudever, C. G.; Hogaboam, J. W.; Ashraf, I.; Guerreschi, G. G.; Khammassi, N. (2018-05-24). “cQASM v1.0: Towards a Common Quantum Assembly Language”. arXiv:1805.09607v1 [quant-ph].***^***Smith, Robert S.; Curtis, Michael J.; Zeng, William J. (2016). “A Practical Quantum Instruction Set Architecture”. arXiv:1608.03355 [quant-ph].***^***McClean, Jarrod R.; Romero, Jonathan; Babbush, Ryan; Aspuru-Guzik, Alán (2016-02-04). “The theory of variational hybrid quantum-classical algorithms”. New Journal of Physics.***18**(2): 023023. arXiv:1509.04279. Bibcode:2016NJPh…18b3023M. doi:10.1088/1367-2630/18/2/023023. ISSN 1367-2630. S2CID 92988541.**^***Rubin, Nicholas C.; Curtis, Michael J.; Zeng, William J. (2016). “A Hybrid Classical/Quantum Approach for Large-Scale Studies of Quantum Systems with Density Matrix Embedding Theory”. arXiv:1610.06910 [quant-ph].***^***Farhi, Edward; Goldstone, Jeffrey; Gutmann, Sam (2014). “A Quantum Approximate Optimization Algorithm”. arXiv:1411.4028 [quant-ph].***^***qiskit-openqasm: OpenQASM specification, International Business Machines, 2017-07-04, retrieved 2017-07-06***^***“Blackbird Quantum Assembly Language — Blackbird 0.2.0 documentation”. quantum-blackbird.readthedocs.io. Retrieved 2019-06-24.***^***Weedbrook, Christian; Amy, Matthew; Bergholm, Ville; Quesada, Nicolás; Izaac, Josh; Killoran, Nathan (2019-03-11). “Strawberry Fields: A Software Platform for Photonic Quantum Computing”. Quantum.***3**: 129. arXiv:1804.03159. doi:10.22331/q-2019-03-11-129. S2CID 54763305.**^***Häner, Thomas; Steiger, Damian S.; Svore, Krysta; Troyer, Matthias (2018). “A software methodology for compiling quantum programs”. Quantum Science and Technology.***3**(2): 020501. arXiv:1604.01401. Bibcode:2018QS&T….3b0501H. doi:10.1088/2058-9565/aaa5cc. ISSN 2058-9565. S2CID 1922315.**^***“ProjectQ homepage”.***^***“Qiskit homepage”.*