Quantum programming: Difference between revisions

Content deleted Content added
SDKs with access to quantum processors: Add short descrioption of MindQuantum, which is another example of such SDK
Tag: Reverted
copyedit
 
(24 intermediate revisions by 16 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''' isrefers to the process of designing orand implementing algorithms that operate on [[Assemblyquantum language computing|assembling quantum systems]], sequencestypically of instructions, calledusing quantum circuits, usingcomposed of quantum gates, switchesmeasurements, and operatorsclassical control logic. These circuits are developed to manipulate a quantum systemstates for aspecific desiredcomputational outcometasks or resultsexperimental of a given experimentoutcomes. Quantum circuitprograms algorithms canmay be implementedexecuted on integratedquantum circuitsprocessors, conductedsimulated withon instrumentationclassical hardware, or writtenimplemented inthrough alaboratory programming languageinstrumentation for use with a [[Quantum computing|quantum computer]] or a quantumresearch processorpurposes.
 
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>
With quantum processor based systems, quantum [[programming language]]s help express [[quantum algorithm]]s using high-level constructs.<ref>{{Cite book| author=Jarosław Adam Miszczak |title= High-level Structures in Quantum Computing | isbn=9781608458516|year= 2012 |publisher= Morgan & Claypool Publishers }}</ref> 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]].<ref>{{Cite web|url=https://github.com/qosf/awesome-quantum-software|title=Comprehensive list of quantum open-source projects|website=Github|access-date=2022-01-27}}</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 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|date=June 2023}}
 
Other circuits designed for experimentation related to quantum systems can be instrumentation and sensor based.{{Not verified in body|date=June 2023}}
 
== Quantum instruction sets ==
Line 21 ⟶ 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 [[IBM QQuantum Experience]]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 ==
Line 35 ⟶ 37:
==== 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 thea hardware-aware synthesis engine, that can be deployed across a wide range of QPUs. The platform includes a large library of quantum algorithms.
{{Main|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 the 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|url=https://grove-docs.readthedocs.io/en/latest/ |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>
MindQuantum is a quantum computing framework based on [[MindSpore]], focusing on the implementation of NISQ algorithms. It combines the HiQ high-performance quantum computing simulator with the parallel automatic differentiation capability of MindSpore. It is developed to handle problems like quantum machine learning, quantum chemistry simulation, and quantum optimization.
 
==== 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}}
[[File:QProg1-Refreshed.png|thumb|350x350px|A sample code using projectq with Python]]
 
==== PennyLane ====
An [[open-source software|open-source]] [[Python (programming language)|Python]] library developed by [[Xanadu Quantum Technologies]] for [[differentiable programming]] of quantum computers.<ref>{{Cite web |title=PennyLane Documentation — 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 &#124; ALPINE QUANTUM TECHNOLOGIES}}</ref><ref>{{Cite web |title=Plugins and ecosystem |url=https://pennylane.ai/plugins.html PennyLane|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 ====
Line 66 ⟶ 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 [[Python (programming language)|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.
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 (programming language)|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 - oneprovided—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 — Strawberry Fields|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 [[Cambridge Quantum Computing]]Quantinuum that targets simulators and several trapped-ion quantum hardware back-endsbackends, 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 ==
Line 86 ⟶ 89:
 
=== Imperative languages ===
The most prominent representatives of the imperative languages are QCL,<ref>{{cite web |author=Bernhard 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=httphttps://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
Line 101 ⟶ 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. New operators can be defined using C++ class mechanism.
 
Quantum memory is represented by class Qreg.
Line 131 ⟶ 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.
The langauge 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 138 ⟶ 140:
 
==== 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 ====
Line 147 ⟶ 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/ |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), 1109–1135pp. (27 pages), 20041109–1135. Also available from [https://arxiv.org/abs/quant-ph/0307150 [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, 2006527–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|> ====
Line 166 ⟶ 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}}
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=André van Tonder |first=André |title=A lambda calculus for quantum computation (website) |url=httphttps://www.het.brown.edu/people/andre/qlambda |accessurl-datestatus=October 2, 2007 |archive-date=March 5, 2016dead |archive-url=https://web.archive.org/web/20160305100936/http://www.het.brown.edu/people/andre/qlambda/ |urlarchive-statusdate=deadMarch 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. Green |author2=Lumsdaine |first2=Peter LeFanu Lumsdaine |author3=Ross |first3=Neil J. Ross |author4=Peter Selinger |author5first4=BenoîtPeter |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">
Line 185 ⟶ 186:
return r
</syntaxhighlight>
 
==See also==
{{Portal|Computer programming}}
* [[List of quantum computing journals]]
 
== References ==
Line 199 ⟶ 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]