Basic circuits · Oracle algorithm benchmark
Alternating-parity oracle scaffold · 3 qubits
A deterministic parity-oracle circuit that marks alternating input wires through phase kickback.
Strong empiricalUpdated
A small worked example, computed in your browser. It is not a result from this record's papers.
Deutsch-Jozsa on a balanced function
3 input qubits, testing f(x) = x0 XOR x1 XOR x2, which is balanced.
Step 1 of 6 · X
Probability of each outcome after this step
- 1000100%
Sets the ancilla to |1⟩, so the next step can put it into |−⟩.
The whole state moves from 0000 to 1000 — one certain outcome before, one certain outcome after, no superposition either side.
Hadamards everything: the ancilla becomes |−⟩, and the three input qubits spread into an equal superposition of all 8 inputs.
Probability spreads from 1 outcome to 16. All 16 are equally likely.
Applies f by CX-ing each input qubit onto the ancilla; against |−⟩, this kicks a phase (−1)^f(x) onto each input branch.
The outcome probabilities do not move at all. What this step changes is phase — 2 distinct relative phases across the state now — which no measurement can see until a later step turns it back into probability.
A second Hadamard layer on the inputs only turns those phases into a deterministic readout.
Probability gathers from 16 outcomes onto 2. 0111 goes from 6.3% to 50.0%.
Undoes the ancilla's Hadamard.
Probability gathers from 2 outcomes onto 1. 1111 goes from 50.0% to 100.0%.
Returns the ancilla to |0⟩, purely for a tidy final state. It plays no further role in the algorithm.
The whole state moves from 1111 to 0111 — one certain outcome before, one certain outcome after, no superposition either side.
Readout The three input qubits read 111 (any nonzero result proves f is balanced, not constant); the ancilla reads 0.
Open in Studio- Steps7
- Wires3
- Qubits3
- Operations7
- Framework exports7
- Papers1
A deterministic parity-oracle circuit that marks alternating input wires through phase kickback. This 3-qubit record gives the repository a concrete, inspectable circuit at a known width rather than only a family-level description.
Takes3 qubitsassumed |0…0⟩What joins here
Takes a 3-qubit register, and this entry's published behaviour was measured from |0…0⟩. Putting another stage in front is a defined circuit and is no longer the thing this entry measured — the results on this page were not produced that way.
6 entries line up on shape, composition unverified. Named below.
Returns3 classical bitsWhat joins here
Returns 3 classical bits. Nothing in this catalogue takes classical bits, so this end closes a pipeline rather than continuing one — what is worth having here is the measurement, not a register to pass on.
Nothing in the Atlas meets this end.
A whole program rather than a stage: it begins on |0…0⟩ and ends by measuring every qubit, so what it returns is classical bits. Nothing in this catalogue takes classical bits, so nothing follows it. See all 30 →
- CCZ (doubly-controlled Z) gate
- Fredkin (CSWAP) gate
- Loading a probability distribution (uniformly controlled rotations)
- Toffoli (CCX) gate
- Subspace-search VQE
- W state (three-qubit)
The widths and types line up. What is not established is everything a width does not carry — the basis convention, the normalisation, the state each was written to start from — so this is not a claim that the two compose.
The circuit is stored once as a framework-neutral ordered gate graph and converted lazily when a framework is selected. The converter preserves gate order, numeric angle expressions, qubit indices, and terminal all-qubit measurement for its bounded gate set. It intentionally does not claim that downstream compiler decompositions or device behavior are identical. The cited MQT Bench work motivates scalable, cross-level benchmark families; this particular circuit is a Leona Quantum-authored scaffold and should be compared by width, operation count, transpiled depth, two-qubit count, and measured output behavior.
Takes3 qubitsassumed |0…0⟩What joins here
Takes a 3-qubit register, and this entry's published behaviour was measured from |0…0⟩. Putting another stage in front is a defined circuit and is no longer the thing this entry measured — the results on this page were not produced that way.
6 entries line up on shape, composition unverified. Named below.
Returns3 classical bitsWhat joins here
Returns 3 classical bits. Nothing in this catalogue takes classical bits, so this end closes a pipeline rather than continuing one — what is worth having here is the measurement, not a register to pass on.
Nothing in the Atlas meets this end.
A whole program rather than a stage: it begins on |0…0⟩ and ends by measuring every qubit, so what it returns is classical bits. Nothing in this catalogue takes classical bits, so nothing follows it. See all 30 →
- CCZ (doubly-controlled Z) gate
- Fredkin (CSWAP) gate
- Loading a probability distribution (uniformly controlled rotations)
- Toffoli (CCX) gate
- Subspace-search VQE
- W state (three-qubit)
The widths and types line up. What is not established is everything a width does not carry — the basis convention, the normalisation, the state each was written to start from — so this is not a claim that the two compose.
- Qubits
- 3
- Operations
- 7
- Framework exports
- 7
- Circuit model
- Ordered portable gate graph
- Measurement
- Terminal all-qubit
Xon q2Hon q0Hon q1Hon q2CXon q0, q2Hon q0Hon q1
Circuit structure
Derived from this entry's published gate sequence on every read, not authored alongside it. Depth is the longest serial run through the circuit, not the gate count: operations on disjoint qubits share a layer, and the terminal measurement is one layer of its own.
Fault-tolerant cost
Counted exactly
This circuit is Clifford-only: it consumes no magic states at all. That is a measured property of the circuit, not a missing number.
What the algorithm needs
Architecture-independent. Nothing here mentions hardware.
- Logical qubits
- 3
- T gates
- 0
- Toffoli gates
- 0
- Serial non-Clifford depthThe one number no amount of hardware improves.
- 0
- Clifford operations
- 7
Error correction
- Code distanceThe smallest distance whose logical error rate clears the target across every operation in the circuit.
- d = 3
- Logical operations protected
- 1
- Error per operation
- 1.00e-3 achieved · 1.00e-2 needed
Physical footprint
- Circuit qubits
- 192
- Factory qubits
- None
- Total
- 192
Wall-clock
Both runtime terms are magic-state terms, so a circuit that consumes none has no wall-clock under this model. Reporting zero would say it runs instantly.
Qubits vs runtime, across hardware
Nothing to rank: this circuit has no stated runtime under any hardware set.
Stated caveats
- Clifford-only circuit: no magic states, so no distillation and no factories. Its footprint is stated; its runtime is not, because both runtime terms are magic-state terms and this model has no Clifford-depth metric to put in their place.
Computed under
gidney-2025@v2+eps=1e-06
- Rotation synthesis precision
- ε = 1e-6
- T gates per rotation
- 60
- Magic states per Toffoli
- 8
- Physical error rate
- 1e-3
- Target failure probability
- 1e-2
Gidney, How to factor 2048 bit RSA integers with less than a million noisy qubits (arXiv:2505.15917), which states its hardware assumptions in one place: square nearest-neighbour grid, uniform 0.1% gate error, 1 us surface-code cycle, 10 us reaction time. It also states, in its Physical Costs section, the three values this model used to invent: 2(d+1)^2 physical qubits per logical patch, magic state factories covering a 3x4 area of patches, and 8T-to-CCZ distillation, so eight T states per Toffoli. threshold and logical_error_prefactor: the logical-error form this model uses, p_L = 0.1(100p)^((d+1)/2) with a 1% threshold, is Fowler and Gidney, Low overhead quantum computation using lattice surgery (arXiv:1808.06709) — quoted as equation (10) of Litinski's A Game of Surface Codes and equation (2) of Webber et al. (arXiv:2108.12371). The paper this set is named for does not use it: it picks a distance by reading a target error rate of 1e-15 per logical qubit round off simulated suppression curves (its figure 6), which is a shape this model has no field for. routing_factor: the leading term of Litinski's data blocks in A Game of Surface Codes (Quantum 3, 128, arXiv:1808.02892) — 2n+4 tiles for the intermediate block, 2n+sqrt(8n)+1 for the fast one, both 2n to leading order. arXiv:2505.15917 lays out a fixed 7x18 compute region with three columns of workspace rather than a multiplier on the data block, which is not a shape this field can hold. The constant term is dropped, so this is optimistic by a few patches. factory_cycles_per_state: the paper's own derivation — 14.7 rounds of magic state cultivation plus six lattice-surgery layers at 2d/3 rounds each, which is 14.7 + 4d rounds per CCZ state and reproduces its stated 114.7 at its own d = 25 — divided by the eight T states a CCZ costs here. The paper then rounds 114.7 up to 150 for slack and carries 150 forward, so this model is about 24% faster at distillation than the figure the paper reports. The derivation is taken rather than the rounded figure because it is the one that states how the cost moves with the code distance, which is the whole reason this field is not a constant. One distortion follows from spreading it over eight states and is worth knowing: the paper's factory delivers a CCZ state, not a bare T state, and its two terms are not alike — the 14.7 is cultivating the eight input T states (independently confirmed here: the paper's 30000 physical qubit-rounds per cultivated T state over a 12-patch factory at d = 25 is 1.85 rounds, which is 14.7/8), while the 4d is the 8T-to-CCZ distillation on top. This model has one magic-state currency, so a circuit whose states are plain T gates — every synthesised rotation in this catalogue — is charged a share of a distillation it never performs, and is pessimistic on factory time by roughly 3.4x at d = 9. A circuit of Toffolis is charged exactly the paper's 114.7. Pessimistic is the safe direction for a machine size, and splitting the two terms needs a factory model this record does not have. rotation_t_coefficient: Ross and Selinger, Optimal ancilla-free Clifford+T approximation of z-rotations (arXiv:1403.2975) — the leading term of 3*log2(1/eps) + O(log log 1/eps) for the T-count of an ancilla-free single-qubit z-rotation synthesis, which this field carries as the coefficient in t_per_rotation. Not from arXiv:2505.15917: that paper's circuit is Toffoli-only and states no rotation synthesis convention.
Two estimates may be compared only when this identity matches. Change the precision or the hardware set and every number above is a different claim.
Import resource data
Inspect QREF v1 JSON and keep the original file. This leaves your physical estimate unchanged.
Quantum vs classical
Classical baseline
Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.
Quantum claim
The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.
How to compare
Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.
Nobody has reviewed this record for gaps yet.
from qiskit import QuantumCircuit
qc = QuantumCircuit(3)
qc.x(2)
qc.h(0)
qc.h(1)
qc.h(2)
qc.cx(0, 2)
qc.h(0)
qc.h(1)
qc.measure_all()
FINAL_CIRCUIT = qcRelated entries
- Variational quantum eigensolver for ground-state energy
Algorithms
- Bell state measurement
Basic circuits
References
- MQT Bench: Benchmarking Software and Design Automation Tools for Quantum Computing
Nils Quetschlich, Lukas Burgholzer, Robert Wille · 2022
Defines a cross-level, scalable benchmark methodology; this entry is a Leona Quantum-authored portable scaffold, not a byte-for-byte upstream circuit.