Quantum programming is the process of designing or assembling sequences of instructions, called quantum circuits, using gates, switches, and operators to manipulate a quantum system for a desired outcome or results of a given experiment. Quantum circuit algorithms can be implemented on integrated circuits, conducted with instrumentation, or written in a programming language for use with a quantum computer or a quantum processor.
With quantum processor based systems, quantum programming languages help express quantum algorithms using high-level constructs. [1] The field is deeply rooted in the open-source philosophy and as a result most of the quantum software discussed in this article is freely available as open-source software. [2]
Quantum computers, such as those based on the KLM protocol, a linear optical quantum computing (LOQC) model, use quantum algorithms (circuits) implemented with electronics, integrated circuits, instrumentation, sensors, and/or by other physical means.[ not verified in body ]
Other circuits designed for experimentation related to quantum systems can be instrumentation and sensor based.[ not verified in body ]
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.
Blackbird [3] [4] is a quantum instruction set and intermediate representation used by Xanadu Quantum Technologies and Strawberry Fields. It is designed to represent continuous-variable quantum programs that can run on photonic quantum hardware.
cQASM, [5] also known as common QASM, is a hardware-agnostic quantum assembly language which guarantees the interoperability between all the quantum compilation and simulation tools. It was introduced by the QCA Lab at TUDelft.
OpenQASM [6] is the intermediate representation introduced by IBM for use with Qiskit and the IBM Q Experience.
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. [7] Many quantum algorithms (including quantum teleportation, quantum error correction, simulation, [8] [9] and optimization algorithms [10] ) require a shared memory architecture.
Quantum software development kits provide collections of tools to create and manipulate quantum programs. [11] They also provide the means to simulate the quantum programs or prepare them to be run using cloud-based quantum devices and self-hosted quantum devices.
The following software development kits can be used to run quantum circuits on prototype quantum devices, as well as on simulators.
An open source project developed by Google, which uses the Python programming language to create and manipulate quantum circuits. Programs written in Cirq can be run on IonQ, Pasqal, [12] Rigetti, and Alpine Quantum Technologies. [13]
A cloud-based quantum IDE developed by Classiq, uses a high-level quantum language, Qmod, to generate scalable and efficient quantum circuits with a hardware-aware synthesis engine, that can be deployed across a wide range of QPUs. The platform includes a large library of quantum algorithms.
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. [14] Forest is based on the Quil instruction set.
MindQuantum is a quantum computing framework based on MindSpore, focusing on the implementation of NISQ algorithms. [15] [16] [17]
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.[ citation needed ]
An open-source Python library developed by Xanadu Quantum Technologies for differentiable programming of quantum computers. [18] [19] [20] [21] PennyLane provides users the ability to create models using TensorFlow, NumPy, or PyTorch, and connect them with quantum computer backends available from IBMQ, Google Quantum, Rigetti, Quantinuum [22] and Alpine Quantum Technologies. [13] [23]
An open-source project created by Quandela for designing photonic quantum circuits and developing quantum algorithms, based on Python. Simulations are run either on the user's own computer or on the cloud. Perceval is also used to connect to Quandela's cloud-based photonic quantum processor. [24] [25]
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. [26] Results are obtained either using a simulator, or by sending jobs to IBM quantum devices.
An open source full-stack API for quantum simulation, quantum hardware control and calibration developed by multiple research laboratories, including QRC, CQT and INFN. Qibo is a modular framework which includes multiple backends for quantum simulation and hardware control. [27] [28] This project aims at providing a platform agnostic quantum hardware control framework with drivers for multiple instruments [29] and tools for quantum calibration, characterization and validation. [30] This framework focuses on self-hosted quantum devices by simplifying the software development required in labs.
An open source project developed by IBM. [31] Quantum circuits are created and manipulated using Python. 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 tools for algorithms and benchmarking are available within specialized packages. [32] Qiskit is based on the OpenQASM standard for representing quantum circuits. It also supports pulse level control of quantum systems via QiskitPulse standard. [33]
Qrisp [34] is an open source project coordinated by the Eclipse Foundation [35] and developed in Python programming by Fraunhofer FOKUS [36] Qrisp is a high-level programming language for creating and compiling quantum algorithms. Its structured programming model enables scalable development and maintenance. The expressive syntax is based on variables instead of qubits, with the QuantumVariable as core class, and functions instead of gates. Additional tools, such as a performant simulator and automatic uncomputation, complement the extensive framework. Furthermore, it is platform independent, since it offers alternative compilation of elementary functions down to the circuit level, based on device-specific gate sets.
A project developed by Microsoft [37] as part of the .NET Framework. Quantum programs can be written and run within Visual Studio and VSCode using the quantum programming language Q#. Programs developed in the QDK can be run on Microsoft's Azure Quantum, [38] and run on quantum computers from Quantinuum, [22] IonQ, and Pasqal. [12]
An open-source Python library developed by Xanadu Quantum Technologies for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits. [39] [40] Three simulators are provided - one in the Fock basis, one using the Gaussian formulation of quantum optics, [41] and one using the TensorFlow machine learning library. Strawberry Fields is also the library for executing programs on Xanadu's quantum photonic hardware. [42] [43]
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. [44]
There are two main groups of quantum programming languages: imperative quantum programming languages and functional quantum programming languages.
The most prominent representatives of the imperative languages are QCL, [45] LanQ [46] and Q|SI>. [47]
Ket [48] is an open-source embedded language designed to facilitate quantum programming, leveraging the familiar syntax and simplicity of Python. It serves as an integral component of the Ket Quantum Programming Platform, [49] seamlessly integrating with a Rust runtime library and a quantum simulator. Maintained by Quantuloop, the project emphasizes accessibility and versatility for researchers and developers. The following example demonstrates the implementation of a Bell state using Ket:
fromketimport*a,b=quant(2)# Allocate two quantum bitsH(a)# Put qubit `a` in a superpositioncnot(a,b)# Entangle the two qubits in the Bell statem_a=measure(a)# Measure qubit `a`, collapsing qubit `b` as wellm_b=measure(b)# Measure qubit `b`# Assert that the measurement of both qubits will always be equalassertm_a.value==m_b.value
The Logic of Quantum Programs (LQP) is a dynamic quantum logic, capable of expressing important features of quantum measurements and unitary evolutions of multi-partite states, and provides logical characterizations of various forms of entanglement. The logic has been used to specify and verify the correctness of various protocols in quantum computation. [50] [51]
Q Language is the second implemented imperative quantum programming language. [52] 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.
Qregx1;// 1-qubit quantum register with initial value 0Qregx2(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.
A language developed by Microsoft to be used with the Quantum Development Kit. [53]
Quantum Computation Language (QCL) is one of the first implemented quantum programming languages. [54] 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 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.
Quantum Macro Assembler (QMASM) is a low-level language specific to quantum annealers such as the D-Wave. [55]
Quantum Modeling (Qmod) language is a high-level language that abstracts away the gate-level qubit operation, providing a functional approach to the implementation of quantum algorithms on quantum registers. The language is part of the Classiq platform and can be used directly with its native syntax, through a Python SDK, or with a visual editor, all methods can take advantage of the larger library of algorithms and the efficient circuit optimization.
Q|SI> is a platform embedded in .Net language supporting quantum programming in a quantum extension of while-language. [47] [56] This platform includes a compiler of the quantum while-language [57] and a chain of tools for the simulation of quantum computation, optimisation of quantum circuits, termination analysis of quantum programs, [58] and verification of quantum programs. [59] [60]
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).
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. [61] [62]
Silq is a high-level programming language for quantum computing with a strong static type system, developed at ETH Zürich. [63] [64]
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, [65] and the Haskell-like language QML by Altenkirch and Grattage. [66] [67] Higher-order quantum programming languages, based on lambda calculus, have been proposed by van Tonder, [68] Selinger and Valiron [69] and by Arrighi and Dowek. [70]
LIQUi|> (pronounced liquid) is a quantum simulation extension on the F# programming language. [71] It is currently being developed by the Quantum Architectures and Computation Group (QuArC) [72] 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. [73]
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. [74]
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 is a Haskell-like quantum programming language by Altenkirch and Grattage. [75] [66] 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 to , 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. [76]
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. [77] 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. [78]
In 2004, Selinger and Valiron defined a strongly typed lambda calculus for quantum computation with a type system based on linear logic. [79]
Quipper was published in 2013. [80] [81] It is implemented as an embedded language, using Haskell as the host language. [82] 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
importQuipperspos::Bool->CircQubitsposb=doq<-qinitbr<-hadamardqreturnr
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both hardware and software. Computing has scientific, engineering, mathematical, technological, and social aspects. Major computing disciplines include computer engineering, computer science, cybersecurity, data science, information systems, information technology, and software engineering.
A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of both particles and waves, and quantum computing leverages this behavior using specialized hardware. Classical physics cannot explain the operation of these quantum devices, and a scalable quantum computer could perform some calculations exponentially faster than any modern "classical" computer. Theoretically a large-scale quantum computer could break widely used encryption schemes and aid physicists in performing physical simulations; however, the current state of the art is largely experimental and impractical, with several obstacles to useful applications.
In quantum computing, a quantum algorithm is an algorithm that runs on a realistic model of quantum computation, the most commonly used model being the quantum circuit model of computation. A classical algorithm is a finite sequence of instructions, or a step-by-step procedure for solving a problem, where each step or instruction can be performed on a classical computer. Similarly, a quantum algorithm is a step-by-step procedure, where each of the steps can be performed on a quantum computer. Although all classical algorithms can also be performed on a quantum computer, the term quantum algorithm is generally reserved for algorithms that seem inherently quantum, or use some essential feature of quantum computation such as quantum superposition or quantum entanglement.
Quantum Information Science is a field that combines the principles of quantum mechanics with information theory to study the processing, analysis, and transmission of information. It covers both theoretical and experimental aspects of quantum physics, including the limits of what can be achieved with quantum information. The term quantum information theory is sometimes used, but it does not include experimental research and can be confused with a subfield of quantum information science that deals with the processing of quantum information.
In quantum computing and specifically the quantum circuit model of computation, a quantum logic gate is a basic quantum circuit operating on a small number of qubits. Quantum logic gates are the building blocks of quantum circuits, like classical logic gates are for conventional digital circuits.
In quantum computing, the Gottesman–Knill theorem is a theoretical result by Daniel Gottesman and Emanuel Knill that states that stabilizer circuits, circuits that only consist of gates from the normalizer of the qubit Pauli group, also called Clifford group, can be perfectly simulated in polynomial time on a probabilistic classical computer. The Clifford group can be generated solely by using CNOT, Hadamard, and phase gate S; and therefore stabilizer circuits can be constructed using only these gates.
D-Wave Quantum Systems Inc. is a quantum computing company with locations in Palo Alto, California and Burnaby, British Columbia. D-Wave claims to be the world's first company to sell computers that exploit quantum effects in their operation. D-Wave's early customers include Lockheed Martin, the University of Southern California, Google/NASA, and Los Alamos National Laboratory.
Quantum machine learning is the integration of quantum algorithms within machine learning programs.
Quantum optimization algorithms are quantum algorithms that are used to solve optimization problems. Mathematical optimization deals with finding the best solution to a problem from a set of possible solutions. Mostly, the optimization problem is formulated as a minimization problem, where one tries to minimize an error which depends on the solution: the optimal solution has the minimal error. Different optimization techniques are applied in various fields such as mechanics, economics and engineering, and as the complexity and amount of data involved rise, more efficient ways of solving optimization problems are needed. Quantum computing may allow problems which are not practically feasible on classical computers to be solved, or suggest a considerable speed up with respect to the best known classical algorithm.
IBM Quantum Platform is an online platform allowing public and premium access to cloud-based quantum computing services provided by IBM. This includes access to a set of IBM's prototype quantum processors, a set of tutorials on quantum computation, and access to an interactive textbook. As of February 2021, there are over 20 devices on the service, six of which are freely available for the public. This service can be used to run algorithms and experiments, and explore tutorials and simulations around what might be possible with quantum computing.
Cloud-based quantum computing is the invocation of quantum emulators, simulators or processors through the cloud. Increasingly, cloud services are being looked on as the method for providing access to quantum processing. Quantum computers achieve their massive computing power by initiating quantum physics into processing power and when users are allowed access to these quantum-powered computers through the internet it is known as quantum computing within the cloud.
In quantum computing, quantum supremacy or quantum advantage is the goal of demonstrating that a programmable quantum computer can solve a problem that no classical computer can solve in any feasible amount of time, irrespective of the usefulness of the problem. The term was coined by John Preskill in 2012, but the concept dates to Yuri Manin's 1980 and Richard Feynman's 1981 proposals of quantum computing.
Open Quantum Assembly Language is a programming language designed for describing quantum circuits and algorithms for execution on quantum computers. It is designed to be an intermediate representation that can be used by higher-level compilers to communicate with quantum hardware, and allows for the description of a wide range of quantum operations, as well as classical feed-forward flow control based on measurement outcomes.
Quil is a quantum instruction set architecture 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. Many quantum algorithms require a shared memory architecture. Quil is being developed for the superconducting quantum processors developed by Rigetti Computing through the Forest quantum programming API. A Python library called pyQuil
was introduced to develop Quil programs with higher level constructs. A Quil backend is also supported by other quantum programming environments.
In quantum computing, a qubit is a unit of information analogous to a bit in classical computing, but it is affected by quantum mechanical properties such as superposition and entanglement which allow qubits to be in some ways more powerful than classical bits for some tasks. Qubits are used in quantum circuits and quantum algorithms composed of quantum logic gates to solve computational problems, where they are used for input/output and intermediate computations.
Quantum volume is a metric that measures the capabilities and error rates of a quantum computer. It expresses the maximum size of square quantum circuits that can be implemented successfully by the computer. The form of the circuits is independent from the quantum computer architecture, but compiler can transform and optimize it to take advantage of the computer's features. Thus, quantum volumes for different architectures can be compared.
Qiskit is an open-source software development kit (SDK) for working with quantum computers at the level of circuits, pulses, and algorithms. It provides tools for creating and manipulating quantum programs and running them on prototype quantum devices on IBM Quantum Platform or on simulators on a local computer. It follows the circuit model for universal quantum computation, and can be used for any quantum hardware that follows this model.
This glossary of quantum computing is a list of definitions of terms and concepts used in quantum computing, its sub-disciplines, and related fields.