---
title: Quantum programming
slug: quantum-programming
qid: 
snapshot: enwiki-001368082641
content_hash: 
license: CC BY-SA 4.0
source: https://en.wikipedia.org/w/index.php?oldid=1368082641
tags: [20163766, 22899860, 22904498, 22947451, 22966447, 23117742, 23118434, 23603337, 24623845, 24745122, 29265208, 47381634, 61225799, 68328988, 82248707]
---

# Quantum programming

> [!note] Provenance
> Snapshot `enwiki-001368082641` · content root `…`
> Derived from <https://en.wikipedia.org/w/index.php?oldid=1368082641> · Licensed CC BY-SA 4.0

Quantum programming refers to the process of designing and implementing algorithms that operate on 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 Qrisp, Qiskit, Cirq, PennyLane, and qBraid SDK—available under open licenses. 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.…

Quantum programming refers to the process of designing and implementing algorithms that operate on 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 Qrisp, Qiskit, Cirq, PennyLane, and qBraid SDK—available under open licenses. 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. from guppylang import guppy from guppylang.std.quantum import qubit, toffoli, s, z, measure from guppylang.std.quantum.functional import h @guppy def rz_acos_3_5(q: qubit, max_tries: int) -> bool: """ Repeat-until-success circuit for Rz(acos(3/5)) from Nielsen and Chuang, Fig. 4.17. """ for i in range(max_tries): a, b = h(qubit()), h(qubit()) toffoli(a, b, q) s(q) toffoli(a, b, q) m_a = measure(h(a)) m_b = measure(h(b)) if not m_a.read() and not m_b.read(): output("num_failed_attempts", i) return True z(q) output("num_failed_attempts", max_tries) return False In Guppy, qubits are linear types, and the compiler tries to enforce linearity (preventing qubits from being leaked or copied, for example). The Guppy compiler is packaged with an emulator. Programs are compiled to an intermediate representation called HUGR , suitable for submission to Quantinuum's quantum devices. Ket 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, seamlessly integrating with a Rust runtime library and a quantum simulator. Maintained by Quantuloop, the project emphasizes accessibility and versatility for researchers and developers. The following example demonstrates the implementation of a Bell state using Ket: 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 Qreg x1; // 1-qubit quantum register with initial value 0 Qreg x2(2,0); // 2-qubit quantum register with initial value 0 The computation process is executed using a provided simulator. Noisy environments can be simulated using parameters of the simulator. import Quipper spos :: Bool -> Circ Qubit spos b = do q ==See also== List of quantum computing journals List of quantum algorithms List of quantum software
