Ordinary Quantum

Run OpenQASM with exact arithmetic. Compare amplitudes, probabilities and simulated samples.

Compare · Measurement · Bell pair · Search · QASM console

Try a circuit

Can the same probabilities hide a difference?

Start from |0⟩. Circuit A applies H. Circuit B applies H, then Z, changing the sign of the |1⟩ amplitude. Predict whether the two circuits give the same readout.

Direct measurement
OutcomeAB
|0⟩1/21/2
|1⟩1/21/2

The probabilities match in this basis.

Compare your own circuits

Keep circuit A as a reference. Change B and compare exact probabilities from the all-zero input. This panel leaves the console and its saved draft alone.

Blank shows all outcomes for up to four qubits. Enter one bit per qubit to query a single outcome, highest-index qubit first.

Simulated samples

Both circuits use seed 20260605. Samples are available when comparing all outcomes for up to four qubits.

Compare the whole operation

Test the action on all inputs. Choose two equal-width unitary circuits without measurements. Strict equality includes global phase under Ordinary Quantum’s gate definitions. Each circuit can have up to 16 qubits and 500 lowered gates. If the calculation reaches its limit, the result is undecided.

The comparison worker requires JavaScript.

When does phase change a measurement?

An H gate prepares equal amplitudes. Change the phase of the |1⟩ amplitude, then compare a direct measurement with a second H before measurement.

Exact probability of 0: 1/2 directly, 1 after the second H.

Matematyka · State and measurement · Interference · Eighth-turn phase

What does a Bell pair share?

Prepare (|00⟩ + |11⟩)/√2 with H and CNOT. Either bit alone has an even chance of being zero. How often are both zero? Try changing the plus sign to a minus with one Z gate.

Exact readouts before measurement
ReadoutBell +
P(q₀ = 0)1/2
P(q₁ = 0)1/2
P(00)1/2
P(01)0
⟨X₀X₁⟩1

The bits agree in the Z basis. The last row measures their correlation in the X basis.

The QASM console shows the editable circuits, exact amplitudes and simulated sample counts for the measurement and search exercises.

Exact arithmetic and notation
ζ= eiπ/4ζ⁴ = −1√2 = ζ − ζ³
amp(b)= (c₀ + c₁ζ + c₂ζ² + c₃ζ³) / 2dci ∈ ℤ
H(a, b) → M(a+b), M(a−b)d ← d + 1
M(c₀,c₁,c₂,c₃) → (c₁−c₃, c₀+c₂, c₁+c₃, c₂−c₀)
ζkci → ±c(i+k) mod 4d unchanged
|amp|²= (S + X√2) / 22d
S= c₀² + c₁² + c₂² + c₃²Σ S = 22d
X= c₀c₁ + c₁c₂ + c₂c₃ − c₀c₃Σ X = 0
qasm
shots seed ε ctrl + enter runs
Z[ζ₈] statevector · exact Born sampling · fingerprint = FNV-1a over the canonical state Console guide QASM 3 support A. M. Thorn twistj.com