Skip to Content
Measurement and Mixed States

Measurement and Mixed States

Quantum computations that produce classical output end with measurement, which is not a unitary, reversible operation on the measured system. This page covers what measurement does to a state, how to measure along axes other than Z, how repeated runs estimate probabilities, and how density matrices describe noisy qubits and subsystems of entangled states.

The Quantum Simulator  can reproduce the ideal-gate measurement and reduced-state exercises on this page. It reports probabilities, sampled counts and reduced-state Bloch vectors after each run. The later noise-channel equations are not adjustable QSim controls.

The Born rule

Measuring a single qubit ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle in the computational basis returns 0 with probability α2|\alpha|^2 and 1 with probability β2|\beta|^2. For a register the rule is the same, applied to one qubit at a time. Measuring qubit kk of an nn‑qubit state uses the projectors

Π0(k)=x:xk=0xx,Π1(k)=x:xk=1xx,Π0(k)+Π1(k)=I.\Pi_0^{(k)} = \sum_{x\,:\,x_k = 0} |x\rangle\langle x|, \qquad \Pi_1^{(k)} = \sum_{x\,:\,x_k = 1} |x\rangle\langle x|, \qquad \Pi_0^{(k)} + \Pi_1^{(k)} = I .

Outcome bb occurs with probability pb=Πb(k)ψ2p_b = \lVert \Pi_b^{(k)}|\psi\rangle\rVert^2, and the state afterwards is the projected vector, renormalised:

ψ    Πb(k)ψpb.|\psi\rangle \;\longmapsto\; \frac{\Pi_b^{(k)}|\psi\rangle}{\sqrt{p_b}} .

Conditioning on a particular outcome makes the normalized state-update rule nonlinear in the input state. The projection is noninvertible: amplitudes inconsistent with the observed outcome are removed from the conditional state and cannot be reconstructed by a later gate acting only on that state.

Measuring along other axes

Many quantum-computing platforms expose computational-basis, or Z-basis, measurement as the native operation. To measure along a different axis, rotate the desired eigenbasis onto the computational basis first. The common cases are:

BasisStatesRotate first withThen read
Z0, 1\lvert 0\rangle,\ \lvert 1\ranglenothingoutcome is the Z result
X+, \lvert +\rangle,\ \lvert -\rangleHH0 means +\lvert +\rangle
Y+i, i\lvert +i\rangle,\ \lvert -i\rangleSS^{\dagger} then HH0 means +i\lvert +i\rangle

Here ±=(0±1)/2|\pm\rangle = (|0\rangle \pm |1\rangle)/\sqrt{2} and ±i=(0±i1)/2|{\pm}i\rangle = (|0\rangle \pm i|1\rangle)/\sqrt{2}. The probabilities obtained this way are the Born-rule probabilities in the chosen basis, such as +ψ2|\langle +|\psi\rangle|^2. The pre-rotation physically changes the state so that a subsequent Z-basis measurement implements the desired measurement on the original state.

From amplitudes to statistics

A single run yields one outcome, while repeated runs estimate outcome probabilities. Estimating a Bernoulli probability pp from NN independent shots gives a sample-proportion standard deviation p(1p)/N1/(2N)\sqrt{p(1-p)/N} \le 1/(2\sqrt{N}). Reducing this standard deviation by a factor of ten requires a hundred times as many shots. Sampling cost can therefore dominate some variational workloads.

Expectation values are the usual way to summarise a run. For an observable AA,

A=ψAψ=Tr(ρA),\langle A\rangle = \langle\psi|A|\psi\rangle = \mathrm{Tr}(\rho A),

and for the Pauli operators this reduces to counting: Z=P(0)P(1)\langle Z\rangle = P(0) - P(1), with X\langle X\rangle and Y\langle Y\rangle obtained the same way after the rotations in the table above.

Density matrices

A state vector can describe a pure joint entangled state, but it generally cannot describe one subsystem alone or a statistical mixture. The general state description is the density matrix

ρ=ipiψiψi,\rho = \sum_i p_i\, |\psi_i\rangle\langle\psi_i| ,

a weighted mixture of pure states with pi0p_i \ge 0 and ipi=1\sum_i p_i = 1. Every density matrix is positive semi‑definite with Tr(ρ)=1\mathrm{Tr}(\rho) = 1. A pure state is the special case ρ=ψψ\rho = |\psi\rangle\langle\psi|.

The purity Tr(ρ2)\mathrm{Tr}(\rho^2) equals 1 exactly when the state is pure. Its minimum is 1/d1/d, attained by the maximally mixed state in dimension dd, so the minimum is 1/21/2 for a single qubit. Purity measures mixedness, but a subsystem may be mixed because of entanglement rather than environmental decoherence.

Note that a mixture is not a superposition. The state (0+1)/2(|0\rangle+|1\rangle)/\sqrt{2} has X=1\langle X\rangle = 1, while an equal mixture of |0⟩ and |1⟩ has X=0\langle X\rangle = 0. They give identical Z‑basis statistics and differ completely in X. A projective Z-basis measurement whose result is discarded converts the first state into the second: the off‑diagonal entries of ρ\rho, called coherences, are set to zero while the diagonal is unchanged.

The Bloch ball

For a single qubit, expanding ρ\rho in the Pauli basis gives

ρ=12(I+rxX+ryY+rzZ),r=(X,Y,Z).\rho = \tfrac{1}{2}\left(I + r_x X + r_y Y + r_z Z\right), \qquad \vec{r} = \big(\langle X\rangle, \langle Y\rangle, \langle Z\rangle\big).

The vector r\vec r is exactly the arrow drawn on the Bloch sphere, and the purity is 12(1+r2)\tfrac{1}{2}(1 + |\vec r|^2). So pure states have r=1|\vec r| = 1 and sit on the surface, mixed states have r<1|\vec r| < 1 and sit strictly inside, and the maximally mixed state I/2I/2 is the centre. The Bloch sphere of the earlier pages is really a solid ball once mixed states are allowed.

Why an entangled qubit looks mixed

Given a two‑qubit state ρAB\rho_{AB}, the description of qubit AA alone is the reduced density matrix obtained by tracing out BB:

ρA=TrB(ρAB).\rho_A = \mathrm{Tr}_B(\rho_{AB}).

For the Bell state Φ+=(00+11)/2|\Phi^+\rangle = (|00\rangle+|11\rangle)/\sqrt{2}, this gives ρA=I/2\rho_A = I/2, with purity 1/21/2 and its Bloch vector at the origin. The joint state is pure, yet each half is maximally mixed. The correlations are properties of the joint state rather than either reduced state, which is why the simulator shows both local Bloch vectors at the origin after a Bell pair is built.

Noise as a channel

Real hardware evolves states by more than unitaries. The general operation is a quantum channel, written with a set of Kraus operators {Ki}\{K_i\} obeying iKiKi=I\sum_i K_i^{\dagger}K_i = I:

E(ρ)=iKiρKi.\mathcal{E}(\rho) = \sum_i K_i\,\rho\,K_i^{\dagger}.

The following three channels are common introductory models of single-qubit noise.

QSim’s circuit builder currently applies ideal gates and does not expose these channels as configurable operations. The equations below explain real-device noise and provide targets for analytical calculation; increasing QSim’s shot count changes sampling precision, not decoherence. Use a noise-aware simulator when an experiment requires adjustable T1T_1, T2T_2, readout error or gate-error parameters.

Depolarising noise replaces the state with the maximally mixed one with probability pp. With K0=13p/4IK_0 = \sqrt{1-3p/4}\,I and K1,2,3=p/4{X,Y,Z}K_{1,2,3} = \sqrt{p/4}\,\{X, Y, Z\},

E(ρ)=(1p)ρ+pI2,\mathcal{E}(\rho) = (1-p)\,\rho + p\,\frac{I}{2},

which simply shrinks the Bloch vector towards the centre: r(1p)r\vec r \mapsto (1-p)\vec r.

Amplitude damping models energy relaxation to the environment, including the idealized T1T_1 process in which |1⟩ decays to |0⟩. With

K0=[1001γ],K1=[0γ00],K_0 = \begin{bmatrix}1 & 0\\ 0 & \sqrt{1-\gamma}\end{bmatrix}, \qquad K_1 = \begin{bmatrix}0 & \sqrt{\gamma}\\ 0 & 0\end{bmatrix},

the Bloch vector transforms as (rx,ry)1γ(rx,ry)(r_x, r_y) \mapsto \sqrt{1-\gamma}\,(r_x, r_y) and rzγ+(1γ)rzr_z \mapsto \gamma + (1-\gamma) r_z. Unlike depolarising noise this is not symmetric: it pulls every state towards the north pole, and at γ=1\gamma = 1 it maps everything to |0⟩.

Phase-flip dephasing leaves computational-basis populations unchanged. With K0=1pIK_0 = \sqrt{1-p}\,I and K1=pZK_1 = \sqrt{p}\,Z, the equatorial components transform as (rx,ry)(12p)(rx,ry)(r_x, r_y) \mapsto (1-2p)(r_x, r_y) while rzr_z is unchanged. This channel is one model of lost phase coherence. The experimental dephasing time T2T_2 includes relaxation and pure-dephasing contributions and obeys T22T1T_2 \le 2T_1 in the usual Markovian model, so it is not universally shorter than T1T_1.

Fidelity

To say how close a noisy result is to the intended one, use the fidelity. Against a pure target ψ|\psi\rangle it is just an overlap:

F(ψ,ρ)=ψρψ.F(|\psi\rangle, \rho) = \langle\psi|\rho|\psi\rangle .

If a pure single-qubit state is depolarised by the channel defined above, its fidelity with the original state is 1p/21 - p/2. A fully depolarised output therefore has fidelity 1/21/2 with any pure single-qubit target, which is a reminder that fidelity values need a stated baseline.

Next: Entanglement and Protocols puts these tools to work, and Quantum Error Correction shows how the damage described here can be undone.

Simulator Lab: Separate Probabilities, Samples and Reduced States

The Quantum Simulator  displays exact or branch-averaged probabilities alongside sampled counts. Keeping those quantities separate makes measurement experiments much more useful.

Verify the Born rule without hiding sampling noise

Set one qubit to |0⟩, add RY with angle 2arcsin(0.2)0.92732\arcsin(\sqrt{0.2}) \approx 0.9273, and run. The state is approximately 0.80+0.21\sqrt{0.8}|0\rangle+\sqrt{0.2}|1\rangle, so the probability table should report P(1)0.2P(1)\approx0.2. The count need not equal exactly 0.2N0.2N.

Run at 100, 1,000 and 10,000 shots. The probability remains fixed while the observed frequency generally becomes steadier. Do not rerun until a random count happens to match the theoretical value; reporting the chosen shot count and the observed count is part of an honest simulation experiment.

For a worst-case Bernoulli probability near 1/21/2, useful sampling scales are:

Shots NNMaximum one-standard-deviation uncertaintyApproximate 95% margin using 1.96σ1.96\sigma
1000.05000.0980
1,0000.01580.0310
10,0000.00500.0098
1,000,0000.00050.0010

These are planning approximations for independent samples, not guarantees that every observed frequency falls inside the stated margin. Use exact QSim probabilities when checking circuit algebra; use counts when studying how finite experimental sampling behaves.

Measure X and Y using available gates

The results table is in the computational basis. Implement another measurement basis by appending the inverse basis change before running:

  • For X, append H. A 0 result represents the original state’s +|+\rangle component.
  • For Y, append S dagger and then H. The builder has RZ, so use RZ with angle π/2-\pi/2 in place of SS^{\dagger}; the difference is only a global phase. A 0 result then represents the original state’s +i|+i\rangle component.

Keep a JSON export of the state-preparation circuit before appending measurement rotations. Reload that baseline for each basis. Otherwise, measurement-basis gates from an earlier experiment can accidentally become part of the next state preparation.

Read Bloch data correctly

For a single pure qubit, the displayed Bloch values summarize the full state. For one qubit of a larger register they summarize only its reduced density matrix. The reported radius satisfies r=1r=1 for a pure reduced state and r<1r<1 for a mixed one, while ez is Z=P(0)P(1)\langle Z\rangle=P(0)-P(1).

QSim reports four useful numbers beside each rendered sphere:

DisplayMeaningEfficient interpretation
θ\thetaPolar angle from the +Z+Z axisFor a pure state, P(0)=cos2(θ/2)P(0)=\cos^2(\theta/2)
ϕ\phiAzimuthal angle in the XY planeTracks relative phase when the transverse component is nonzero
rrLength of the reduced Bloch vectorGives purity through Tr(ρ2)=(1+r2)/2\mathrm{Tr}(\rho^2)=(1+r^2)/2
ezZ component rz=Zr_z=\langle Z\rangleEquals P(0)P(1)P(0)-P(1) for that qubit

The Angles selector switches the displayed angle values between radians and degrees without changing the circuit. When r=0r=0, the vector has no direction, so θ\theta and ϕ\phi do not carry physical information even if the interface displays numerical placeholders. When the vector lies on the Z axis, ϕ\phi is likewise irrelevant.

Load Bell (2) and run. Both radii should be zero even though the full state is pure. Next load All-H on two qubits. Both radii should be one because the joint state is the product ++|+\rangle|+\rangle. These presets have uniform-looking Z-basis distributions, but their local purity and correlations are different.

Explore measurement and feed-forward

To see an actual measurement branch, build a two-qubit Bell circuit and add a conditional X on q1 with condition q0 = 1. The condition measures q0 and applies X to q1 only on the selected classical outcome. The simulator explains whether it enumerated every branch exactly or estimated many branches with shots.

After a branch-producing circuit, the CSV contains probabilities rather than one amplitude vector. That is mathematically necessary: averaging over measurement outcomes produces a density matrix, and there is generally no single state vector whose amplitudes describe the mixture.

Last updated on