Physics · Article
Qubits, gates, and quantum circuits
Build a circuit that records whether two qubits agree while preserving the phase inside each parity sector. Use the same gate and measurement rules to predict interference, test entanglement, and interpret noisy counts on a real device.
Previous article: Open quantum systems
Back to PhysicsAfter reading, you can
- Predict the outcome of successive one- and two-qubit gates using a declared wire, bit and matrix order.
- Use an analyser in a second basis to distinguish relative phase from an unobservable global phase.
- Derive a parity measurement from its unitary interaction with an ancilla and state which coherences survive.
- Test a two-qubit entanglement witness and relate a logical circuit to its native gates, timing and error model.
- Separate sampling fluctuations, readout assignment and coherent gate errors when interpreting circuit data.
What a circuit diagram promises
A laboratory has two distinguishable two-level degrees of freedom. A controller prepares them, pulses act in a prescribed order, and a detector records two bits. Those instructions define a circuit only after someone specifies which two states encode each bit, which pulse acts on which degree of freedom, and which detector outcome receives the label 1. In one device the qubits may occupy different sites. In an early trapped-ion logic experiment, selected motional and internal states of the same ion provided the two logical degrees of freedom. A wire tracks a subsystem through the operations. Its position on a drawing does not tell us the layout of the apparatus.
Write one ideal qubit as |ψ⟩ = α|0⟩ + β|1⟩ with |α|² + |β|² = 1. A measurement in this declared basis returns 0 with probability |α|² and 1 with probability |β|². A gate before the measurement can make the relative phase of the amplitudes visible. Multiplying the whole input by a common phase leaves all probabilities invariant under every subsequent fixed circuit. A general preparation has a density matrix ρ. The same measurement has probabilities ⟨0|ρ|0⟩ and ⟨1|ρ|1⟩, even when no single pair of amplitudes describes the preparation. A complex amplitude has no unit, and its squared modulus is a probability.
Let q₀ be the upper wire and the first digit in |q₀q₁⟩. Use the ordered basis 00, 01, 10, 11. A gate U on the first wire has matrix U ⊗ I in this order. A gate V on the second has matrix I ⊗ V. For example an X on q₀ takes |01⟩ to |11⟩, while an X on q₁ takes |01⟩ to |00⟩. This one-input check catches bit-order mistakes that leave an all-zero input or a symmetric Bell state looking plausible. A general two-qubit state has four amplitudes whose squared moduli sum to one. Only for a product input can all four amplitudes be obtained by multiplying separate one-qubit amplitudes.
Read the circuit from left to right in time. If the state encounters U then V, substitution gives V(U|ψ⟩), so the matrix for the two boxes is VU. For a density matrix the output is VUρU†V†. A vertical line connecting dots is part of one multi-qubit gate. A measurement yields a classical record that can select a later operation. A wire discarded without reading its record requires a partial trace. With these rules one can calculate the joint distribution of the bits that actually reach the output, including the result of a conditional operation. Counting boxes alone cannot determine that distribution.
A final Hadamard exposes a reversed gate order
- Direct Z readout gives 0
- X readout gives +
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| H then Z | Direct Z readout gives 0 | 1/2 | order h z |
| H then Z | X readout gives + | 0 | order h z |
| Z then H | Direct Z readout gives 0 | 1/2 | order z h |
| Z then H | X readout gives + | 1 | order z h |
Turn an invisible phase into a count
The gates X and Z each square to the identity. X interchanges |0⟩ and |1⟩. Z leaves |0⟩ fixed and changes the sign of |1⟩. The Hadamard H sends |0⟩ to |+⟩ = (|0⟩ + |1⟩)/√2 and |1⟩ to |−⟩ = (|0⟩ − |1⟩)/√2. Its columns are the amplitudes of these two outputs. Orthogonality of the columns makes H unitary, and H² = I makes it its own inverse. Measuring Z after H therefore measures X on the state just before H. A final H converts opposite relative signs into distinct detector outcomes.
A rotation Rᵧ(θ) prepares cos(θ/2)|0⟩ + sin(θ/2)|1⟩ from |0⟩. Follow it with the phase gate P(φ) = diag(1, exp(iφ)). The phase gate adds φ to the relative phase when both amplitudes are nonzero. For 0 < θ < π their rotation coefficients are positive, giving relative phase φ. Opposite signs of the two coefficients add π modulo 2π. If either amplitude vanishes, there is no relative phase between populated branches. Write the second amplitude explicitly as e^(iφ) sin(θ/2). Squaring the two input-basis amplitudes gives the Z probabilities. Projecting onto |+⟩ gives P(+X) = [1 + sin θ cos φ]/2. Projecting onto (|0⟩ + i|1⟩)/√2 gives P(+Y) = [1 + sin θ sin φ]/2. For a direct circuit that measures Y with a Z detector, apply S† and then H, with S = diag(1,i). The order of those two gates fixes the sign of the Y result.
Take θ = 90° and vary φ. Both Z counts stay equally likely. The X fringe is brightest at 0°, darkest at 180°, and half bright at 90° and 270°. The Y signal separates the last two phases. This experiment uses gates whose phases are defined relative to the preparation and analyser, for instance through a shared oscillator. If that relative reference wanders randomly across repeated shots, the averaged transverse signals shrink. The observed contrast describes the whole preparation, phase control and measurement sequence. An isolated gate label does not specify the visibility of a laboratory fringe.
The phase of a whole gate deserves one extra qualification when we control it. On a target alone, U and e^(iφ)U have the same effect on ρ. Define two physically specified controlled operations using an identity on the control-0 branch and the chosen matrix on the control-1 branch. They differ by a phase gate on the control. With a |+⟩ control and U = I, the latter choice produces (|0⟩ + e^(iφ)|1⟩)/√2 on the control. At φ = π a final H now flips the result from 0 to 1. No experiment has observed a global phase of an isolated target. The controlled implementations have supplied a reference branch and a relative phase between two joint amplitudes.
Two equatorial analysers resolve the signed phase
- X analyser gives +
- Y analyser gives +
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| 0° | X analyser gives + | 1 | relative phase 0 |
| 0° | Y analyser gives + | 1/2 | relative phase 0 |
| 45° | X analyser gives + | [1 + cos(45°)]/2 ≈ 0.8535533906 | relative phase 45 |
| 45° | Y analyser gives + | [1 + sin(45°)]/2 ≈ 0.8535533906 | relative phase 45 |
| 90° | X analyser gives + | 1/2 | relative phase 90 |
| 90° | Y analyser gives + | 1 | relative phase 90 |
| 135° | X analyser gives + | [1 + cos(135°)]/2 ≈ 0.1464466094 | relative phase 135 |
| 135° | Y analyser gives + | [1 + sin(135°)]/2 ≈ 0.8535533906 | relative phase 135 |
| 180° | X analyser gives + | 0 | relative phase 180 |
| 180° | Y analyser gives + | 1/2 | relative phase 180 |
| 225° | X analyser gives + | [1 + cos(225°)]/2 ≈ 0.1464466094 | relative phase 225 |
| 225° | Y analyser gives + | [1 + sin(225°)]/2 ≈ 0.1464466094 | relative phase 225 |
| 270° | X analyser gives + | 1/2 | relative phase 270 |
| 270° | Y analyser gives + | 0 | relative phase 270 |
| 315° | X analyser gives + | [1 + cos(315°)]/2 ≈ 0.8535533906 | relative phase 315 |
| 315° | Y analyser gives + | [1 + sin(315°)]/2 ≈ 0.1464466094 | relative phase 315 |
Controlled gates and a correlation test
The controlled-NOT gate, CNOT, adds the control bit modulo two to its target in the chosen computational basis. With q₀ as control, |a,b⟩ goes to |a, b ⊕ a⟩. Its action on all superpositions follows by linearity. A control in state |1⟩ flips a target, while a control in |0⟩ leaves it alone. A superposed control entails a coherent sum of both actions until something distinguishes the branches. Replacing the control with a classical measurement and a conditional classical command produces the same basis truth table. It can give different predictions for a superposed input.
Start in |00⟩, apply H to q₀, then apply the CNOT. The first step gives (|00⟩ + |10⟩)/√2. The second takes the last term to |11⟩, producing |Φ+⟩ = (|00⟩ + |11⟩)/√2. Either individual bit is uniformly random. The joint Z results always agree. A classical source sending 00 or 11 with equal probabilities produces exactly the same Z histogram. To see what differs, express |Φ+⟩ in the X basis. The cross terms cancel, leaving (|++⟩ + |−−⟩)/√2. The classical mixture gives all four X outcome pairs with probability one quarter each.
Assign signs +1 and −1 to the two eigenvalues on each wire. For a product of local states, write x₀, z₀ and x₁, z₁ for the X and Z expectations. Their two-axis Bloch-vector lengths are at most one. Hence |x₀x₁| + |z₀z₁| is bounded above by √(x₀² + z₀²) √(x₁² + z₁²), which is at most one. For a convex mixture of product states, apply the triangle inequality to each measured expectation and average the product bounds. Every separable pair therefore obeys |⟨XX⟩| + |⟨ZZ⟩| ≤ 1. A violation witnesses entanglement when the stated observables and two-qubit model are trusted. Some entangled states satisfy this particular inequality.
A CNOT does not entangle every input. With the target in |+⟩, X acts with eigenvalue +1 and both branches have the same target. With target |−⟩, X acts with eigenvalue −1 and its sign goes back onto the control branch. A |+⟩ control becomes |−⟩ while the target remains |−⟩. The effect is called phase kickback. It follows from the same two-line basis rule that made the Bell pair. A computational-basis truth table, the phase-sensitive witness and this eigenstate test ask three different questions of a device that claims to implement CNOT.
Asymmetric inputs identify which wire controls the flip
- q₀ controls q₁
- q₁ controls q₀
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| 00 | q₀ controls q₁ | 1 | arrow input 00 |
| 00 | q₁ controls q₀ | 1 | arrow input 00 |
| 01 | q₀ controls q₁ | 1 | arrow input 01 |
| 01 | q₁ controls q₀ | 0 | arrow input 01 |
| 10 | q₀ controls q₁ | 0 | arrow input 10 |
| 10 | q₁ controls q₀ | 1 | arrow input 10 |
| 11 | q₀ controls q₁ | 0 | arrow input 11 |
| 11 | q₁ controls q₀ | 0 | arrow input 11 |
The X measurement separates a coherent Bell pair from a correlated mixture
- Coherent Bell pair
- Mixture of 00 and 11
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| ZZ | Coherent Bell pair | 1 | bell basis z |
| ZZ | Mixture of 00 and 11 | 1 | bell basis z |
| XX | Coherent Bell pair | 1 | bell basis x |
| XX | Mixture of 00 and 11 | 1/2 | bell basis x |
Read out a property without reading out both qubits
Suppose we want one bit indicating whether two data qubits agree. Measuring each in Z and comparing the answers reveals all the information in a single computational-basis outcome. It also breaks superpositions of distinct basis words even when the words have the same parity. A circuit can directly measure just parity. Add an auxiliary qubit, or ancilla, in |0⟩. Apply CNOT from q₀ to the ancilla and then CNOT from q₁ to the same ancilla. A basis word |a,b,0⟩ evolves into |a,b, a ⊕ b⟩. The data wires are the controls. Interchanging these arrows would implement a different experiment.
Let Pₑ project onto the span of |00⟩ and |11⟩, and let Pₒ project onto |01⟩ and |10⟩. For any pure data input |ψ⟩, linearity gives the joint state Pₑ|ψ⟩ ⊗ |0⟩ + Pₒ|ψ⟩ ⊗ |1⟩. The squared length of each term is the probability of that parity. Conditional on an even result with nonzero probability pₑ, the data state is Pₑ|ψ⟩/√pₑ. Relative amplitudes and phases within that sector survive. For a mixed ρ, the unnormalized branch is PₑρPₑ. Its trace gives the probability and dividing by that trace gives the normalized state. A zero-probability outcome supplies no conditional data state.
An unread but distinguishable record has a measurable cost. Tracing out the ancilla leaves PₑρPₑ + PₒρPₒ. Coherences between even and odd sectors vanish from the data state, while coherences within a sector remain. Reading and then forgetting two separate Z detectors usually removes more terms. For example (|00⟩ + |11⟩)/√2 has certain even parity. An ideal parity readout leaves this Bell state intact. An ideal readout of both bits followed by discarding those outcomes leaves an equal mixture of |00⟩ and |11⟩. Repeating an X measurement on each wire can tell the two procedures apart over many preparations.
If the ancilla is still coherent and has not leaked its record into a meter, apply the two CNOTs in reverse order. Each is self-inverse, so the original data and the clean ancilla return. This reversal is called uncomputation. A copy of the parity in an uncontrolled environment spoils this erasure even if the visible ancilla ends in |0⟩. A stored classical bit can instead select a new operation, a procedure called feed-forward. A correction selected by that bit can be very valuable, but it cannot reconstruct an arbitrary unknown phase between the branches of an already projective measurement. The record’s physical destination is part of the specification.
Measuring the parity ancilla conditions the data on a whole sector
- Given ancilla 0 (even)
- Given ancilla 1 (odd)
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| 00 | Given ancilla 0 (even) | 2/3 | parity word 00 |
| 00 | Given ancilla 1 (odd) | 0 | parity word 00 |
| 01 | Given ancilla 0 (even) | 0 | parity word 01 |
| 01 | Given ancilla 1 (odd) | 1/2 | parity word 01 |
| 10 | Given ancilla 0 (even) | 0 | parity word 10 |
| 10 | Given ancilla 1 (odd) | 1/2 | parity word 10 |
| 11 | Given ancilla 0 (even) | 1/3 | parity word 11 |
| 11 | Given ancilla 1 (odd) | 0 | parity word 11 |
The information that leaves the circuit determines its return probability
- Four-word pure input
- Even Bell input Φ+
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| Undo record | Four-word pure input | 1 | record destination 1 |
| Undo record | Even Bell input Φ+ | 1 | record destination 1 |
| Read parity | Four-word pure input | 5/8 | record destination 2 |
| Read parity | Even Bell input Φ+ | 1 | record destination 2 |
| Read both bits | Four-word pure input | 11/32 | record destination 3 |
| Read both bits | Even Bell input Φ+ | 1/2 | record destination 3 |
Which gates are enough, and how much hardware time do they cost?
Single-qubit gates alone preserve product structure on product inputs. CNOT allows them to connect amplitudes on different wires. Barenco and colleagues showed that arbitrary one-qubit unitaries together with CNOT can decompose any unitary on a finite register of qubits. The word arbitrary matters. A continuously tunable angle carries a precision specification. For a finite gate alphabet, the usual goal is an approximation to any target unitary within a declared error, up to an overall phase. The number of required gates can grow with the number of wires and with the requested precision. Universality by itself says little about the resources for a particular computation.
Some families are instructive because their structure limits their reach. H exchanges X and Z under conjugation. S takes X to Y. CNOT takes an X on the control to a product of X on both wires, and a Z on the target to a product of Z on both. Generators H, S and CNOT send Pauli operators to signed Pauli operators and generate Clifford circuits. With stabilizer input states, Clifford gates and Pauli measurements, an efficient classical representation tracks these operators. Bell pairs and parity measurements already fit inside this class. T = diag(1, exp(iπ/4)) sends the Pauli X to (X + Y)/√2 under conjugation. Adding T to the Clifford gates yields an approximately universal set. The presence of a T gate in one small circuit establishes no computational advantage on its own.
A compiler translates logical gates into the operations a processor supports between particular qubits. Take three sites on a line q₀—q₁—q₂ with a nearest-neighbour CNOT in each needed direction. An ideal CNOT from q₀ to q₂ must preserve an arbitrary middle qubit if the specification says it is an untouched data wire. Apply CNOT in the sequence 0→1, 1→2, 0→1, 1→2. The first temporarily adds a to b. The first operation on the target adds a ⊕ b to c. Restoring b and adding it once more leaves c ⊕ a. Checking all eight basis words proves equality of the two unitaries, because these specified gates are permutation matrices without extra phases. Testing only basis probabilities of a physical implementation would miss unwanted input-dependent phases.
The gate count is the total number of gates. Depth counts successive layers given a set of allowed simultaneous operations. Four CNOTs in this chain touch q₁, so their four layers are ordered. Two one-qubit gates on disjoint sites can occupy one layer if the control hardware allows it. With an assumed duration of 200 ns per native CNOT and 20 ns per one-qubit pulse, such an initial parallel layer followed by the four CNOTs takes 820 ns, before preparation, readout, resetting, or scheduling delays. A new layout, direction-dependent pulse, shared control line or stricter accuracy target can alter the estimate. Reporting the gate alphabet and timing assumptions makes two depth claims comparable.
Four nearest-neighbour CNOTs restore the occupied middle wire
- Middle bit q₁
- Target bit q₂
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| Input | Middle bit q₁ | 1 | routed stage 0 |
| Input | Target bit q₂ | 0 | routed stage 0 |
| G1 0→1 | Middle bit q₁ | 0 | routed stage 1 |
| G1 0→1 | Target bit q₂ | 0 | routed stage 1 |
| G2 1→2 | Middle bit q₁ | 0 | routed stage 2 |
| G2 1→2 | Target bit q₂ | 0 | routed stage 2 |
| G3 0→1 | Middle bit q₁ | 1 | routed stage 3 |
| G3 0→1 | Target bit q₂ | 0 | routed stage 3 |
| G4 1→2 | Middle bit q₁ | 1 | routed stage 4 |
| G4 1→2 | Target bit q₂ | 1 | routed stage 4 |
How an imperfect circuit changes the counts
An ideal gate specifies a unitary. A laboratory pulse, with the unmonitored apparatus included and traced out, may be better represented by a quantum channel. A coherent misrotation is already a unitary error. Suppose each intended Rᵧ(π/2) actually rotates through π/2 + δ about the same fixed axis. Four such pulses give Rᵧ(2π + 4δ). Starting from |0⟩, the probability of the wrong Z result is sin²(2δ). The intended 2π rotation contributes a global minus sign and returns the same physical state. For δ = 1° the wrong probability is about 0.001218. The sine argument is an angle. Use radians when replacing a small sine by its argument.
For m identical pulses the angular error relative to the ideal sequence is mδ. For an initial state |0⟩ the infidelity to the ideal pure output is sin²(mδ/2). When |mδ| is small this grows quadratically in m. Sampling independent random overrotations can change that buildup. Dephasing, leakage into levels outside the encoding and state-dependent readout errors can all give different signatures. The wrong Z probability and the infidelity coincide in the four-pulse return experiment, but an arbitrary circuit’s fixed final basis need not test projection onto its ideal output. State which observable was measured before interpreting a probability as an error.
Readout has its own calibration. Let ε₀ be the probability of a recorded 1 conditional on a true 0 and ε₁ the probability of a recorded 0 conditional on a true 1. For true excited population p, the law of total probability gives q = ε₀(1 − p) + (1 − ε₁)p. Rearranging gives q = ε₀ + (1 − ε₀ − ε₁)p. If the slope is nonzero and calibrated, a population estimate from q is possible. An exactly zero slope makes the record independent of the true population. A small slope amplifies statistical and calibration uncertainty. A two-qubit readout can have correlated assignment errors that a product of two such one-qubit models misses.
Randomized benchmarking probes a different property. Prepare a reference state, apply random gate sequences of several lengths with an inversion chosen to return the ideal state, and estimate the survival probability averaged over sampled sequences. In a simple time-stationary, gate-independent noise model for a Clifford average, the resulting curve has the form A rᵐ + B. The fitted contrast and offset also depend on preparation and measurement. In the depolarizing description for a qubit, ρ maps to rρ + (1 − r)I/2 and average pure-state fidelity is (1 + r)/2. More general noise, leakage and time variation can change the curve or its interpretation. A fit does not specify every gate’s coherent error or the error of a particular algorithm.
A fixed pulse-angle error adds coherently across repetitions
- Fixed +1° error on every pulse
- m times one-pulse infidelity
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| 1 | Fixed +1° error on every pulse | 76.1524218 ppm | coherent pulses 1 |
| 1 | m times one-pulse infidelity | 76.1524218 ppm | coherent pulses 1 |
| 2 | Fixed +1° error on every pulse | 304.5864905 ppm | coherent pulses 2 |
| 2 | m times one-pulse infidelity | 152.3048436 ppm | coherent pulses 2 |
| 4 | Fixed +1° error on every pulse | 1217.97487 ppm | coherent pulses 4 |
| 4 | m times one-pulse infidelity | 304.6096872 ppm | coherent pulses 4 |
| 8 | Fixed +1° error on every pulse | 4865.965629 ppm | coherent pulses 8 |
| 8 | m times one-pulse infidelity | 609.2193744 ppm | coherent pulses 8 |
A calibrated binary detector can bias the observed population in either direction
- Recorded minus true, in percentage points
Exact values shown in the plot
| Category | Quantity or frame | Exact value | Preparation |
|---|---|---|---|
| 0 | Recorded minus true, in percentage points | 2 percentage points | binary readout 1 |
| 1/4 | Recorded minus true, in percentage points | 0 percentage points | binary readout 2 |
| p̂ | Recorded minus true, in percentage points | −42/115 percentage points | binary readout 3 |
| 1/2 | Recorded minus true, in percentage points | −2 percentage points | binary readout 4 |
| 3/4 | Recorded minus true, in percentage points | −4 percentage points | binary readout 5 |
| 1 | Recorded minus true, in percentage points | −6 percentage points | binary readout 6 |
Choose an experiment that could reveal the wrong circuit
Start with a claim precise enough to fail. Is the question whether the wire labels were reversed, whether a relative phase is present, whether two qubits were entangled, or how accurately a readout assigns a bit? For wire orientation choose an asymmetric input and check both outputs. For a phase choose an input that occupies both phase branches, then recombine them. For an entanglement witness measure the required observables on repeated copies prepared the same way. For readout prepare independently characterized basis inputs. A single computational-basis histogram cannot identify an arbitrary two-qubit gate. Different processes can agree on every entry of its classical truth table.
Include classical uncertainty in the test. With N independent identically prepared shots and a fixed probability q, the variance of the fraction of recorded ones is q(1 − q)/N. For a product of two signed outcomes, agreement contributes +1 and disagreement contributes −1. If f is the fraction agreeing, the estimated mean is 2f − 1, and its estimated standard error away from the boundaries is 2√[f(1 − f)/N]. Samples taken in X and Z typically come from separate preparations. Uncertainty in their sum must reflect the sampling design. Drift shared across the settings and uncertainty in the measurement axes do not disappear when the number of nominal shots grows.
A full diagnosis may need many more settings. Ideal amplitude simulation of a generic n-qubit pure state tracks 2ⁿ complex amplitudes. A register of n measured bits yields a single length-n word in each shot. State tomography uses independently prepared copies of the same state and an informationally complete set of calibrated measurement outcomes. For a pure state the resulting density matrix specifies its amplitudes up to one arbitrary global phase. A mixed state in general has no single list of pure-state amplitudes. Stabilizer descriptions exploit algebraic restrictions, and tensor-product structure simplifies special states. Those examples show why the size of one brute-force representation does not establish a speedup for a given physical circuit.
Return to the parity detector. The truth table checks the control wiring. An even Bell input, followed by X-basis measurements on the data, tests whether the apparatus preserves coherence within the even sector. An input with amplitudes in both sectors, followed by erasing the ancilla before readout and reversing preparation, tests whether a record has already escaped. Calibration shots probe the detector used to report success. These experiments separate three distinct ways a convincing-looking parity count can arise. The circuit model earns its value here by predicting which additional measurement will distinguish the alternatives.
Exact preparations and results
One wire meeting H then Z
Prepare q₀ in |0⟩ and apply the two gates in their displayed left-to-right order. To test X, place a final H after both gates and use the same Z detector.
Inputs
- Chronological gates on q₀
- H then Z
- Matrix product acting on the ket
- ZH
Results
- State just before the analyser
- |−⟩
- P(0 in Z)
- 1/2
- P(+ in X)
- 0
- Output after the additional H
- |1⟩
One wire meeting Z then H
Prepare q₀ in |0⟩ and apply the two gates in their displayed left-to-right order. To test X, place a final H after both gates and use the same Z detector.
Inputs
- Chronological gates on q₀
- Z then H
- Matrix product acting on the ket
- HZ
Results
- State just before the analyser
- |+⟩
- P(0 in Z)
- 1/2
- P(+ in X)
- 1
- Output after the additional H
- |0⟩
Recombine the two branches for phase gate angle φ = 0°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 0°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- 1
- P(+Y)
- 1/2
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0 and P(+Y) = 0.5.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 45°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 45°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- [1 + cos(45°)]/2 ≈ 0.8535533906
- P(+Y)
- [1 + sin(45°)]/2 ≈ 0.8535533906
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0.1464466094 and P(+Y) = 0.1464466094.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 90°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 90°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- 1/2
- P(+Y)
- 1
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0.5 and P(+Y) = 0.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 135°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 135°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- [1 + cos(135°)]/2 ≈ 0.1464466094
- P(+Y)
- [1 + sin(135°)]/2 ≈ 0.8535533906
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0.8535533906 and P(+Y) = 0.1464466094.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 180°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 180°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- 0
- P(+Y)
- 1/2
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 1 and P(+Y) = 0.5.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 225°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 225°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- [1 + cos(225°)]/2 ≈ 0.1464466094
- P(+Y)
- [1 + sin(225°)]/2 ≈ 0.1464466094
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0.8535533906 and P(+Y) = 0.8535533906.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 270°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 270°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- 1/2
- P(+Y)
- 0
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0.5 and P(+Y) = 1.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Recombine the two branches for phase gate angle φ = 315°
Prepare q₀ in |0⟩, apply Rᵧ(90°), then P(φ). For X append H then measure Z. For Y append S† followed by H, then measure Z. In both analysers detector bit 0 means the + eigenvalue.
Inputs
- Phase added by P on |1⟩
- 315°
- Equivalent controlled implementation
- Prepare a |+⟩ control. Apply identity on the target for control 0 and the specified e^(iφ)I on the target for control 1. The phase is relative to the idle control branch.
Results
- P(0 in Z) and P(1 in Z)
- 1/2 each
- P(+X)
- [1 + cos(315°)]/2 ≈ 0.8535533906
- P(+Y)
- [1 + sin(315°)]/2 ≈ 0.1464466094
- Replacing Rᵧ(90°) with Rᵧ(270°)
- Opposite signs of the nonzero rotation coefficients shift the resulting relative phase by 180°. Then P(+X) = 0.1464466094 and P(+Y) = 0.8535533906.
- At a single populated branch
- At θ = 0° or 180° there is no relative phase between two populated branches.
Reverse the CNOT direction on input |00⟩
The first digit is q₀ and the second q₁. Read both outputs in Z. A CNOT flips its target if the control digit is 1.
Inputs
- Register word before either circuit
- 00
- First wiring
- Control q₀, target q₁
- Second wiring
- Control q₁, target q₀
Results
- Output word, q₀ controls q₁
- 00
- Output word, q₁ controls q₀
- 00
- Probability of the original word for the two wirings
- 1 and 1
Reverse the CNOT direction on input |01⟩
The first digit is q₀ and the second q₁. Read both outputs in Z. A CNOT flips its target if the control digit is 1.
Inputs
- Register word before either circuit
- 01
- First wiring
- Control q₀, target q₁
- Second wiring
- Control q₁, target q₀
Results
- Output word, q₀ controls q₁
- 01
- Output word, q₁ controls q₀
- 11
- Probability of the original word for the two wirings
- 1 and 0
Reverse the CNOT direction on input |10⟩
The first digit is q₀ and the second q₁. Read both outputs in Z. A CNOT flips its target if the control digit is 1.
Inputs
- Register word before either circuit
- 10
- First wiring
- Control q₀, target q₁
- Second wiring
- Control q₁, target q₀
Results
- Output word, q₀ controls q₁
- 11
- Output word, q₁ controls q₀
- 10
- Probability of the original word for the two wirings
- 0 and 1
Reverse the CNOT direction on input |11⟩
The first digit is q₀ and the second q₁. Read both outputs in Z. A CNOT flips its target if the control digit is 1.
Inputs
- Register word before either circuit
- 11
- First wiring
- Control q₀, target q₁
- Second wiring
- Control q₁, target q₀
Results
- Output word, q₀ controls q₁
- 10
- Output word, q₁ controls q₀
- 01
- Probability of the original word for the two wirings
- 0 and 0
Compare joint agreement and one-wire marginals in ZZ
Prepare |00⟩, put H on upper q₀, then CNOT from q₀ to q₁ for Φ+. For the comparison mixture, emit 00 or 11 with equal probabilities. To measure XX apply H on both wires before Z readout.
Inputs
- Measured joint basis
- ZZ
- Complementary data for the trusted-axis sample
- 350 equal pairs among 400 independent shots in this basis.
Results
- Bell joint probability for each equal pair
- 1/2
- Bell joint probability for each unequal pair
- 0
- Classical-mixture probability for each equal pair
- 1/2
- Classical-mixture probability for each unequal pair
- 0
- Individual first-outcome probability
- 1/2 on either wire for either preparation.
- Sample sign-product estimate
- 2 × 350/400 − 1 = 3/4
- Estimated standard error of this signed mean
- 0.03307189139
Compare joint agreement and one-wire marginals in XX
Prepare |00⟩, put H on upper q₀, then CNOT from q₀ to q₁ for Φ+. For the comparison mixture, emit 00 or 11 with equal probabilities. To measure XX apply H on both wires before Z readout.
Inputs
- Measured joint basis
- XX
- Complementary data for the trusted-axis sample
- 350 equal pairs among 400 independent shots in this basis.
Results
- Bell joint probability for each equal pair
- 1/2
- Bell joint probability for each unequal pair
- 0
- Classical-mixture probability for each equal pair
- 1/4
- Classical-mixture probability for each unequal pair
- 1/4
- Individual first-outcome probability
- 1/2 on either wire for either preparation.
- Sample sign-product estimate
- 2 × 350/400 − 1 = 3/4
- Estimated standard error of this signed mean
- 0.03307189139
Data word 00 after a parity flag
Use q₀, q₁ and a last-wire ancilla initially 0. Apply CNOT q₀→ancilla and then q₁→ancilla. Measure the ancilla in Z. Read the two data wires separately only for this subsequent conditional Z-distribution check.
Inputs
- Data input word component
- 00
- Input squared weight
- 1/2
- After the first CNOT on this component
- 000
- After the second CNOT on this component
- 000
Results
- Even and odd flag probabilities
- 3/4 and 1/4
- Joint probabilities of this word with even and odd flags
- 1/2 and 0
- Conditional Z probability of this word given even
- 2/3
- Conditional Z probability of this word given odd
- 0
- Unsorted Z probability of this word
- 1/2
- Coherence retained
- Positive relative amplitudes within the measured sector survive the ideal parity projection.
Data word 01 after a parity flag
Use q₀, q₁ and a last-wire ancilla initially 0. Apply CNOT q₀→ancilla and then q₁→ancilla. Measure the ancilla in Z. Read the two data wires separately only for this subsequent conditional Z-distribution check.
Inputs
- Data input word component
- 01
- Input squared weight
- 1/8
- After the first CNOT on this component
- 010
- After the second CNOT on this component
- 011
Results
- Even and odd flag probabilities
- 3/4 and 1/4
- Joint probabilities of this word with even and odd flags
- 0 and 1/8
- Conditional Z probability of this word given even
- 0
- Conditional Z probability of this word given odd
- 1/2
- Unsorted Z probability of this word
- 1/8
- Coherence retained
- Positive relative amplitudes within the measured sector survive the ideal parity projection.
Data word 10 after a parity flag
Use q₀, q₁ and a last-wire ancilla initially 0. Apply CNOT q₀→ancilla and then q₁→ancilla. Measure the ancilla in Z. Read the two data wires separately only for this subsequent conditional Z-distribution check.
Inputs
- Data input word component
- 10
- Input squared weight
- 1/8
- After the first CNOT on this component
- 101
- After the second CNOT on this component
- 101
Results
- Even and odd flag probabilities
- 3/4 and 1/4
- Joint probabilities of this word with even and odd flags
- 0 and 1/8
- Conditional Z probability of this word given even
- 0
- Conditional Z probability of this word given odd
- 1/2
- Unsorted Z probability of this word
- 1/8
- Coherence retained
- Positive relative amplitudes within the measured sector survive the ideal parity projection.
Data word 11 after a parity flag
Use q₀, q₁ and a last-wire ancilla initially 0. Apply CNOT q₀→ancilla and then q₁→ancilla. Measure the ancilla in Z. Read the two data wires separately only for this subsequent conditional Z-distribution check.
Inputs
- Data input word component
- 11
- Input squared weight
- 1/4
- After the first CNOT on this component
- 111
- After the second CNOT on this component
- 110
Results
- Even and odd flag probabilities
- 3/4 and 1/4
- Joint probabilities of this word with even and odd flags
- 1/4 and 0
- Conditional Z probability of this word given even
- 1/3
- Conditional Z probability of this word given odd
- 0
- Unsorted Z probability of this word
- 1/4
- Coherence retained
- Positive relative amplitudes within the measured sector survive the ideal parity projection.
Return to the original data state after the procedure “Undo record”
Keep the ancilla coherent. Undo q₁→ancilla, then q₀→ancilla, before readout. Project the final data register onto its own original pure input. A known inverse preparation and measurement of its starting word can implement this test.
Inputs
- Four-word positive-amplitude input probabilities
- 1/2, 1/8, 1/8, 1/4 in 00, 01, 10, 11 order
- Even Bell input
- (|00⟩ + |11⟩)/√2. Its odd flag never occurs, so there is no conditional state given odd.
Results
- Original-state return, four-word input
- 1
- Original-state return, even Bell input
- 1
Return to the original data state after the procedure “Read parity”
Read Z on the ancilla, then forget that parity flag. Project the final data register onto its own original pure input. A known inverse preparation and measurement of its starting word can implement this test.
Inputs
- Four-word positive-amplitude input probabilities
- 1/2, 1/8, 1/8, 1/4 in 00, 01, 10, 11 order
- Even Bell input
- (|00⟩ + |11⟩)/√2. Its odd flag never occurs, so there is no conditional state given odd.
Results
- Original-state return, four-word input
- 5/8
- Original-state return, even Bell input
- 1
Return to the original data state after the procedure “Read both bits”
Read both individual data qubits in Z, then forget both outcomes. Project the final data register onto its own original pure input. A known inverse preparation and measurement of its starting word can implement this test.
Inputs
- Four-word positive-amplitude input probabilities
- 1/2, 1/8, 1/8, 1/4 in 00, 01, 10, 11 order
- Even Bell input
- (|00⟩ + |11⟩)/√2. Its odd flag never occurs, so there is no conditional state given odd.
Results
- Original-state return, four-word input
- 11/32
- Original-state return, even Bell input
- 1/2
Three-wire register Input for the routed CNOT
Arrange q₀—q₁—q₂ on a line. Use q₀ as the remote logical control, preserve q₁ and flip q₂ conditional on q₀. Time runs from input through G1, G2, G3 and G4. An arrow points from the physical control to the target.
Inputs
- Gate prefix completed
- No gate
- CNOT block time at this stage
- 0 ns
- Selected input and wire order
- 110, with q₀ first and q₂ last.
Results
- Selected three-bit word now
- 110
- Current basis words for all eight ordered inputs
- 000 → 000, 001 → 001, 010 → 010, 011 → 011, 100 → 100, 101 → 101, 110 → 110, 111 → 111
- Timing for the complete schedule
- 4 successive 200 ns CNOTs plus one preceding parallel 20 ns single-qubit layer give 820 ns. These times exclude preparation or readout overhead beyond that stated layer.
Three-wire register G1 0→1 for the routed CNOT
Arrange q₀—q₁—q₂ on a line. Use q₀ as the remote logical control, preserve q₁ and flip q₂ conditional on q₀. Time runs from input through G1, G2, G3 and G4. An arrow points from the physical control to the target.
Inputs
- Gate prefix completed
- q₀→q₁
- CNOT block time at this stage
- 200 ns
- Selected input and wire order
- 110, with q₀ first and q₂ last.
Results
- Selected three-bit word now
- 100
- Current basis words for all eight ordered inputs
- 000 → 000, 001 → 001, 010 → 010, 011 → 011, 100 → 110, 101 → 111, 110 → 100, 111 → 101
- Timing for the complete schedule
- 4 successive 200 ns CNOTs plus one preceding parallel 20 ns single-qubit layer give 820 ns. These times exclude preparation or readout overhead beyond that stated layer.
Three-wire register G2 1→2 for the routed CNOT
Arrange q₀—q₁—q₂ on a line. Use q₀ as the remote logical control, preserve q₁ and flip q₂ conditional on q₀. Time runs from input through G1, G2, G3 and G4. An arrow points from the physical control to the target.
Inputs
- Gate prefix completed
- q₀→q₁, q₁→q₂
- CNOT block time at this stage
- 400 ns
- Selected input and wire order
- 110, with q₀ first and q₂ last.
Results
- Selected three-bit word now
- 100
- Current basis words for all eight ordered inputs
- 000 → 000, 001 → 001, 010 → 011, 011 → 010, 100 → 111, 101 → 110, 110 → 100, 111 → 101
- Timing for the complete schedule
- 4 successive 200 ns CNOTs plus one preceding parallel 20 ns single-qubit layer give 820 ns. These times exclude preparation or readout overhead beyond that stated layer.
Three-wire register G3 0→1 for the routed CNOT
Arrange q₀—q₁—q₂ on a line. Use q₀ as the remote logical control, preserve q₁ and flip q₂ conditional on q₀. Time runs from input through G1, G2, G3 and G4. An arrow points from the physical control to the target.
Inputs
- Gate prefix completed
- q₀→q₁, q₁→q₂, q₀→q₁
- CNOT block time at this stage
- 600 ns
- Selected input and wire order
- 110, with q₀ first and q₂ last.
Results
- Selected three-bit word now
- 110
- Current basis words for all eight ordered inputs
- 000 → 000, 001 → 001, 010 → 011, 011 → 010, 100 → 101, 101 → 100, 110 → 110, 111 → 111
- Timing for the complete schedule
- 4 successive 200 ns CNOTs plus one preceding parallel 20 ns single-qubit layer give 820 ns. These times exclude preparation or readout overhead beyond that stated layer.
Three-wire register G4 1→2 for the routed CNOT
Arrange q₀—q₁—q₂ on a line. Use q₀ as the remote logical control, preserve q₁ and flip q₂ conditional on q₀. Time runs from input through G1, G2, G3 and G4. An arrow points from the physical control to the target.
Inputs
- Gate prefix completed
- q₀→q₁, q₁→q₂, q₀→q₁, q₁→q₂
- CNOT block time at this stage
- 800 ns
- Selected input and wire order
- 110, with q₀ first and q₂ last.
Results
- Selected three-bit word now
- 111
- Current basis words for all eight ordered inputs
- 000 → 000, 001 → 001, 010 → 010, 011 → 011, 100 → 101, 101 → 100, 110 → 111, 111 → 110
- Timing for the complete schedule
- 4 successive 200 ns CNOTs plus one preceding parallel 20 ns single-qubit layer give 820 ns. These times exclude preparation or readout overhead beyond that stated layer.
Apply 1 nominal Rᵧ(90°) pulses
Begin in |0⟩. Each chronological pulse has the same fixed axis and +1° angle error. Compare the prepared pure output with the ideal state for that same number of pulses.
Inputs
- Pulse count m
- 1
- Nominal and actual total angles
- 90° and 91°
Results
- State infidelity
- sin²(1/2 degrees) ≈ 7.61524218e−05
- One-pulse infidelity multiplied by m
- 7.61524218e−05
- Direct Z-detector probability of 1
- 0.5087262032
- Infidelity / direct-Z interpretation
- They coincide for an ideal return to 0 (four or eight pulses here). An arbitrary ideal output may require a different final projection.
Apply 2 nominal Rᵧ(90°) pulses
Begin in |0⟩. Each chronological pulse has the same fixed axis and +1° angle error. Compare the prepared pure output with the ideal state for that same number of pulses.
Inputs
- Pulse count m
- 2
- Nominal and actual total angles
- 180° and 182°
Results
- State infidelity
- sin²(2/2 degrees) ≈ 0.0003045864905
- One-pulse infidelity multiplied by m
- 0.0001523048436
- Direct Z-detector probability of 1
- 0.9996954135
- Infidelity / direct-Z interpretation
- They coincide for an ideal return to 0 (four or eight pulses here). An arbitrary ideal output may require a different final projection.
Apply 4 nominal Rᵧ(90°) pulses
Begin in |0⟩. Each chronological pulse has the same fixed axis and +1° angle error. Compare the prepared pure output with the ideal state for that same number of pulses.
Inputs
- Pulse count m
- 4
- Nominal and actual total angles
- 360° and 364°
Results
- State infidelity
- sin²(4/2 degrees) ≈ 0.00121797487
- One-pulse infidelity multiplied by m
- 0.0003046096872
- Direct Z-detector probability of 1
- 0.00121797487
- Infidelity / direct-Z interpretation
- They coincide for an ideal return to 0 (four or eight pulses here). An arbitrary ideal output may require a different final projection.
Apply 8 nominal Rᵧ(90°) pulses
Begin in |0⟩. Each chronological pulse has the same fixed axis and +1° angle error. Compare the prepared pure output with the ideal state for that same number of pulses.
Inputs
- Pulse count m
- 8
- Nominal and actual total angles
- 720° and 728°
Results
- State infidelity
- sin²(8/2 degrees) ≈ 0.004865965629
- One-pulse infidelity multiplied by m
- 0.0006092193744
- Direct Z-detector probability of 1
- 0.004865965629
- Infidelity / direct-Z interpretation
- They coincide for an ideal return to 0 (four or eight pulses here). An arbitrary ideal output may require a different final projection.
Forward detector response at p = 0
Use a binary measurement with false-one probability 1/50 and false-zero probability 3/50. The detector gives q = 1/50 + (23/25)p. The marked p̂ is inferred from 292 recorded ones in 1,000 independent shots.
Inputs
- False one on a true zero
- 0.02
- False zero on a true one
- 0.06
- Calibrated response slope
- 0.92
Results
- Predicted recorded fraction q
- 1/50
- True population p
- 0
- Difference q − p
- 1/50
- Plotted assignment bias
- 2 percentage points
Forward detector response at p = 1/4
Use a binary measurement with false-one probability 1/50 and false-zero probability 3/50. The detector gives q = 1/50 + (23/25)p. The marked p̂ is inferred from 292 recorded ones in 1,000 independent shots.
Inputs
- False one on a true zero
- 0.02
- False zero on a true one
- 0.06
- Calibrated response slope
- 0.92
Results
- Predicted recorded fraction q
- 1/4
- True population p
- 1/4
- Difference q − p
- 0
- Plotted assignment bias
- 0 percentage points
Forward detector response at p = 34/115
Use a binary measurement with false-one probability 1/50 and false-zero probability 3/50. The detector gives q = 1/50 + (23/25)p. The marked p̂ is inferred from 292 recorded ones in 1,000 independent shots.
Inputs
- False one on a true zero
- 0.02
- False zero on a true one
- 0.06
- Calibrated response slope
- 0.92
Results
- Predicted recorded fraction q
- 73/250
- True population p
- 34/115
- Difference q − p
- −21/5750
- Plotted assignment bias
- −0.3652173913 percentage points
- Sampling standard error of recorded fraction
- 0.01437831701
- Sampling standard error of inferred population
- 0.01562860544
- Inversion domain
- The denominator 1 − ε₀ − ε₁ must be nonzero. The uncertainty quoted treats the calibrated error probabilities as fixed.
Forward detector response at p = 1/2
Use a binary measurement with false-one probability 1/50 and false-zero probability 3/50. The detector gives q = 1/50 + (23/25)p. The marked p̂ is inferred from 292 recorded ones in 1,000 independent shots.
Inputs
- False one on a true zero
- 0.02
- False zero on a true one
- 0.06
- Calibrated response slope
- 0.92
Results
- Predicted recorded fraction q
- 12/25
- True population p
- 1/2
- Difference q − p
- −1/50
- Plotted assignment bias
- −2 percentage points
Forward detector response at p = 3/4
Use a binary measurement with false-one probability 1/50 and false-zero probability 3/50. The detector gives q = 1/50 + (23/25)p. The marked p̂ is inferred from 292 recorded ones in 1,000 independent shots.
Inputs
- False one on a true zero
- 0.02
- False zero on a true one
- 0.06
- Calibrated response slope
- 0.92
Results
- Predicted recorded fraction q
- 71/100
- True population p
- 3/4
- Difference q − p
- −1/25
- Plotted assignment bias
- −4 percentage points
Forward detector response at p = 1
Use a binary measurement with false-one probability 1/50 and false-zero probability 3/50. The detector gives q = 1/50 + (23/25)p. The marked p̂ is inferred from 292 recorded ones in 1,000 independent shots.
Inputs
- False one on a true zero
- 0.02
- False zero on a true one
- 0.06
- Calibrated response slope
- 0.92
Results
- Predicted recorded fraction q
- 47/50
- True population p
- 1
- Difference q − p
- −3/50
- Plotted assignment bias
- −6 percentage points
Limits on the inputs
- Wire and gate order
- Write q₀ first in a basis word. Gates act chronologically from left to right and the rightmost factor of a matrix product acts first. Name each control, target, analyser and measured record.
- Tomography and samples
- Use independently prepared copies of the same state with calibrated informationally complete outcomes. A pure reconstructed density matrix specifies a state vector up to global phase. A mixed state generally has no single pure-state vector.
- Witness and readout assumptions
- The sample witness uses trusted axes and separate independent shots in each basis. Statistical errors and calibration uncertainty are distinct. Gate-test counts do not by themselves specify an entire channel.
Worked examples
Find a reversed gate order
Two devices start in |0⟩. One applies H then Z and the other Z then H. A Z detector gives about half 1s from each. Which additional measurement identifies them?
- Work forward on the input. H|0⟩ = |+⟩ and Z|+⟩ = |−⟩ for the first device. For the second, Z|0⟩ = |0⟩ and H|0⟩ = |+⟩. In both cases the absolute squares of the computational amplitudes are 1/2.
- Insert H immediately before the Z detector. Its two possible inputs are X eigenstates. H|−⟩ = |1⟩ and H|+⟩ = |0⟩. The ideal outputs are now deterministic and opposite.
- The originally measured agreement did not imply equal output states. Here the two states are orthogonal. A device producing a mixture from uncontrolled phase drift would give an intermediate contrast, which could be investigated by calibrating preparation and readout.
Measure X. The device that applies H first gives −1 and the device that applies Z first gives +1 with certainty under the ideal preparation.
Find a phase without observing a global phase
Compare controlled I with a specified controlled operation that applies iI on the control-1 branch. Prepare a |+⟩ control and an arbitrary target state. Which settings reveal the difference?
- Expand the control into its 0 and 1 branches. The target stays in its input state in both branches. The controls emerge as |+⟩ and (|0⟩ + i|1⟩)/√2 respectively. This derivation also holds for a mixed target because the controlled phase acts as a product operation here.
- Both controls have P(1 in Z) = 1/2. In X the first has P(+) = 1 and the second has P(+) = 1/2. In Y the first has P(+) = 1/2 and the second has P(+) = 1. Either transverse setting distinguishes the preparations statistically.
- A simultaneous phase applied to both joint branches would cancel from these predictions. The controlled hardware specifies how the inactive branch is referenced to the active branch, information absent from the target channel alone.
Use X or Y on the control. The target alone undergoes the identity channel in both devices.
Use two histograms to test entanglement
The two Z bits agree 350 times in 400 trials. On 400 independently prepared pairs the X bits also agree 350 times. Assume trusted axes, independent shots, and stable preparations. Do the counts exceed the separable-state bound?
- In each basis, assign +1 to agreement and −1 to disagreement. The estimated expectation is (350 − 50)/400 = 0.75. Their absolute values sum to 1.50. The separable bound for these trusted axes is one.
- For either signed mean the estimated standard error is √[(1 − 0.75²)/400] ≈ 0.0331. The two settings were sampled independently and the measured expectations are well away from zero. Their sum has estimated standard error √2 × 0.0331 ≈ 0.0468.
- The excess above one is 0.50. This comparison describes sampling fluctuations under the stated design. A rigorous finite-sample claim can instead use confidence bounds on the two signed means. Misidentified axes, postselection and a drift correlated with the basis choice require separate control.
The measured witness is 1.50 with an estimated sampling standard error of 0.047. It gives evidence of entanglement under the stated model. It does not establish a loophole-free Bell test.
Keep a superposition inside a measured sector
A pure data state has positive real amplitudes with squared magnitudes 1/2, 1/8, 1/8 and 1/4 in the order 00, 01, 10, 11. The ancilla circuit measures parity. What survives the measurement?
- The even words carry total weight 1/2 + 1/4 = 3/4 and the odd words carry 1/8 + 1/8 = 1/4. Conditional on even parity the probabilities of 00 and 11 are 2/3 and 1/3. Their positive amplitudes are √(2/3) and √(1/3). An odd result prepares (|01⟩ + |10⟩)/√2.
- If the parity is measured and forgotten, the mixture of the two sector states has weights 3/4 and 1/4. Its return probability under projection onto the original pure state is (3/4)² + (1/4)² = 5/8. This projection could be implemented by reversing a known preparation circuit and checking for its starting word.
- If the meter has not been read and no external degree of freedom has recorded parity, undo both ancilla gates first. The original data state now returns with probability one. The conditional distribution within either reading alone cannot establish which history the apparatus followed.
The ideal parity measurement retains each sector’s internal coherence. An ignored outcome gives return probability 5/8. Coherent uncomputation before a record escapes gives return probability one.
Route a gate past an occupied qubit
On a three-site chain, q₀ and q₂ are not directly connected. Verify the four-CNOT implementation on |110⟩, then decide whether it works when q₁ is part of a superposition.
- Follow the three bits at each gate, always writing q₀ first. From 110 the first 0→1 gives 100. The first 1→2 leaves 100. Restoring the middle bit gives 110, and the last 1→2 yields 111. The first bit remains one, the middle bit returns to one and the last flips.
- For arbitrary bits a,b,c, the middle bit becomes b ⊕ a and then b again. The target changes twice, by b ⊕ a and by b. The changes in b cancel, giving c ⊕ a. Since all ideal gates map basis words with amplitude +1, the equality on the full basis extends linearly, including inputs entangled with an external reference.
- All four gates use the middle qubit, so they require four successive layers with the assumed native alphabet. At 200 ns per gate the total two-qubit duration is 800 ns. Two simultaneous 20 ns preparations by one-qubit gates on disjoint sites add 20 ns if hardware permits them to overlap.
The logical transformation is CNOT from q₀ to q₂ and identity on q₁. The assumed schedule with the parallel pulse layer takes 820 ns.
Reveal a small pulse error by repetition
A device prepares |0⟩, then executes four nominal Rᵧ(90°) pulses with the same +1° offset. Find the wrong-outcome probability and explain why four independent error probabilities would give a different model.
- Identical rotations about y add their angles. The actual total is 364°. The probability of outcome 1 is sin²(182°) = sin²(2°) ≈ 0.001218. With 10,000 independent repetitions of the entire four-pulse sequence the expected number of 1s is about 12.2, before readout errors.
- Relative to one ideal pulse, a +1° overrotation on the prepared |0⟩ gives infidelity sin²(0.5°) ≈ 0.0000762. Four times this number is about 0.000305. The fixed signed angular error added coherently in each run, so the simple sum of probabilities does not predict the return experiment.
- The four-pulse result alone cannot establish the noise mechanism. Vary the number of pulses and measure a second observable sensitive to the rotation direction. Control initial-state and detector assignment errors before fitting a coherent-angle model.
The idealized wrong probability is 0.001218. A fixed overrotation accumulates in the rotation angle before the Born probability is formed.
Correct a readout bias with a specified calibration
Calibration gives ε₀ = 0.02 and ε₁ = 0.06. The apparatus records 292 ones in 1,000 independent trials. Estimate the true population and its sampling uncertainty, treating those two calibration numbers as fixed.
- The response slope is 1 − 0.02 − 0.06 = 0.92. The recorded fraction is 0.292. Solving the binary response equation gives p̂ = (0.292 − 0.02)/0.92 ≈ 0.29565. The false-zero error exceeds the false-one error, yet the net bias still depends on the unknown population.
- The estimated sampling standard error of the recorded fraction is √[0.292 × 0.708 / 1000] ≈ 0.01438. Division by the slope gives an estimated standard error of 0.01563 for p̂. Uncertainty in the calibration numbers and systematic changes between calibration and experiment require additional propagation.
- Check by substituting the estimate into the forward expression. The result is 0.02 + 0.92 × 0.29565 ≈ 0.292. A zero slope would make this inversion undefined. A statistical estimate outside the physical interval near a boundary should prompt a model-aware uncertainty analysis.
The inferred population is about 0.296 with a sampling standard error of 0.016, conditional on the specified fixed calibration.
Try it yourself
With q₀ first in the ket, an experiment prepares |01⟩ and applies I ⊗ X. Which word reaches an ideal Z detector?
Show the answer and reasoning
00.
The right factor acts on q₁. Replacing the operation by X ⊗ I would give 11, so this input detects a reversal of the tensor-factor convention.
An equatorial qubit has relative phase φ = 270°. Give P(+X) and P(+Y).
Show the answer and reasoning
1/2 and 0, respectively.
The transverse coordinates are cos 270° = 0 and sin 270° = −1. The Y analyser must distinguish this state from one at +90°, although their Z histograms agree.
If two gates act on different ideal wires, does exchanging their order affect an initially entangled state?
Show the answer and reasoning
No, provided both are fixed local gates with no intermediate measurement, coupling or conditional control.
The operators U ⊗ I and I ⊗ V commute on the entire register, with common product U ⊗ V. This identity holds on all entangled inputs. Constraints on scheduling physical pulses are a separate issue.
Prepare the control in |+⟩ and target in |−⟩. Apply CNOT. What is the output on each wire?
Show the answer and reasoning
The control is |−⟩ and the target remains |−⟩.
The target has X eigenvalue −1. The control-1 term therefore acquires a minus sign with the target still factored out. This is a coherent phase transfer without entanglement for this input.
A source emits 00 or 11 with equal probability. Calculate its Z and X agreement probabilities and its two-axis witness.
Show the answer and reasoning
P(agree in Z) = 1, P(agree in X) = 1/2, witness = 1.
Each individual computational-basis product input gives independent fair X readings. The Z correlation is one and the X correlation is zero. An ideal |Φ+⟩ instead has unit correlation in both settings.
Apply S on the first qubit of |Φ+⟩. What does the witness using only XX and ZZ say about the resulting pure state?
Show the answer and reasoning
Its value is one, even though the state is maximally entangled.
The relative phase i makes ⟨XX⟩ zero, and both branches still have matching Z results. A local unitary preserves entanglement. A suitable rotated basis recovers the transverse correlation.
The parity circuit’s ancilla was prepared in |1⟩. How must its output labels be interpreted?
Show the answer and reasoning
Recorded 1 denotes even parity, and recorded 0 denotes odd parity.
The final ancilla bit is 1 ⊕ a ⊕ b. The parity subspaces are unchanged. Ignoring the initial ancilla value reverses their interpretation.
A data register is prepared in |Φ+⟩. What state should be assigned after an odd result in the ideal parity experiment?
Show the answer and reasoning
The ideal model assigns zero probability and gives no normalized conditional state.
Pₒ annihilates this input, so division by the odd probability is undefined. A real odd record motivates checking preparation, readout, leakage or control errors.
Drop the third gate from the four-gate remote CNOT. Do inputs with q₀ = 1 retain their middle bit?
Show the answer and reasoning
No. The middle output becomes b ⊕ 1.
The remaining gates that target q₂ never restore q₁. Tracking the entire register detects the change even if one selected final target measurement happens to agree.
Why does creating a Bell pair from |00⟩ fail to prove that a processor supplies a universal gate set?
Show the answer and reasoning
H and CNOT already create the Bell pair and both belong to the Clifford family.
With stabilizer preparations and Pauli readout the corresponding circuits admit efficient classical stabilizer simulation. Universal approximation requires additional operations, for example adding T to the full Clifford set.
Suppose the two assignment errors are 0.75 and 0.50. Is the response invertible?
Show the answer and reasoning
Yes. Its slope is −0.25.
A larger true population now decreases the probability of recording 1. The response remains one-to-one and statistical error in the inversion is amplified by a factor four. A slope equal to zero would remove all population information.
A single-qubit Clifford benchmarking fit yields r = 0.98 in the idealized depolarizing model. What fidelity follows, and what circuit prediction is still missing?
Show the answer and reasoning
The corresponding average gate fidelity is 0.99. It does not determine the error of a specified long circuit.
For pure input the depolarized output has overlap r + (1 − r)/2. Different errors can have the same average fidelity yet accumulate differently under repeated gates. Gate dependence, preparation, leakage and drift can also affect a measured decay.
What to carry forward
- Track the preparation, wire order, gate order and measurement basis to make any circuit prediction reproducible. Relative phases appear in a basis that recombines the relevant amplitudes.
- A controlled gate acts linearly on every branch. Correlation measurements on different bases distinguish a coherent Bell pair from a classical source that agrees in Z.
- An ancilla can measure parity while preserving coherence within each parity sector. Erasing an isolated ancilla and discarding a recorded result have different observable consequences.
- The available gates, physical connectivity and pulse schedule determine cost. Readout calibration, shot statistics and independent gate tests establish what the observed accuracy means.
References
Sources for the concepts and teaching approaches in this article.
- Quantum Information and Computation, Chapter 6: Quantum ComputationJohn PreskillCourse notes · PDF
- Elementary gates for quantum computationAdriano Barenco, Charles H. Bennett, Richard Cleve, David P. DiVincenzo, Norman Margolus, Peter Shor, Tycho Sleator, John A. Smolin, Harald WeinfurterResearch paper
- Demonstration of a Fundamental Quantum Logic GateC. Monroe, D. M. Meekhof, B. E. King, W. M. Itano, D. J. WinelandResearch paper
- Improved Simulation of Stabilizer CircuitsScott Aaronson, Daniel GottesmanResearch paper
- On Universal and Fault-Tolerant Quantum ComputingP. Oscar Boykin, Tal Mor, Matthew Pulver, Vwani Roychowdhury, Farrokh VatanResearch paper
- Characterizing Quantum Gates via Randomized BenchmarkingEaswar Magesan, Jay M. Gambetta, Joseph EmersonResearch paper
Sources and conventions
Quantum Information and Computation, Chapter 6: Quantum Computation. John Preskill, California Institute of Technology.
Gives the circuit model and the relationship between reversible bit operations, unitary control, measurement and computational cost.
Sections Quantum circuits, reversible computation, universal gates and circuit complexity.
Elementary gates for quantum computation. Adriano Barenco, Charles H. Bennett, Richard Cleve, David P. DiVincenzo, Norman Margolus, Peter Shor, Tycho Sleator, John A. Smolin, Harald Weinfurter, Physical Review A.
Proves that arbitrary single-qubit unitaries with a two-qubit exclusive-or are sufficient for finite-dimensional qubit circuits.
Sections 52, 3457–3467 (1995), elementary one- and two-qubit gates.
Demonstration of a Fundamental Quantum Logic Gate. C. Monroe, D. M. Meekhof, B. E. King, W. M. Itano, D. J. Wineland, Physical Review Letters.
Connects abstract control and target registers to motional and internal degrees of freedom of a single physical ion.
Sections 75, 4714–4717 (1995), conditional dynamics of a trapped ion.
Improved Simulation of Stabilizer Circuits. Scott Aaronson, Daniel Gottesman, Physical Review A.
Defines the stabilizer gate family and explains how Clifford evolution and Pauli readout on stabilizer preparations can be simulated efficiently.
Sections 70, 052328 (2004), stabilizer circuits and classical simulation.
On Universal and Fault-Tolerant Quantum Computing. P. Oscar Boykin, Tal Mor, Matthew Pulver, Vwani Roychowdhury, Farrokh Vatan, arXiv.
Supplies the density argument behind the finite Clifford-plus-T gate set, distinct from synthesis with arbitrary continuously specified single-qubit gates.
Sections 1999 preprint, universality of Hadamard, a quarter-power of Z, and controlled-NOT.
Characterizing Quantum Gates via Randomized Benchmarking. Easwar Magesan, Jay M. Gambetta, Joseph Emerson, Physical Review A.
Supports the interpretation and limits of a decay measured over random sequences.
Sections 85, 042311 (2012), average fidelity, preparation and measurement effects, and noise assumptions.