Difference between Q#, Silq, Quil and OpenQASM in quantum programming

Foundations

Q# and Silq are high-level quantum programming languages; Quil and OpenQASM 3 are low-level instruction formats that list gates on numbered qubits. Q# (Microsoft) gives you operations, types and loops. Silq (ETH Zürich) adds a type system that refuses to copy a qubit or drop one it cannot uncompute automatically. Quil (Rigetti) reads like assembly. OpenQASM 3 (started at IBM) is the circuit format that tools and hardware exchange.

The same program shows the difference best. Below, each language builds a Bell pair, two entangled qubits, and each program ran 1,000 times on a simulator on 2026-12-02: 00 between 481 and 502 times, 11 between 498 and 519, 01 and 10 zero times, in all four.

What is the difference between Q#, Silq, Quil and OpenQASM?

LanguageWhat it is
Q#high-level language with operations, types and control flow; Microsoft Quantum Development Kit, 2017
Silqhigh-level language with linear types and automatic uncomputation; ETH Zürich, 2020
Quilinstruction language, assembly-like; Rigetti, 2016
OpenQASM 3circuit language and interchange format; started at IBM, open specification, 2021

How each one names a qubit:

LanguageQubit
Q#a value bound to a name: use q = Qubit();
Silqa typed variable: a := 0:𝔹
Quilan integer index: 0, 1
OpenQASM 3a declared register: qubit[2] q;, then q[0]

How each one writes the controlled-NOT, “flip B if A is 1”:

LanguageControlled-NOT
Q#CNOT(q1, q2);
Silqif a { b := X(b); }
QuilCNOT 0 1
OpenQASM 3cx q[0], q[1];

How each one measures:

LanguageMeasurement
Q#M(q) returns a Result: Zero or One
Silqmeasure(x) returns a classical !𝔹
QuilMEASURE 0 ro[0] writes into declared memory
OpenQASM 3c = measure q; into a declared bit register

What each one stops you doing (checked on this program, 2026-12-02):

LanguageMistake caught
Q#releasing a qubit that is not back in |0⟩: runtime error ReleasedQubitNotZero in the simulator
Silqcopying a qubit (return (a, a): “consumed”) or dropping one it cannot uncompute (“not consumed”): compile errors
Quilno types on qubits: any integer is a qubit; readings go to declared memory
OpenQASM 3qubits and bits must be declared with a type before use

Where each one runs:

LanguageRuns on
Q#QDK simulators; hardware through Azure Quantum
Silqits own simulator; no hardware back end
QuilRigetti’s QVM simulator; Rigetti processors through the quilc compiler
OpenQASM 3Qiskit and IBM Quantum; also accepted by Amazon Braket

What does a Bell pair do, step by step?

Bell pair, four steps. 1: both qubits 0, reading gives 00 every time. 2: Hadamard on A puts A into 0 and 1 at once, readings 00 or 10 at 50% each. 3: CNOT links B to A, readings 00 or 11 at 50% each, never 01 or 10. 4: measuring collapses the pair; 1,000 runs of the Q# program gave 502 times 00 and 498 times 11. Two qubits, three operations (A = first qubit, B = second) 1 · Start both qubits are 0 0 A 0 B 100% 00 1 0 01 0 0 10 0 0 11 0 reading · amplitude › 2 · H on A A is 0 and 1 at once 0 1 A 0 B 50% 00 0.71 0 01 0 50% 10 0.71 0 11 0 reading · amplitude › 3 · CNOT A→B A and B are linked 0 1 A 0 1 B 50% 00 0.71 0 01 0 0 10 0 50% 11 0.71 reading · amplitude › 4 · Measure 1,000 runs, Q# 0 0 50% or 1 1 50% 502 00 0 01 0 10 498 11 collapsed: one value per run reading → count Bars = chance that reading the pair gives that value = amplitude². 0.71 = 1/√2, and 0.71² = 0.5. Half-filled ball = a qubit in superposition: not secretly 0 or 1, both until it is read.
Amplitudes computed by hand from the gates; step 4 counts from the Q# program below, run 2026‑12‑02.
Bell pair, four steps. 1: both qubits 0, reading gives 00. 2: Hadamard on A, readings 00 or 10 at 50% each. 3: CNOT, readings 00 or 11 at 50% each, never 01 or 10. 4: 1,000 runs of the Q# program gave 502 times 00 and 498 times 11. Two qubits, three operations 1 · Start both qubits are 0 0 A 0 B 100% 00 1 0 01 0 0 10 0 0 11 0 2 · H on A A is 0 and 1 at once 0 1 A 0 B 50% 00 0.71 0 01 0 50% 10 0.71 0 11 0 3 · CNOT A→B A and B are linked 0 1 A 0 1 B 50% 00 0.71 0 01 0 0 10 0 50% 11 0.71 4 · Measure 1,000 runs, Q# 0 0 50% or 1 1 50% 502 00 0 01 0 10 498 11 collapsed: one value per run Bars = chance; row under 00/01/10/11 = amplitude. Half-filled ball = 0 and 1 at once until read.
Amplitudes computed by hand from the gates; step 4 counts from the Q# program below, run 2026‑12‑02.

What is the maths behind a Bell pair?

A two-qubit state is four amplitudes, one per reading, in the order 00, 01, 10, 11 (left bit = qubit A). The start state:

|ψ₀⟩ = |00⟩ = (1, 0, 0, 0)

The Hadamard gate, applied to A alone (identity I on B):

H = (1/√2) · [ 1   1 ]
             [ 1  −1 ]

|ψ₁⟩ = (H ⊗ I) |00⟩
     = (|00⟩ + |10⟩) / √2
     = (0.71, 0, 0.71, 0)

The CNOT with A as control and B as target swaps the 10 and 11 amplitudes and leaves the rest:

CNOT = [ 1 0 0 0 ]
       [ 0 1 0 0 ]
       [ 0 0 0 1 ]
       [ 0 0 1 0 ]

|ψ₂⟩ = CNOT |ψ₁⟩
     = (|00⟩ + |11⟩) / √2 = |Φ⁺⟩
     = (0.71, 0, 0, 0.71)

Reading the pair gives x with probability |amplitude|² (the Born rule):

P(x)  = |⟨x|ψ₂⟩|²
P(00) = P(11) = (1/√2)² = 0.5
P(01) = P(10) = 0

These are the numbers in the figure above; NumPy on the same matrices gives (0.7071, 0, 0.7071, 0), then (0.7071, 0, 0, 0.7071). Qiskit prints bit strings with q[0] on the right; for 00 and 11 the order makes no difference.

How do you write a Bell pair in Q#?

Q# writes quantum programs with ordinary programming ideas: operations, types, control flow.

@EntryPoint()
operation Main() : (Result, Result) {
    // Allocate two qubits, initially |00>
    use (q1, q2) = (Qubit(), Qubit());

    // Put first qubit into superposition
    H(q1);

    // Entangle the two qubits
    CNOT(q1, q2);

    // Measure both qubits
    let r1 = M(q1);
    let r2 = M(q2);

    // Reset before releasing
    Reset(q1);
    Reset(q2);

    return (r1, r2);
}

Run: qsharp 1.31.0 (Python package; it now points to its successor, qdk), qsharp.run("Main()", shots=1000) → 00: 502, 11: 498. Docs: Microsoft Learn, Q#.

How do you write a Bell pair in Silq?

Silq is high-level and strongly typed, with automatic uncomputation: temporary quantum values are cleaned up for you.

def bell() {
    // Create superposition
    a := H(0:𝔹);

    // Initialize second qubit
    b := 0:𝔹;

    // Apply X to b controlled by a
    if a {
        b := X(b);
    }

    return (a, b);
}

def main() {
    return measure(bell());
}

Run: Silq built from source (commit a7f0550, LDC 1.42.0), silq --run bell.slq 1,000 times → [0,0]: 497, [1,1]: 503. Docs: silq.ethz.ch.

How do you write a Bell pair in Quil?

Quil reads like assembly: one instruction per line, qubits by number, results into declared classical memory.

DECLARE ro BIT[2]

# Put qubit 0 into superposition
H 0

# Entangle qubit 0 and qubit 1
CNOT 0 1

# Measure both qubits
MEASURE 0 ro[0]
MEASURE 1 ro[1]
InstructionMeaning
DECLARE ro BIT[2]two classical bits named ro (readout)
H 0Hadamard on qubit 0
CNOT 0 1controlled-NOT, control 0, target 1
MEASURE 0 ro[0]measure qubit 0, store the bit in ro[0]

The same program from Python with pyQuil (print(p) prints the Quil above, without the comments):

from pyquil import Program
from pyquil.gates import H, CNOT, MEASURE

p = Program()
ro = p.declare("ro", "BIT", 2)
p += H(0)
p += CNOT(0, 1)
p += MEASURE(0, ro[0])
p += MEASURE(1, ro[1])
print(p)

Run: the raw Quil on Rigetti’s QVM 1.17.2 (qvm -S, one multishot request, 1,000 trials) → 00: 495, 11: 505; pyQuil 4.23.0 prints the same five lines. Docs: Rigetti QCS docs.

How do you write a Bell pair in OpenQASM 3?

OpenQASM describes a circuit as a list of instructions. It is the format tools and hardware exchange, more than a language people write large programs in.

OPENQASM 3.0;

include "stdgates.inc";

// Allocate quantum and classical registers
qubit[2] q;
bit[2] c;

// Create superposition
h q[0];

// Create entanglement
cx q[0], q[1];

// Measure both qubits
c = measure q;

Run: Qiskit 2.6.2 qasm3.loads(...) (needs the separate qiskit-qasm3-import 0.6.0 package) on Qiskit Aer 0.18.4, 1,000 shots → 00: 481, 11: 519. Docs: openqasm.com.

Do all four give the same result?

1,000 runs of each program: Q# 502 times 00 and 498 times 11; Silq 497 and 503; Quil on the QVM 495 and 505; OpenQASM 3 on Qiskit Aer 481 and 519. 01 and 10: zero in every run. 1,000 runs per language (bar = 1,000 readings) Q# qsharp 1.31.0 simulator 00 · 502 11 · 498 Silq silq a7f0550, 1,000 runs 00 · 497 11 · 503 Quil Rigetti QVM 1.17.2 00 · 495 11 · 505 OpenQASM 3 Qiskit 2.6.2 + Aer 0.18.4 00 · 481 11 · 519 500 01 and 10: 0 in all four. Dashed line = 500, the ideal split. No noise in a simulator: the spread is sampling (±16 = 1 std dev).
Each program from this note, unchanged, on the simulator named; 1,000 shots each, 2026‑12‑02.
1,000 runs each: Q# 502 / 498, Silq 497 / 503, Quil 495 / 505, OpenQASM 3 481 / 519 (00 / 11). 01 and 10: zero. 1,000 runs per language Q# qsharp 1.31.0 simulator 00 · 502 11 · 498 Silq silq a7f0550, 1,000 runs 00 · 497 11 · 503 Quil Rigetti QVM 1.17.2 00 · 495 11 · 505 OpenQASM 3 Qiskit 2.6.2 + Aer 0.18.4 00 · 481 11 · 519 500 01 and 10: 0 in all four. Dashed = 500. Spread is sampling: ±16 = 1 std dev.
Each program from this note, unchanged, on the simulator named; 1,000 shots each, 2026‑12‑02.

Yes. All four are noise-free simulators, so 01 and 10 cannot appear; on real hardware, gate and readout errors put a few percent of runs there. The 00 / 11 split varies from run to run the way 1,000 coin tosses do.

Which quantum language should you use?

FAQ

Is OpenQASM a programming language?

Version 3 is: it has classical variables, if, loops and subroutines next to gates. In practice it is used mostly as the circuit format that compilers, SDKs and hardware exchange.

Can Silq run on a real quantum computer?

No. Silq comes with its own simulator and has no compiler to quantum hardware.

Does Qiskit use OpenQASM?

Yes. Qiskit reads and writes OpenQASM 2 and 3; reading version 3 with qasm3.loads needs the qiskit-qasm3-import package.

Why does a Bell pair never give 01 or 10?

After the CNOT the amplitudes of 01 and 10 are exactly 0, and the chance of a reading is its amplitude squared. Only gate and readout errors on real hardware produce them.

Questions? Let's Chat :)

sdks languages