Content deleted Content added
Added information on QIR and restructured the introduction to clean up tonal issues. |
Countercheck (talk | contribs) copyedit |
||
(11 intermediate revisions by 9 users not shown) | |||
Line 5:
'''Quantum programming''' refers to the process of designing and implementing algorithms that operate on [[quantum computing| quantum systems]], typically using quantum circuits composed of quantum gates, measurements, and classical control logic. These circuits are developed to manipulate quantum states for specific computational tasks or experimental outcomes. Quantum programs may be executed on quantum processors, simulated on classical hardware, or implemented through laboratory instrumentation for research purposes.
When working with quantum processor-based systems, quantum programming languages provide high-level abstractions to express quantum algorithms efficiently. These languages often integrate with classical programming environments and support hybrid quantum-classical workflows. The development of quantum software has been strongly influenced by the [[open-source]] community, with many toolkits and frameworks—such as [[Qiskit]], [[Cirq]], PennyLane, and qBraid SDK—available under open licenses.<ref>{{Cite journal|last1=Häner|first1=Thomas |last2=Steiger|first2=Damian S.|last3=Svore|first3=Krysta|author3-link= Krysta Svore |last4=Troyer|first4=Matthias|date=2018|title=A software methodology for compiling quantum programs|journal=Quantum Science and Technology|volume=3|issue=2|pages=020501|doi=10.1088/2058-9565/aaa5cc|issn=2058-9565|arxiv=1604.01401|bibcode=2018QS&T....3b0501H }}</ref><ref>{{Cite web|url=https://github.com/qiskit/qiskit|title=Qiskit GitHub repository|website=GitHub}}</ref>
Quantum programming can also be used to model or control experimental systems through quantum instrumentation and sensor-based platforms. While some quantum computing architectures—such as [[linear optical quantum computing]] using the [[KLM protocol]]—require specialized hardware, others use gate-based quantum processors accessible through software interfaces. In both cases, quantum programming serves as the bridge between theoretical algorithms and physical implementation.
Line 20:
=== OpenQASM ===
{{Main|OpenQASM}}
[[OpenQASM]]<ref>{{Citation|title=qiskit-openqasm: OpenQASM specification|date=2017-07-04|url=https://github.com/IBM/qiskit-openqasm|publisher=International Business Machines|access-date=2017-07-06}}</ref> is the intermediate representation introduced by IBM for use with [[#Qiskit|Qiskit]] and the
=== QIR ===
Line 27:
=== Quil ===
{{Main|Quil (instruction set architecture)}}
[[Quil (instruction set architecture)|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''.<ref>{{cite arXiv |eprint=1608.03355 |title=A Practical Quantum Instruction Set Architecture |last1=Smith |first1=Robert S. |last2=Curtis |first2=Michael J. |last3=Zeng |first3=William J. |year=2016 |class=quant-ph }}</ref>
== Quantum software development kits ==
Line 37:
==== Cirq ====
{{Main|Cirq}}
An open source project developed by [[Google]], which uses the [[Python programming]] language to create and manipulate quantum circuits.
==== Classiq ====
Line 43:
==== 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.<ref>{{Cite web
==== MindQuantum ====
Line 50:
==== 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.{{citation needed|date=June 2021}}
==== PennyLane ====
An [[open-source software|open-source]]
==== Perceval ====
An open-source project created by {{interlanguage link|Quandela|fr}} for designing photonic quantum circuits and developing quantum algorithms, based on [[Python (programming language)|Python]]. Simulations are run either on the user's own computer or on the [[cloud computing|cloud]]. Perceval is also used to connect to Quandela's cloud-based [[List of quantum processors|photonic quantum processor]].<ref>{{cite news |title=La puissance d'un ordinateur quantique testée en ligne (The power of a quantum computer tested online) |newspaper=Le Monde.fr |date=November 22, 2022 |url=https://www.lemonde.fr/sciences/article/2022/11/22/la-puissance-d-un-ordinateur-quantique-testee-en-ligne_6151063_1650684.html |publisher=Le Monde}}</ref><ref>{{cite journal |last1=Heurtel |first1=Nicolas |last2=Fyrillas |first2=Andreas |last3=de Gliniasty |first3=Grégoire |last4=Le Bihan |first4=Raphaël |last5=Malherbe |first5=Sébastien |last6=Pailhas |first6=Marceau |last7=Bertasi |first7=Eric |last8=Bourdoncle |first8=Boris |last9=Emeriau |first9=Pierre-Emmanuel |last10=Mezher |first10=Rawad |last11=Music |first11=Luka |last12=Belabas |first12=Nadia |last13=Valiron |first13=Benoît |last14=Senellart |first14=Pascale |last15=Mansfield |first15=Shane |last16=Senellart |first16=Jean |title=Perceval: A Software Platform for Discrete Variable Photonic Quantum Computing |journal=Quantum |date=February 21, 2023 |volume=7 |page=931 |doi=10.22331/q-2023-02-21-931 |arxiv=2204.00602 |bibcode=2023Quant...7..931H |s2cid=247922568 |url=https://quantum-journal.org/papers/q-2023-02-21-931/}}</ref>[[File:QProg1-Refreshed.png|thumb|upright=2.4|Sample code using projectq with Python]]
==== ProjectQ ====
An open source project developed at the Institute for Theoretical Physics at [[ETH]], which uses the
==== qBraid SDK ====
Line 70 ⟶ 68:
{{Main|Qiskit}}
An open source project developed by [[IBM]].<ref>{{Cite web|url=https://qiskit.org/|title=qiskit.org|website=qiskit.org}}</ref> Quantum circuits are created and manipulated using
==== Qrisp ====
[[Eclipse Qrisp|Qrisp]]<ref>{{cite web|title = Qrisp official website|url=https://www.qrisp.eu/}}</ref> is an open source project coordinated by the [[Eclipse Foundation]]<ref>{{cite web |title=Eclipse Foundation (website) |url=https://www.eclipse.org/org/foundation/}}</ref> and developed in
==== Quantum Development Kit ====
A project developed by [[Microsoft]]<ref>{{Cite web|url=https://learn.microsoft.com/en-us/azure/quantum/|title=Azure Quantum documentation, QDK & Q# API reference - Azure Quantum|website=learn.microsoft.com}}</ref> as part of the [[.NET Framework]]. Quantum programs can be written and run within [[Visual Studio]] and [[VSCode]] using the quantum programming language Q#.
==== Strawberry Fields ====
An [[open-source software|open-source]]
==== t|ket> ====
A quantum programming environment and optimizing compiler developed by
==== Wolfram Quantum Framework ====
An add-on [[Wolfram Language]] paclet that provides a symbolic, high-level representation for quantum objects such as basis, states, operators, channels, measurements, and circuits, integrated with [[Mathematica]].<ref name=qf>{{Cite web|url=https://resources.wolframcloud.com/PacletRepository/resources/Wolfram/QuantumFramework/|title=QuantumFramework |website=resources.wolframcloud.com|access-date=2025-08-18}}</ref> The framework includes tools for simulation and analysis—such as time evolution, measurement simulation, entanglement monotones, partial trace/transpose, discrete Wigner transforms, stabilizer methods, and tensor-network utilities—as well as a library of named constructs (e.g., Bell/GHZ states, [[Pauli matrices|Pauli operators]], Fourier, Grover etc).<ref name=qf/> It offers built-in visualization (e.g., circuit diagrams and Bloch-sphere plots) and interoperability with external platforms, including conversion to Qiskit and Amazon Braket formats and the ability to send queries to quantum processing units (QPUs) via service connections.
== Quantum programming languages ==
Line 90 ⟶ 89:
=== Imperative languages ===
The most prominent representatives of the imperative languages are QCL,<ref>{{cite web |author=
==== Ket ====
Ket<ref>{{Cite journal |last1=Da Rosa |first1=Evandro Chagas Ribeiro |last2=De Santiago |first2=Rafael |date=2022-01-31 |title=Ket Quantum Programming |url=https://dl.acm.org/doi/10.1145/3474224 |journal=ACM Journal on Emerging Technologies in Computing Systems |language=en |volume=18 |issue=1 |pages=1–25 |doi=10.1145/3474224 |issn=1550-4832|url-access=subscription }}</ref> 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,<ref>{{Cite web |title=Ket Quantum Programming |url=https://quantumket.org |access-date=2023-05-18 |website=quantumket.org |language=en}}</ref> seamlessly integrating with a [[Rust (programming language)|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:<syntaxhighlight lang="python" line="1">
from ket import *
a, b = quant(2) # Allocate two quantum bits
Line 105 ⟶ 104:
==== LQP ====
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.<ref name="LQP">A. Baltag and S. Smets, [https://arxiv.org/abs/2110.01361 "LQP: The Dynamic Logic of Quantum Information"], Mathematical Structures in Computer Science 16(3):491-525, 2006.</ref><ref name="PLQP">{{cite journal | url=https://link.springer.com/article/10.1007/s10773-013-1987-3 | doi=10.1007/s10773-013-1987-3 | title=PLQP & Company: Decidable Logics for Quantum Algorithms | year=2014 | last1=Baltag | first1=Alexandru | last2=Bergfeld | first2=Jort | last3=Kishida | first3=Kohei | last4=Sack | first4=Joshua | last5=Smets | first5=Sonja | last6=Zhong | first6=Shengyang | journal=International Journal of Theoretical Physics | volume=53 | issue=10 | pages=3628–3647 | bibcode=2014IJTP...53.3628B | s2cid=254573992 | url-access=subscription }}</ref>
==== Q language ====
Q Language is the second implemented imperative quantum programming language.<ref>{{cite web |url=http://sra.itc.it/people/serafini/qlang/ |title=Software for the Q language |date=2001-11-23 |access-date=2017-07-20 |url-status=dead |archive-url=https://web.archive.org/web/20090620011647/http://sra.itc.it/people/serafini/qlang/ |archive-date=2009-06-20 }}</ref> 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.
Quantum memory is represented by class Qreg.
Line 135 ⟶ 134:
==== Qmod ====
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 [https://classiq.io 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> ====
Line 142 ⟶ 140:
==== Quantum pseudocode ====
Quantum pseudocode proposed by E. Knill is the first formalized language for description of [[quantum algorithm]]s.
==== Scaffold ====
Scaffold is a C-like language, that compiles to QASM and OpenQASM.
==== Silq ====
Line 151 ⟶ 149:
=== 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,<ref name="qpl">Peter Selinger, [http://www.mathstat.dal.ca/~selinger/papers.html#qpl "Towards a quantum programming language"], Mathematical Structures in Computer Science 14(4):527-586, 2004.</ref> and the [[Haskell]]-like language QML by Altenkirch and Grattage.<ref name="qml1">[http://www.cs.nott.ac.uk/~jjg/qml.html Jonathan Grattage: QML Research<!-- Bot generated title -->] {{Webarchive|url=https://web.archive.org/web/20080331114452/http://www.cs.nott.ac.uk/~jjg/qml.html |date=March 31, 2008 }} (website)</ref><ref name="qml2">T. Altenkirch, V. Belavkin, J. Grattage, A. Green, A. Sabry, J. K. Vizzotto, [http://sneezy.cs.nott.ac.uk/qml QML: A Functional Quantum Programming Language]. {{webarchive|url=https://web.archive.org/web/20060710201728/http://sneezy.cs.nott.ac.uk/QML/
==== LIQUi|> ====
Line 170 ⟶ 168:
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 function]]s.
The first attempt to define a quantum lambda calculus was made by Philip Maymin in 1996.<ref>Philip Maymin, [https://arxiv.org/abs/quant-ph/9612052 "Extending the Lambda Calculus to Express Randomized and Quantumized Algorithms"], 1996</ref> 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|date=February 2019}}
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)|Scheme]] programming language.<ref>{{cite web |author=
In 2004, Selinger and Valiron defined a [[strongly typed]] lambda calculus for quantum computation with a type system based on [[linear logic]].<ref>Peter Selinger, Benoˆıt Valiron, [https://www.mscs.dal.ca/~selinger/papers/qlambdabook.pdf "Quantum Lambda Calculus"].</ref>
==== Quipper ====
{{For|the education technology company|Quipper (company)}}
Quipper was published in 2013.<ref>{{cite web | url=http://www.mathstat.dal.ca/~selinger/quipper/ | title=The Quipper Language}}</ref><ref>{{cite web |author1=Green |first=Alexander S.
<syntaxhighlight lang="haskell">
Line 189 ⟶ 186:
return r
</syntaxhighlight>
==See also==
{{Portal|Computer programming}}
* [[List of quantum computing journals]]
== References ==
Line 203 ⟶ 204:
* [https://quantiki.org/wiki/quantum-programming-language Quantum programming language] in [http://www.quantiki.org/ Quantiki]
* [https://github.com/lanl/qmasm/wiki QMASM documentation]
*[https://pyquil.readthedocs.io/en/stable/index.html pyQuil documentation] including [https://pyquil.readthedocs.io/en/stable/intro.html Introduction to Quantum Computing]. {{Webarchive|url=https://web.archive.org/web/20180718165337/https://pyquil.readthedocs.io/en/stable/intro.html |date=July 18, 2018 }}
* [https://github.com/epiqc/ScaffCC Scaffold Source]
|