Run OpenQASM with exact arithmetic. Compare amplitudes, probabilities and simulated samples.
Compare · Measurement · Bell pair · Search · QASM console
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.
| Outcome | A | B |
|---|---|---|
| |0⟩ | 1/2 | 1/2 |
| |1⟩ | 1/2 | 1/2 |
The probabilities match in this basis.
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.
The comparison worker requires JavaScript.
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
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.
| Readout | Bell + | Bell − |
|---|---|---|
| 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.
Start with equally likely boxes. One Grover step applies the target oracle once, then redistributes amplitudes by interference. Compare it with zero queries.
Exact probability of target |10⟩: 1/4 before the oracle, 1 after one step.
The QASM console shows the editable circuits, exact amplitudes and simulated sample counts for the measurement and search exercises.
| ζ | = eiπ/4 | ζ⁴ = −1 | √2 = ζ − ζ³ |
| amp(b) | = (c₀ + c₁ζ + c₂ζ² + c₃ζ³) / 2d | ci ∈ ℤ | |
| 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₀) | ||
| ζk | ci → ±c(i+k) mod 4 | d unchanged | |
| |amp|² | = (S + X√2) / 22d | ||
| S | = c₀² + c₁² + c₂² + c₃² | Σ S = 22d | |
| X | = c₀c₁ + c₁c₂ + c₂c₃ − c₀c₃ | Σ X = 0 |
Exact expectations and individual probabilities for Clifford+T circuits. Up to 64 qubits per readout and 16 Pauli products. No joint samples, physical-basis amplitudes or state fingerprint. Observables are evaluated before terminal measurements. Runtime grows with 2r; active rank r is limited to 16 here.
One exact scalar result only. Qubit 0 is the least significant bit; outcome bits follow the listed measured-qubit order. Parsing and counting run in a Worker with a 30-second limit. Stop ends the query. Queries return no samples or full-state fingerprint. The active method supports Z[ζ₈] only. Exact query guide.