Workbench
Edit an OpenQASM 3 circuit, see it drawn, simulate it, and optimize it. Everything shown here is computed by the same engine the CLI and MCP tools use, so the page cannot display a result the engine would not produce.
Circuit
Sign in to queue a circuit. A job belongs to an account, so its results and cancellation are scoped to you.
Diagram
- h on q[0]
- h on q[0]
- h on q[0]
- measure q[1] into c[1]
- qubits
- 2
- clbits
- 2
- gate count
- 3
- two qubit gate count
- 0
- depth
- 3
- uses mid circuit measurement
- no
- uses classical control
- no
- uses reset
- no
Qubit states
This circuit measures its qubits, so it has no statevector to draw. Remove the measurements to inspect the state before collapse.
Timeline
- layers (depth)
- 3
- concurrent layers
- 1
- idle cells
- 0
Columns are layers, not source order: operations in the same column run at once. The column count is the circuit depth reported above, computed the same way. Dashed cells are qubits waiting while others work — where decoherence accumulates on hardware.
Correlations
Correlations need a statevector. This circuit measures, so its state collapses — run it without shots, or use the step-through panel to see the state before the first measurement.
Subcircuitsshow / hideRepeated blocks in the circuit, shown as units rather than flattened.
This circuit declares no custom gates, so there are no subcircuits to group. Writing gate Name a, b { … } and calling it will show the expansion here.
Step throughshow / hideThe state after each gate, one step at a time.
- just applied
- h q[0]
- next
- — (end)
- matches full run
- yes
| basis state | amplitude | probability |
|---|---|---|
| |00⟩ | 0.7071 + 0.0000i | 0.5000 |
| |01⟩ | 0.7071 + 0.0000i | 0.5000 |
Stepping stops before operation 4 (measure q[1]). A measure collapses the state, so no single statevector describes what comes after -- showing one sampled branch would present it as the state rather than as one outcome.
Each step simulates the circuit prefix exactly, so this is the real intermediate state rather than an animation. Only basis states with non-zero weight are listed. Every step is a URL, so a particular step can be shared.
Q-sphere
This circuit measures its qubits, so it has no statevector to draw.
Conversion lossshow / hideWhat is dropped when this circuit is exported to another framework.
No conversion loss: the circuit round-tripped exactly.
Measurement results
| Outcome | Count | Probability | Relative frequency |
|---|---|---|---|
| 00 | 1,024 | 1.0000 |
Resource estimateshow / hideLogical counts, and what they become on a fault-tolerant machine.
NISQ resources
- logical qubits
- 2
- circuit depth
- 3
- gate count
- 3
- one qubit gate count
- 3
- two qubit gate count
- 0
- measurement count
- 1
- reset count
- 0
- swap count
- 0
- barrier count
- 0
- conditional count
- 0
Fault-tolerant counts
- t count
- 0
- clifford count
- 3
- toffoli count
- 0
- unsupported for ft count
- 0
Assumptions
- Estimator: ketqat-static v0.1.0
- Static count over the circuit as written. No synthesis, decomposition, or optimization is applied.
- Success probability not estimated: the hardware snapshot does not characterize every gate used.
- No hardware snapshot supplied, so duration and fidelity are not estimated.
Fault-tolerant physical cost
The distillation factory dominates this estimate.
- This algorithm consumes no magic states, so no factory is needed. A Clifford circuit needs no distillation at all.
- code distance
- 3
- algorithm qubits
- 36
- factory qubits
- 0
- total physical qubits
- 36
- factory share
- 0%
- distillation levels
- 2
- raw magic states
- 0
- magic states
- 0
- logical cycles
- 3
- runtime
- 0.0 ms
- logical error
- 1.8e-3 of 0.01
| physical error rate | code distance | algorithm qubits |
|---|---|---|
| 2.5e-4 | 3 | 36 |
| 5.0e-4 | 3 | 36 |
| 1.0e-3 | 3 | 36 |
| 2.0e-3 | 3 | 36 |
| 4.0e-3 | 7 | 196 |
| layout | logical qubits | algorithm qubits |
|---|---|---|
| Bare register | 2 | 36 |
| 2D lattice-surgery layout (QDK) | 9 | 162 |
The summary above uses the bare register. Magic-state factories are counted as states, not as a footprint, and on a T-heavy circuit a factory is the majority of a real machine — so neither figure here is a machine size.
| model | prefactor A | code distance | algorithm qubits |
|---|---|---|---|
| Fowler conventional(used above) | 0.03 | 3 | 36 |
| Gidney-Fowler (Qualtran) | 0.1 | 3 | 36 |
Both prefactors happen to give the same distance for this circuit, so this choice costs nothing here. That is not generally true.
What this estimate assumes, and what it leaves out
- Surface code under circuit-level depolarizing noise.
- Logical error model p_L = 0.03 (p/0.01)^((d+1)/2), fitted rather than derived.
- Magic states are counted, not costed: distillation factory footprint is not modelled.
- Routing and layout overhead beyond the per-logical-qubit patch is not modelled.
- Each Toffoli is charged 4 T gates.
- Physical error rate 0.001, error budget 0.01, cycle time 1000 ns, threshold 0.01.
- This is a model, not a measurement. No circuit here has run on hardware, and the prefactor and threshold are fitted constants from the literature.
Factory cost: what is arithmetic and what is a model
The split matters. The first group is checkable by hand from the 15-to-1 protocol; the second is an assumption about layout, like the logical-error formula above it.
- exact: 15-to-1 consumes 15 inputs per output and suppresses error as p -> 35 p^3.
- exact: 2 level(s) needed: 1.0e-3 -> 3.5e-8 -> 1.5e-21.
- exact: Raw states per usable output: 15^2 = 225.
- exact: Total raw states: 0 x 225 = 0.
- model: Footprint model: 15 logical patches per level at the factory distance, 2d^2 physical qubits per patch.
- model: This is a reading of the standard construction, NOT a measured or published figure -- treat it as a model, as with the surrounding logical-error formula.
- model: Factory and algorithm are charged separately; no sharing of routing space is assumed either way.
- model: Only the leading order of the 15-to-1 error polynomial is used.
- model: Distillation throughput is not modelled, so this is a space estimate rather than a space-time one.
Error mitigation, compared
| method | ⟨Z⟩ | uncertainty | amplification | cost | basis |
|---|---|---|---|---|---|
| None (raw) | 1.0000 | ±0.0000 | 1.00× | 1,024 shots | measured |
| Zero-noise extrapolation | 0.9694 | ±0.0100 | 2.33× | 12,000 shots | measured |
| Readout correction | 1.0417 | ±0.0000 | — | no extra shots | measured |
| Clifford data regression | not applicable | — | — | — | computed |
| Virtual distillation (modelled) | 0.0000 | — | 2 copies | 4 qubits, ×1.0 samples | modelled |
| Probabilistic error cancellation | not run | — | γ = 1.020 | 1.13e+3 shots for parity | computed |
Amplification is how much a method multiplies the statistical uncertainty. Extrapolation removes bias by taking a weighted difference, and the same weights inflate variance — so a mitigated value can be closer to noiseless and less well resolved at the same time. PEC is costed, not run: γ is the quasi-probability norm, and the shot figure is what matching the raw estimator’s precision would take. The basis column says where each number comes from: measured rows consume sampled counts, computed rows are arithmetic on the noise model, and the modelled row applies its method to the ideal state degraded by the assumed noise rather than to a sampled one.
Extrapolation data points
| noise scale | ⟨Z⟩ | shots |
|---|---|---|
| 1× | 0.9625 | 4,000 |
| 3× | 0.9570 | 4,000 |
| 5× | 0.9625 | 4,000 |
The fit is re-derivable from these points, so the mitigated value above can be checked rather than taken on trust.
- noisy locations
- 3
- 1-qubit error
- 0.10%
- 2-qubit error
- 1.00%
- readout error
- 2.00%
Clifford data regression does not apply to this circuit.
No measurement writes classical bit 0, so there is no observable to compute.
Assumptions and limits
- Clifford data regression could not run: No measurement writes classical bit 0, so there is no observable to compute.
- Error rates are assumed, not measured. The hardware profiles in this app carry topology and native gates but no calibration data, so none of these figures describes a real device.
- Virtual distillation is modelled, not measured: it needs a density matrix, so the ideal state is degraded by the assumed noise rather than sampled. The other rows consume real counts.
- Single-qubit depolarizing noise, inverted exactly as a Pauli quasi-probability.
- Every noisy location is assumed independent and identically distributed.
- Overhead is gamma^(2 x locations), so it compounds exponentially in circuit size.
- Cost is computed, not incurred: this reports what PEC would take, it does not sample.
- Noise scales approximately linearly with circuit depth under global unitary folding.
- Extrapolation model: richardson.
- Trajectory sampling gives shot-noise-limited estimates; reported uncertainty is statistical only.
- The mitigated value is a model-dependent estimate, not a measurement.
- Expectation is Tr[O rho^M] / Tr[rho^M], the M-copy virtual-distillation estimator.
- Converges to the dominant eigenvector of the NOISY state, which is not the ideal state.
- Stochastic error is suppressed; a coherent error is not, at any M.
- Cost is M copies of the register plus a sampling overhead of 1 / Tr[rho^M].
Canonical OpenQASM 3show / hideThe circuit as this engine re-emits it, for comparing against your source.
OPENQASM 3; include "stdgates.inc"; qubit[2] q; bit[2] c; h q[0]; h q[0]; h q[0]; c[1] = measure q[1];