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
Diagram
- h on q[0]
- h on q[0]
- qubits
- 2
- clbits
- 0
- gate count
- 2
- two qubit gate count
- 0
- depth
- 2
- uses mid circuit measurement
- no
- uses classical control
- no
- uses reset
- no
Qubit states
Qubit 0
| Row | ⟨0| | ⟨1| |
|---|---|---|
| |0⟩ | 1.000 | 0.000 |
| |1⟩ | 0.000 | 0.000 |
- Bloch vector
- (0.000, 0.000, 1.000)
- Length |r|
- 1.000
- Purity Tr(ρ²)
- 1.000
Pure: this qubit has a state of its own, unentangled with the rest.
Qubit 1
| Row | ⟨0| | ⟨1| |
|---|---|---|
| |0⟩ | 1.000 | 0.000 |
| |1⟩ | 0.000 | 0.000 |
- Bloch vector
- (0.000, 0.000, 1.000)
- Length |r|
- 1.000
- Purity Tr(ρ²)
- 1.000
Pure: this qubit has a state of its own, unentangled with the rest.
Timeline
- layers (depth)
- 2
- concurrent layers
- 0
- 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
Every pair is uncorrelated: on these qubits this is a product state.
| qubit | 0 | 1 | ⟨Z⟩ |
|---|---|---|---|
| 0 | -0.000 | -0.000 | 1.000 |
| 1 | -0.000 | -0.000 | 1.000 |
No pair is correlated: on these qubits the state is a product state, so each qubit's outcome says nothing about any other.
Connected correlation <Z_i Z_j> − <Z_i><Z_j>, computed exactly from the statevector rather than sampled. The subtraction matters: raw <Z_i Z_j> is 1 for two qubits that are merely both fixed.
Colour is redundant with the numbers, not a substitute: intensity shows magnitude and hue shows sign, but every value is printed. The last column is each qubit’s ⟨Z⟩ — two qubits can both be fully biased and still be uncorrelated, which is why the marginals are shown beside the matrix.
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
- h q[0]
- matches full run
- only checked at the end
| basis state | amplitude | probability |
|---|---|---|
| |00⟩ | 0.7071 + 0.0000i | 0.5000 |
| |01⟩ | 0.7071 + 0.0000i | 0.5000 |
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
| state | probability | phase |
|---|---|---|
| |00⟩ | 1.0000 | 0.00π |
Latitude is the number of ones: |00⟩ at the top, |11⟩ at the bottom. Spoke length is amplitude relative to the largest, and hue is phase.
A phase shown as — belongs to an amplitude too small to carry one; it is not a phase of zero.
Conversion lossshow / hideWhat is dropped when this circuit is exported to another framework.
No conversion loss: the circuit round-tripped exactly.
Resource estimateshow / hideLogical counts, and what they become on a fault-tolerant machine.
NISQ resources
- logical qubits
- 2
- circuit depth
- 2
- gate count
- 2
- one qubit gate count
- 2
- two qubit gate count
- 0
- measurement count
- 0
- reset count
- 0
- swap count
- 0
- barrier count
- 0
- conditional count
- 0
Fault-tolerant counts
- t count
- 0
- clifford count
- 2
- 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
- 2
- runtime
- 0.0 ms
- logical error
- 1.2e-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 | 5 | 100 |
| 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 |
|---|---|---|---|---|---|
| Clifford data regression | not applicable | — | — | — | computed |
| Virtual distillation (modelled) | 0.9999 | — | 2 copies | 4 qubits, ×1.0 samples | modelled |
| Probabilistic error cancellation | not run | — | γ = 1.020 | 1.08e+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.
- noisy locations
- 2
- 1-qubit error
- 0.10%
- 2-qubit error
- 1.00%
- readout error
- 2.00%
Clifford data regression does not apply to this circuit.
This circuit declares no classical bits, so there is nothing to sample. Add a measurement, or omit shots to get the exact statevector.
Assumptions and limits
- This circuit produced no counts, so there is no unmitigated estimate to compare against.
- Zero-noise extrapolation could not run: This circuit declares no classical bits, so there is nothing to sample. Add a measurement, or omit shots to get the exact statevector.
- Clifford data regression could not run: This circuit declares no classical bits, so there is nothing to sample. Add a measurement, or omit shots to get the exact statevector.
- 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.
- 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; h q[0]; h q[0];