Content deleted Content added
Art LaPella (talk | contribs) m →External links: Typo fixing, Replaced: 2rd → 2nd, using AWB |
Countercheck (talk | contribs) copyedit |
||
(286 intermediate revisions by more than 100 users not shown) | |||
Line 1:
{{Short description|Computer programming for quantum computers}}
{{Primary sources|date=August 2024}}
{{Use mdy dates|date=February 2023}}
{{Use American English|date=February 2023}}
'''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.
== 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 trap]]s or [[Superconducting quantum computing|superconducting qubits]].
===
Blackbird<ref>{{Cite web|url=https://quantum-blackbird.readthedocs.io/en/latest/|title=Blackbird Quantum Assembly Language — Blackbird 0.2.0 documentation|website=quantum-blackbird.readthedocs.io|access-date=2019-06-24}}</ref><ref>{{Cite journal|last1=Weedbrook|first1=Christian|last2=Amy|first2=Matthew|last3=Bergholm|first3=Ville|last4=Quesada|first4=Nicolás|last5=Izaac|first5=Josh|last6=Killoran|first6=Nathan|date=2019-03-11|title=Strawberry Fields: A Software Platform for Photonic Quantum Computing|journal=Quantum|language=en-GB|volume=3|pages=129|doi=10.22331/q-2019-03-11-129|arxiv=1804.03159|bibcode=2019Quant...3..129K |s2cid=54763305}}</ref> is a quantum instruction set and intermediate representation used by [[Xanadu Quantum Technologies]] and Strawberry Fields. It is designed to represent [[Continuous-variable quantum information|continuous-variable]] quantum programs that can run on photonic quantum hardware.
=== cQASM ===
cQASM,<ref>{{Cite arXiv|last1=Bertels|first1=K.|last2=Almudever|first2=C. G.|last3=Hogaboam|first3=J. W.|last4=Ashraf|first4=I.|last5=Guerreschi|first5=G. G.|last6=Khammassi|first6=N.|date=2018-05-24|title=cQASM v1.0: Towards a Common Quantum Assembly Language|language=en|eprint=1805.09607v1|class=quant-ph}}</ref> 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 ===
{{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 IBM Quantum Platform.
=== QIR ===
'''Quantum Intermediate Representation''' (QIR) is a hardware-agnostic intermediate representation developed by [[Microsoft]] as part of the [[Quantum Development Kit]]. It is based on the [[LLVM]] compiler infrastructure and is designed to represent quantum programs in a way that supports optimization and execution across diverse quantum hardware backends.<ref>{{Cite web|title=Quantum Intermediate Representation (QIR) |url=https://github.com/qir-alliance/qir-spec|website=QIR Alliance|access-date=2025-06-02}}</ref> QIR serves as a common target for quantum compilers, enabling interoperation between different programming languages, such as Q#, and low-level hardware control layers. It is maintained by the [[QIR Alliance]], a collaborative group of academic and industry partners.
=== 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> Many quantum algorithms (including [[quantum teleportation]], [[quantum error correction]], simulation,<ref>{{Cite journal|last1=McClean|first1=Jarrod R.|last2=Romero|first2=Jonathan|last3=Babbush|first3=Ryan|last4=Aspuru-Guzik|first4=Alán|date=2016-02-04|title=The theory of variational hybrid quantum-classical algorithms|arxiv=1509.04279|journal=New Journal of Physics|volume=18|issue=2|pages=023023|doi=10.1088/1367-2630/18/2/023023|issn=1367-2630|bibcode=2016NJPh...18b3023M|s2cid=92988541}}</ref><ref>{{cite arXiv |eprint=1610.06910 |title=A Hybrid Classical/Quantum Approach for Large-Scale Studies of Quantum Systems with Density Matrix Embedding Theory |last1=Rubin |first1=Nicholas C. |last2=Curtis |first2=Michael J. |last3=Zeng |first3=William J. |year=2016 |class=quant-ph }}</ref> and optimization algorithms<ref>{{cite arXiv |eprint=1411.4028|title=A Quantum Approximate Optimization Algorithm|last1=Farhi|first1=Edward|last2=Goldstone|first2=Jeffrey|last3=Gutmann|first3=Sam|year=2014|class=quant-ph}}</ref>) require a shared memory architecture.
== Quantum software development kits ==
Quantum [[software development kit]]s provide collections of tools to create and manipulate quantum programs.<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 |s2cid=1922315 }}</ref> They also provide the means to simulate the quantum programs or prepare them to be run using [[cloud-based quantum computing|cloud-based quantum devices]] and self-hosted quantum devices.
=== SDKs with access to quantum processors ===
The following [[software development kit]]s can be used to run quantum circuits on prototype quantum devices, as well as on simulators.
==== Cirq ====
{{Main|Cirq}}
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]],<ref name="auto"/> [[Rigetti Computing|Rigetti]], and [[Alpine Quantum Technologies]].<ref name="auto2"/>
==== Classiq ====
A cloud-based quantum IDE developed by Classiq, uses a high-level quantum language, [[#Qmod|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.
==== 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 |title=Welcome to the Documentation for Grove! – Grove 1.7.0 documentation |url=https://grove-docs.readthedocs.io/en/latest/ |website=grove-docs.readthedocs.io}}</ref> Forest is based on the [[Quil (instruction set architecture)|Quil]] instruction set.
==== MindQuantum ====
MindQuantum is a quantum computing framework based on [[MindSpore]], focusing on the implementation of [[NISQ]] algorithms.<ref>{{Cite web|url=https://www.mindspore.cn/mindquantum/docs/en/master/index.html|title=MindSpore Quantum Documentation|website=www.mindspore.cn/mindquantum}}</ref><ref>{{Cite arXiv|title=MindSpore Quantum: A User-Friendly, High-Performance, and AI-Compatible Quantum Computing Framework|eprint=2406.17248 |last1=Xu |first1=Xusheng |last2=Cui |first2=Jiangyu |last3=Cui |first3=Zidong |last4=He |first4=Runhong |last5=Li |first5=Qingyu |last6=Li |first6=Xiaowei |last7=Lin |first7=Yanling |last8=Liu |first8=Jiale |last9=Liu |first9=Wuxin |last10=Lu |first10=Jiale |last11=Luo |first11=Maolin |last12=Lyu |first12=Chufan |last13=Pan |first13=Shijie |last14=Pavel |first14=Mosharev |last15=Shu |first15=Runqiu |last16=Tang |first16=Jialiang |last17=Xu |first17=Ruoqian |last18=Xu |first18=Shu |last19=Yang |first19=Kang |last20=Yu |first20=Fan |last21=Zeng |first21=Qingguo |last22=Zhao |first22=Haiying |last23=Zheng |first23=Qiang |last24=Zhou |first24=Junyuan |last25=Zhou |first25=Xu |last26=Zhu |first26=Yikang |last27=Zou |first27=Zuoheng |last28=Bayat |first28=Abolfazl |last29=Cao |first29=Xi |last30=Cui |first30=Wei |date=2024 |class=quant-ph |display-authors=1 }}</ref><ref>{{Cite web|url=https://github.com/mindspore-ai/mindquantum|title=mindquantum|website=github.com}}</ref>
====
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]] Python library developed by [[Xanadu Quantum Technologies]] for [[differentiable programming]] of quantum computers.<ref>{{Cite web |title=PennyLane 0.14.1 documentation |url=https://pennylane.readthedocs.io/en/stable/ |access-date=2021-03-26 |website=pennylane.readthedocs.io}}</ref><ref>{{Cite web|date=2021-02-17|title=AWS joins PennyLane, an open-source framework that melds machine learning with quantum computing|url=https://siliconangle.com/2021/02/17/aws-throws-weight-behind-pennylane-open-source-framework-melds-machine-learning-quantum-computing/|access-date=2021-03-26|website=SiliconANGLE|language=en-US}}</ref><ref>{{Cite web|date=2021-02-26|title=SD Times Open-Source Project of the Week: PennyLane|url=https://sdtimes.com/open-source/sd-times-open-source-project-of-the-week-pennylane/|access-date=2021-03-26|website=SD Times|language=en-US}}</ref><ref>{{Cite web|last=Salamone|first=Salvatore|date=2020-12-13|title=Real-time Analytics News Roundup for Week Ending December 12|url=https://www.rtinsights.com/real-time-analytics-news-roundup-for-week-ending-december-12/|access-date=2021-03-26|website=RTInsights|language=en-US}}</ref> PennyLane provides users the ability to create models using [[TensorFlow]], [[NumPy]], or [[PyTorch]], and connect them with quantum computer backends available from [[IBM Quantum Experience|IBMQ]], [[Google|Google Quantum]], [[Rigetti Computing|Rigetti]], [[Quantinuum]]<ref name="auto1">{{Cite web|url=https://www.quantinuum.com/|title=Accelerating Quantum Computing|website=www.quantinuum.com}}</ref> and [[Alpine Quantum Technologies]].<ref name="auto2">{{Cite web|url=https://www.aqt.eu/|title=Home|website=AQT | ALPINE QUANTUM TECHNOLOGIES}}</ref><ref>{{Cite web |title=Plugins and ecosystem |url=https://pennylane.ai/plugins.html |url-status=dead |archive-url=https://web.archive.org/web/20210926151326/https://pennylane.ai/plugins.html |archive-date=September 26, 2021 |access-date=2021-03-26 |website=pennylane.ai |language=en}}</ref>
==== 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 Python programming language to create and manipulate quantum circuits.<ref>{{Cite web|url=https://projectq.ch/|title=Home}}</ref> Results are obtained either using a simulator, or by sending jobs to IBM quantum devices.
==== qBraid SDK ====
The qBraid SDK is an [[open-source|open-source]] platform-agnostic quantum runtime framework developed by qBraid. It enables users to write quantum programs once and execute them across various quantum hardware and simulators without modifying the code. The SDK supports multiple quantum programming libraries, including Qiskit, Cirq, PennyLane, PyQuil, and Braket, among others. It features a graph-based transpiler that facilitates conversion between different quantum program types, allowing seamless interoperability between frameworks. The SDK also provides tools for job submission, result retrieval, and circuit visualization. It is integrated with qBraid Lab, offering access to over 20 quantum devices and simulators from providers such as IonQ, Rigetti, QuEra, and IQM.<ref>{{Cite web|url=https://docs.qbraid.com/sdk/user-guide/overview|title=qBraid SDK Overview|website=docs.qbraid.com}}</ref><ref>{{Cite web|url=https://www.qbraid.com/blog-posts/qbraid-announces-qbraid-sdk-integrated-with-amazon-braket|title=qBraid Announces qBraid SDK Integrated with Amazon Braket on qBraid Lab|website=qbraid.com}}</ref>
==== Qibo ====
An open source full-stack API for quantum simulation, quantum hardware control and calibration developed by multiple research laboratories, including [[Technology Innovation Institute|QRC]], [[Centre for Quantum Technologies|CQT]] and [[Istituto Nazionale di Fisica Nucleare|INFN]]. [https://github.com/qiboteam/qibo Qibo] is a modular framework which includes multiple backends for quantum simulation and hardware control.<ref>{{Cite journal |last1=Efthymiou |first1=Stavros |last2=Ramos-Calderer |first2=Sergi |last3=Bravo-Prieto |first3=Carlos |last4=Pérez-Salinas |first4=Adrián |last5=García-Martín |first5=Diego |last6=Garcia-Saez |first6=Artur |last7=Latorre |first7=José Ignacio |last8=Carrazza |first8=Stefano |date=2022-01-01 |title=Qibo: a framework for quantum simulation with hardware acceleration |url=https://iopscience.iop.org/article/10.1088/2058-9565/ac39f5 |journal=Quantum Science and Technology |volume=7 |issue=1 |pages=015018 |doi=10.1088/2058-9565/ac39f5 |arxiv=2009.01845 |bibcode=2022QS&T....7a5018E |hdl=2434/887963 |s2cid=221507478 |issn=2058-9565}}</ref><ref>{{Cite journal |last1=Efthymiou |first1=Stavros |last2=Lazzarin |first2=Marco |last3=Pasquale |first3=Andrea |last4=Carrazza |first4=Stefano |date=2022-09-22 |title=Quantum simulation with just-in-time compilation |url=https://quantum-journal.org/papers/q-2022-09-22-814/ |journal=Quantum |language=en-GB |volume=6 |pages=814 |doi=10.22331/q-2022-09-22-814|arxiv=2203.08826 |bibcode=2022Quant...6..814E |s2cid=247518955 |doi-access=free }}</ref> This project aims at providing a platform agnostic quantum hardware control framework with drivers for multiple instruments<ref>{{Cite web|url=https://github.com/qiboteam/qibolab|title=Qibolab|date=November 2, 2022|via=GitHub}}</ref> and tools for quantum calibration, characterization and validation.<ref>{{Cite web|url=https://github.com/qiboteam/qibocal|title=Qibocal|date=November 1, 2022|via=GitHub}}</ref> This framework focuses on self-hosted quantum devices by simplifying the software development required in labs.
==== Qiskit ====
{{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 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.<ref>{{cite web |url=https://qiskit.org/overview/ |title=Qiskit Overview |access-date=2021-02-10}}</ref> Qiskit is based on the [[OpenQASM]] standard for representing quantum circuits. It also supports pulse level control of quantum systems via QiskitPulse standard.<ref>{{cite arXiv |eprint=1809.03452|title=Qiskit Backend Specifications for OpenQASM and OpenPulse Experiments|last1=McKay|first1=David C.|last2=Alexander|first2=Thomas|last3=Bello|first3=Luciano|last4=Biercuk|first4=Michael J.|last5=Bishop|first5=Lev|last6=Chen|first6=Jiayin|last7=Chow|first7=Jerry M.|last8=Córcoles|first8=Antonio D.|last9=Egger|first9=Daniel|last10=Filipp|first10=Stefan|last11=Gomez|first11=Juan|last12=Hush|first12=Michael|last13=Javadi-Abhari|first13=Ali|last14=Moreda|first14=Diego|last15=Nation|first15=Paul|last16=Paulovicks|first16=Brent|last17=Winston|first17=Erick|last18=Wood|first18=Christopher J.|last19=Wootton|first19=James|last20=Gambetta|first20=Jay M.|year=2018|class=quant-ph}}</ref>
==== 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 Python programming by [[Fraunhofer FOKUS]]<ref>{{cite web |title=Fraunhofer FOKUS (website) |url=https://www.fokus.fraunhofer.de/}}</ref> 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.
==== 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#. Programs developed in the QDK can be run on Microsoft's [[Microsoft Azure Quantum| Azure Quantum]],<ref>{{Cite web|url=https://learn.microsoft.com/en-us/azure/quantum/overview-azure-quantum|title=What is Azure Quantum? - Azure Quantum|website=learn.microsoft.com|date=January 11, 2023 }}</ref> and run on quantum computers from [[Quantinuum]],<ref name="auto1"/> [[IonQ]], and [[Pasqal]].<ref name="auto">{{Cite web|url=https://pasqal.io/|title=PASQAL|website=PASQAL}}{{Dead link|date=July 2025 |bot=InternetArchiveBot |fix-attempted=yes }}</ref>
==== Strawberry Fields ====
An [[open-source software|open-source]] Python [[Library (computing)|library]] developed by [[Xanadu Quantum Technologies]] for designing, simulating, and optimizing [[Continuous-variable quantum information|continuous variable]] (CV) [[Quantum optics|quantum optical]] circuits.<ref>{{Cite web |title=Strawberry Fields – Strawberry Fields 0.8.0 documentation |url=https://strawberryfields.readthedocs.io/en/latest/ |access-date=2018-09-25 |website=strawberryfields.readthedocs.io |language=en}}</ref><ref>{{cite journal|last1=Killoran|first1=Nathan|last2=Izaac|first2=Josh|last3=Quesada|first3=Nicolás|last4=Bergholm|first4=Ville|last5=Amy|first5=Matthew|last6=Weedbrook|first6=Christian|year=2019|title=Strawberry Fields: A Software Platform for Photonic Quantum Computing|journal=Quantum|volume=3|pages=129|arxiv=1804.03159|doi=10.22331/q-2019-03-11-129|bibcode=2019Quant...3..129K |s2cid=54763305}}</ref> Three simulators are provided—one in the [[Fock state|Fock basis]], one using the Gaussian formulation of quantum optics,<ref>{{Cite journal|last1=Weedbrook|first1=Christian|last2=Pirandola|first2=Stefano|last3=García-Patrón|first3=Raúl|last4=Cerf|first4=Nicolas J.|last5=Ralph|first5=Timothy C.|last6=Shapiro|first6=Jeffrey H.|last7=Lloyd|first7=Seth|date=2012-05-01|title=Gaussian quantum information|journal=Reviews of Modern Physics|volume=84|issue=2|pages=621–669|arxiv=1110.3234|bibcode=2012RvMP...84..621W|doi=10.1103/RevModPhys.84.621|s2cid=119250535}}</ref> and one using the [[TensorFlow]] machine learning library. Strawberry Fields is also the library for executing programs on Xanadu's quantum photonic hardware.<ref>{{Cite web |title=Hardware |url=https://strawberryfields.ai/photonics/hardware/index.html |access-date=2021-03-26 |website=strawberryfields.ai}}</ref><ref>{{Cite web|title=In the Race to Hundreds of Qubits, Photons May Have "Quantum Advantage"|url=https://spectrum.ieee.org/race-to-hundreds-of-photonic-qubits-xanadu-scalable-photon|access-date=2021-03-26|website=IEEE Spectrum: Technology, Engineering, and Science News|date=5 March 2021|language=en}}</ref>
==== t|ket> ====
A quantum programming environment and optimizing compiler developed by Quantinuum that targets simulators and several trapped-ion quantum hardware backends, released in December 2018.<ref>{{cite web |title=pytket|website=[[GitHub]]|date=22 January 2022|url=https://github.com/CQCL/pytket}}</ref>
==== 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 ==
There are two main groups of quantum programming languages: [[Imperative programming|imperative]] quantum programming languages and [[Functional programming|functional]] quantum programming languages.
=== Imperative languages ===
The most prominent representatives of the imperative languages are QCL,<ref>{{cite web |author=Omer |first=Bernhard |title=The QCL Programming Language |url=http://tph.tuwien.ac.at/~oemer/qcl.html}}</ref> LanQ<ref>{{cite web |author=Hynek Mlnařík |title=LanQ – a quantum imperative programming language |url=https://lanq.sourceforge.net/}}</ref> and Q|SI>.<ref name=":0" />
==== 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
H(a) # Put qubit `a` in a superposition
cnot(a, b) # Entangle the two qubits in the Bell state
m_a = measure(a) # Measure qubit `a`, collapsing qubit `b` as well
m_b = measure(b) # Measure qubit `b`
# Assert that the measurement of both qubits will always be equal
assert m_a.value == m_b.value
</syntaxhighlight>
==== 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. New operators can be defined using C++ class mechanism.
Quantum memory is represented by class Qreg.
<syntaxhighlight lang="cpp">
Qreg x1; // 1-qubit quantum register with initial value 0
Qreg x2(2,0); // 2-qubit quantum register with initial value 0
</syntaxhighlight>
The computation process is executed using a provided simulator. Noisy environments can be simulated using parameters of the simulator.
==== Q# ====
{{Main|Q Sharp}}
A language developed by [[Microsoft]] to be used with the [[#Quantum Development Kit|Quantum Development Kit]].<ref>{{Cite web|url=https://learn.microsoft.com/en-us/azure/quantum/overview-what-is-qsharp-and-qdk|title=Introduction to Q# & Quantum Development Kit - Azure Quantum|website=learn.microsoft.com|date=March 30, 2023 }}</ref>
====
{{Main|Quantum Computation Language}}
[[Quantum Computation Language]] (QCL) is one of the first implemented quantum [[programming languages]].<ref>{{cite web|url=http://tph.tuwien.ac.at/~oemer/qcl.html |title=QCL - A Programming Language for Quantum Computers |website=tuwien.ac.at |access-date=2017-07-20}}</ref> 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)|C programming language]] and its classical [[data type]]s are similar to primitive data types in C. One can combine classical code and quantum code in the same program.
==== 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
==== QMASM ====
Quantum Macro Assembler (QMASM) is a low-level language specific to quantum annealers such as the D-Wave.<ref>Scott Pakin, [https://ieeexplore.ieee.org/document/7761637/ "A Quantum Macro Assembler"], Proceedings of the 20th Annual IEEE High Performance Extreme Computing Conference 2016</ref>
====
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> is a platform embedded in [[.NET Framework|.Net]] language supporting quantum programming in a quantum extension of while-language.<ref name=":0">{{Cite journal|last1=Liu|first1=Shusen|last2=Zhou|first2=li|last3=Guan|first3=Ji|last4=He|first4=Yang|last5=Duan|first5=Runyao|last6=Ying|first6=Mingsheng|date=2017-05-09|title=Q|SI>: A Quantum Programming Language|journal=Scientia Sinica Informationis|volume=47|issue=10|pages=1300|doi=10.1360/N112017-00095|arxiv=1710.09500|s2cid=9163705}}</ref><ref>{{Cite journal|last=Ying|first=Mingsheng|date=January 2012|title=Floyd–hoare Logic for Quantum Programs|journal=ACM Trans. Program. Lang. Syst.|volume=33|issue=6|pages=19:1–19:49|doi=10.1145/2049706.2049708|s2cid=416960|issn=0164-0925|doi-access=free}}</ref> This platform includes a compiler of the quantum while-language<ref>{{Cite journal|last1=Ying|first1=Mingsheng|last2=Feng|first2=Yuan|date=2010|title=A Flowchart Language for Quantum Programming|url=https://www.computer.org/csdl/trans/ts/2011/04/tts2011040466-abs.html|journal=IEEE Transactions on Software Engineering|volume=37|issue=4|pages=466–485|doi=10.1109/TSE.2010.94|s2cid=5879273|issn=0098-5589}}</ref> and a chain of tools for the simulation of quantum computation, optimisation of quantum circuits, termination analysis of quantum programs,<ref>{{Cite journal|last1=Ying|first1=Mingsheng|last2=Yu|first2=Nengkun|last3=Feng|first3=Yuan|last4=Duan|first4=Runyao|title=Verification of quantum programs|journal=Science of Computer Programming|volume=78|issue=9|pages=1679–1700|doi=10.1016/j.scico.2013.03.016|year=2013|arxiv=1106.4063|s2cid=18913620}}</ref> and verification of quantum programs.<ref>{{Citation |doi=10.1145/3093333.3009840|hdl=10453/127333 |title=Invariants of quantum programs: Characterisations and generation |date=2017 |last1=Ying |first1=Mingsheng |last2=Ying |first2=Shenggang |last3=Wu |first3=Xiaodi |journal=ACM SIGPLAN Notices |volume=52 |pages=818–832 |hdl-access=free }}</ref><ref>{{cite arXiv |eprint=1601.03835|title=A Theorem Prover for Quantum Hoare Logic and its Applications|last1=Liu|first1=Tao|last2=Li|first2=Yangjia|last3=Wang|first3=Shuling|last4=Ying|first4=Mingsheng|last5=Zhan|first5=Naijun|year=2016|class=cs.LO}}</ref>
==== Quantum pseudocode ====
Quantum pseudocode proposed by E. Knill is the first formalized language for description of [[quantum algorithm]]s. It was introduced and, moreover, was tightly connected with a model of quantum machine called [[Quantum Random Access Machine]] (QRAM).
==== Scaffold ====
Scaffold is a 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.<ref>{{cite web |last1=Javadi-Abhari |first1=Ali |title=Scaffold: Quantum Programming Language |url=https://www.cs.princeton.edu/research/techreps/TR-934-12 |website=Princeton University-Department of Computer Science |publisher=Princeton University |access-date=22 September 2020 |archive-date=September 20, 2020 |archive-url=https://web.archive.org/web/20200920090057/https://www.cs.princeton.edu/research/techreps/TR-934-12 |url-status=dead }}</ref><ref>{{cite journal |last1=Litteken |first1=Andrew |title=An updated LLVM-based quantum research compiler with further OpenQASM support |journal=Quantum Science and Technology |date=28 May 2020 |volume=5 |issue=3 |page=034013 |doi=10.1088/2058-9565/ab8c2c |bibcode=2020QS&T....5c4013L |osti=1803951 |s2cid=219101628 |doi-access=free }}</ref>
====
Silq is a high-level programming language for quantum computing with a strong static type system, developed at [[ETH Zurich|ETH Zürich]].<ref>{{Cite web|title=What is Silq?|url=https://silq.ethz.ch/|access-date=2020-06-21|website=silq.ethz.ch}}</ref><ref>{{Cite book|last1=Bichsel|first1=Benjamin|last2=Baader|first2=Maximilian|last3=Gehr|first3=Timon|last4=Vechev|first4=Martin|title=Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation |chapter=Silq: A high-level quantum language with safe uncomputation and intuitive semantics |date=2020-06-11|language=en|___location=London UK|publisher=ACM|pages=286–300|doi=10.1145/3385412.3386007|isbn=978-1-4503-7613-6|s2cid=219397029}}</ref>
=== 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/|date=2006-07-10}} (website).</ref> Higher-order quantum programming languages, based on [[lambda calculus]], have been proposed by van Tonder,<ref>Andre van Tonder (2004), [https://dx.doi.org/10.1137/S0097539703432165 "A Lambda Calculus for Quantum Computation"], SIAM J. Comput., 33(5), pp. 1109–1135. Also available from [[arXiv:quant-ph/0307150]].</ref> Selinger and Valiron<ref>Peter Selinger and Benoît Valiron (2006), [http://www.mathstat.dal.ca/~selinger/papers/#qlambda "A lambda calculus for quantum computation with classical control"], Mathematical Structures in Computer Science 16(3): 527–552.</ref> and by Arrighi and Dowek.<ref>Pablo Arrighi, Gilles Dowek, [http://www.arxiv.org/abs/quant-ph/0612199 "Linear-algebraic lambda-calculus: higher-order, encodings and confluence"], 2006.</ref>
==== LIQUi|> ====
LIQUi|> (pronounced ''liquid'') is a quantum simulation extension on the [[F Sharp (programming language)|F#]] programming language.<ref>{{cite web|url=https://stationq.github.io/Liquid/|title=The Language Integrated Quantum Operations Simulator |website=github.io |access-date=2017-07-20}}</ref> It is currently being developed by the Quantum Architectures and Computation Group (QuArC)<ref>Quantum Architectures and Computation Group (QuArC), https://www.microsoft.com/en-us/research/group/quantum-architectures-and-computation-group-quarc/, 2011</ref> 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.<ref>{{cite web|url=https://stationq.microsoft.com/ |title=StationQ |website=microsoft.com |access-date=2017-07-20}}</ref>
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.<ref>{{cite web|url=https://www.microsoft.com/en-us/research/project/language-integrated-quantum-operations-liqui/|title=Language-Integrated Quantum Operations: LIQUi|>|website=[[Microsoft]]|date=2016}}</ref>
==== 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 [[superoperator]]s.
==== QML ====
QML is a [[Haskell]]-like quantum programming language by Altenkirch and Grattage.<ref>{{cite web |url=http://sneezy.cs.nott.ac.uk/QML/ |title=QML: A Functional Quantum Programming Language |date=2007-09-26 |archive-url=https://web.archive.org/web/20070926230222/http://sneezy.cs.nott.ac.uk/QML/ |archive-date=2007-09-26}}</ref><ref name="qml1"/> 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 <math>|\phi\rangle</math> to <math>|\phi\rangle\otimes|\phi\rangle</math>, and is not to be confused with the impossible operation of [[no-cloning theorem|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 circuit]]s, while a [[denotational semantics]] is presented in terms of [[superoperator]]s, and these are shown to agree. Both the operational and denotational semantics have been implemented (classically) in Haskell.<ref>Jonathan Grattage, [http://sneezy.cs.nott.ac.uk/qml/compiler QML: A Functional Quantum Programming Language (compiler)] {{Webarchive|url=https://web.archive.org/web/20160305052237/http://sneezy.cs.nott.ac.uk/qml/compiler/ |date=2016-03-05 }}, 2005–2008</ref>
==== 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 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=van Tonder |first=André |title=A lambda calculus for quantum computation (website) |url=https://www.het.brown.edu/people/andre/qlambda |url-status=dead |archive-url=https://web.archive.org/web/20160305100936/http://www.het.brown.edu/people/andre/qlambda/ |archive-date=March 5, 2016 |access-date=October 2, 2007}}</ref>
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. |author2=Lumsdaine |first2=Peter LeFanu |author3=Ross |first3=Neil J. |author4=Selinger |first4=Peter |author5=Valiron |first5=Benoît |title=The Quipper Language (website) |url=http://www.mathstat.dal.ca/~selinger/quipper/}}</ref> It is implemented as an embedded language, using [[Haskell]] as the host language.<ref>{{Cite book |author1=Alexander S. Green |author2=Peter LeFanu Lumsdaine |author3=Neil J. Ross |author4=Peter Selinger |author5=Benoît Valiron |title=Reversible Computation |chapter=An Introduction to Quantum Programming in Quipper |arxiv=1304.5485|year=2013 |doi=10.1007/978-3-642-38986-3_10 |volume=7948 |pages=110–124|series=Lecture Notes in Computer Science |isbn=978-3-642-38985-6 |s2cid=9135905 }}</ref> 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
<syntaxhighlight lang="haskell">
import Quipper
spos :: Bool -> Circ Qubit
spos b = do q <- qinit b
r <- hadamard q
return r
</syntaxhighlight>
==See also==
{{Portal|Computer programming}}
* [[List of quantum computing journals]]
== References ==
{{reflist}}
== Further reading ==
* {{ Cite book |title=Foundations of quantum programming |last=Mingsheng |first=Ying |publisher=Morgan Kaufmann |isbn=978-0-4431-5942-8 |id=978-0-4431-5943-5 (eBook) |edition=2nd |___location=Cambridge, Massachusetts |oclc=1406095194 |date=2024 }}
* {{Cite book |title=Quantum Software Engineering |publisher=Springer |year=2022 |isbn=978-3-031-05323-8 |edition=1st|___location=Cham, Switzerland |editor-last=Serrano |editor-first=Manuel A. |doi=10.1007/978-3-031-05324-5 |oclc=1347696597 |id=978-3-031-05326-9 (softcover) & 978-3-031-05324-5 (eBook) |editor-last2=Pérez-Castillo |editor-first2=Ricardo |editor-last3=Piattini |editor-first3=Mario}}
== External links ==
* [https://github.com/qosf/awesome-quantum-software Curated list] of all quantum open-source software projects
* [http://www.
* [
* [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]
{{Quantum computing}}
{{emerging technologies|quantum=yes|other=yes}}
{{Programming paradigms navbox}}
[[Category:Quantum programming| ]]
[[Category:Programming language classification]]
[[Category:Programming paradigms]]
[[Category:Quantum computing]]
|