dr.David
Rhodus
Chapter 22 / 27

Circuits, Measurement, and Observables

Operating Quantum Computers · 4 min read

A circuit describes how to prepare, transform, and measure a quantum system. Its wires identify subsystems, its gates describe operations, and its measurement instructions determine which classical outcomes become available. Reading a circuit means following these operations in order while keeping quantum state and classical records distinct.

The running example prepares the Bell state Φ+ = (|00⟩ + |11⟩)/√2. Starting from |00⟩, a Hadamard gate on qubit zero creates a superposition, and a controlled-X from qubit zero to qubit one creates the correlated two-qubit state. Neither qubit individually has a definite pure state: each local reduced state is maximally mixed.

Correlation does not establish coherence

Measuring this Bell state in the computational, or Z, basis gives 00 and 11 with equal probability. However, a classical mixture containing |00⟩ half the time and |11⟩ half the time gives the same Z-basis statistics. One measurement setting therefore cannot distinguish the coherent Bell state from that mixture.

The distinction appears in other observables. For Φ+, the ideal two-qubit expectations are XX = +1, YY = −1, and ZZ = +1. Here XX means measuring Pauli X on each qubit and multiplying the two outcomes, each encoded as +1 or −1. The negative YY correlation is part of the state, not evidence of an implementation failure.

The project measures X by applying H before computational-basis readout. It measures Y by applying S† followed by H before readout. Z requires no basis rotation. Each basis uses a fresh preparation. These are three experimental settings, not three simultaneous records extracted from one pair of qubits.

The complete runnable circuit source is introduced with the shared experiment in chapter 4.

The embedded implementation also shows exactly where the simulator applies noise. Its density-matrix method is a simulation technique. It does not imply that a hardware device makes its complete density matrix available to the operator.

From bitstrings to an observable

For any one of these same-basis measurements, even-parity strings 00 and 11 contribute +1; odd-parity strings 01 and 10 contribute −1. With N shots, the estimated correlation is:

E = (count00 + count11 − count01 − count10) / N.

Qiskit displays a two-bit string in q1q0 order, with qubit zero on the right. The parity expression happens to be symmetric under exchanging the two bits, so this example can hide an ordering mistake. An asymmetric circuit or a single-qubit observable will expose it. Preserve the mapping from qubits to classical bits even when the current statistic is insensitive to it. The IBM bit-ordering guide documents that convention.

The Bell overlap for correctly characterized ideal Pauli measurements is F = (1 + E_XX − E_YY + E_ZZ) / 4. This follows from the Pauli expansion of the Φ+ projector. With uncorrected measurement errors, the same arithmetic produces the lab's raw measured score; it is not automatically an unbiased estimate of prepared-state fidelity.

Worked example: calculate the score

Suppose 100 shots per basis produce 96 even-parity outcomes in XX, 95 odd-parity outcomes in YY, and 97 even-parity outcomes in ZZ. The correlations are 0.92, −0.90, and 0.94. Therefore the score is (1 + 0.92 + 0.90 + 0.94) / 4 = 0.94.

That calculation does not establish precision. With only 100 samples per basis, the example's simultaneous confidence interval remains broad. More shots can reduce sampling uncertainty under the model, but cannot remove a systematic measurement bias or create coherence that preparation failed to produce.

For the classical 00/11 mixture, XX and YY both average to zero while ZZ remains one. Its ideal Bell overlap is therefore 0.5. This explains why checking only the attractive-looking Z histogram would be inadequate.

Exercise: spot two interpretation errors

A colleague replaces the minus sign before YY with a plus sign and obtains 0.49 from the worked counts. Another calls the three correlation measurements a CHSH experiment. What is wrong?

Answer. The Bell projector requires subtracting YY, so the correct score is 0.94. The alternate sign changes the observable being estimated. A CHSH test requires its specified combinations of measurement settings and assumptions; measuring XX, YY, and ZZ for Bell-overlap estimation does not by itself implement that test.

A measurement record becomes meaningful through its observable definition. The next step is to understand the hardware constraints that determine whether those intended operations and measurements can be realized.

Related reference readings