|q⟩ Bad Qubits

beginner · Programming · Two Qubits & Tensor Products

Measuring One of Two Qubits

A two-qubit system lives in a four-dimensional Hilbert space spanned by 00|00\rangle, 01|01\rangle, 10|10\rangle, 11|11\rangle. When you measure only one of the two qubits you read out partial information — and the result you see, together with the way the amplitude was spread across the state, determines both the probability of each outcome and what state remains afterwards.

Marginal probabilities

Consider the product state

ψ=+0=12(0+1)0=12(00+10).|\psi\rangle = |+\rangle \otimes |0\rangle = \frac{1}{\sqrt{2}}\bigl(|0\rangle + |1\rangle\bigr) \otimes |0\rangle = \frac{1}{\sqrt{2}}\bigl(|00\rangle + |10\rangle\bigr).

The full probability vector has four entries, one per basis state:

P(00)=12,P(01)=0,P(10)=12,P(11)=0.P(|00\rangle) = \frac{1}{2}, \quad P(|01\rangle) = 0, \quad P(|10\rangle) = \frac{1}{2}, \quad P(|11\rangle) = 0.

To find the probability of getting outcome 00 when measuring only qubit 0, you sum over all values of qubit 1 that are consistent with that outcome:

P(qubit 0=0)=P(00)+P(01)=12+0=12.P(\text{qubit 0} = 0) = P(|00\rangle) + P(|01\rangle) = \tfrac{1}{2} + 0 = \tfrac{1}{2}.

Likewise, P(qubit 0=1)=P(10)+P(11)=12P(\text{qubit 0} = 1) = P(|10\rangle) + P(|11\rangle) = \tfrac{1}{2}. Both outcomes are equally likely, exactly as the Born rule predicts for a single qubit in +|+\rangle.

Post-measurement collapse

Measurement does more than produce a number — it also changes the state. If the instrument reports 00 for qubit 0, the surviving amplitude is the part of ψ|\psi\rangle compatible with that outcome: only 00|00\rangle had qubit 0 in 0|0\rangle. After re-normalizing,

ψ=00.|\psi'\rangle = |00\rangle.

If the instrument reports 11, the surviving part is 10|10\rangle, and

ψ=10.|\psi''\rangle = |10\rangle.

In either case qubit 1 ends up in 0|0\rangle — because the original state was a product state and measuring qubit 0 carries no information about qubit 1. This clean separation breaks down for entangled states, where reading one qubit can instantly determine the other; we will explore that soon.

Try it

Prepare the two-qubit state +0|{+}0\rangle by applying a Hadamard to qubit 0, then measure only qubit 0. The grader checks the full probability distribution over all four basis states.

Run your code to see the quantum state.

The Probabilities panel should show equal bars at 00|00\rangle and 10|10\rangle, with zeros at 01|01\rangle and 11|11\rangle — confirming that qubit 1 was never disturbed.

Sign in on the full site to ask questions and join the discussion.