|q⟩ Bad Qubits

beginner · Programming · Two Qubits & Tensor Products

Marginal Probabilities

A two-qubit state can be measured in many ways. Often you care about only one qubit — the other is not observed, or its result is ignored. The probability of getting a particular outcome on the qubit you do measure is called a marginal probability.

Where marginals come from

A general two-qubit state is written

∣ψ⟩=c00∣00⟩+c01∣01⟩+c10∣10⟩+c11∣11⟩,|\psi\rangle = c_{00}|00\rangle + c_{01}|01\rangle + c_{10}|10\rangle + c_{11}|11\rangle,

where cijc_{ij} are complex amplitudes satisfying ∣c00∣2+∣c01∣2+∣c10∣2+∣c11∣2=1|c_{00}|^2 + |c_{01}|^2 + |c_{10}|^2 + |c_{11}|^2 = 1.

If you measure only qubit 0 (the most significant bit) and ignore qubit 1, the Born rule says you must sum over every outcome of the unobserved qubit:

P(q0=0)=∑j∈{0,1}∣c0j∣2=∣c00∣2+∣c01∣2,P(q_0 = 0) = \sum_{j \in \{0,1\}} |c_{0j}|^2 = |c_{00}|^2 + |c_{01}|^2, P(q0=1)=∑j∈{0,1}∣c1j∣2=∣c10∣2+∣c11∣2.P(q_0 = 1) = \sum_{j \in \{0,1\}} |c_{1j}|^2 = |c_{10}|^2 + |c_{11}|^2.

The two marginals sum to 1, as required for a valid probability distribution.

A worked example

The Bell state ∣Φ+⟩|\Phi^+\rangle is

∣Φ+⟩=12∣00⟩+12∣11⟩.|\Phi^+\rangle = \frac{1}{\sqrt{2}}|00\rangle + \frac{1}{\sqrt{2}}|11\rangle.

Its four amplitudes are c00=12c_{00} = \tfrac{1}{\sqrt{2}}, c01=0c_{01} = 0, c10=0c_{10} = 0, c11=12c_{11} = \tfrac{1}{\sqrt{2}}. Applying the marginal formula to qubit 0:

P(q0=0)=∣12∣2+∣0∣2=12,P(q0=1)=∣0∣2+∣12∣2=12.P(q_0 = 0) = \left|\frac{1}{\sqrt{2}}\right|^2 + |0|^2 = \frac{1}{2}, \qquad P(q_0 = 1) = |0|^2 + \left|\frac{1}{\sqrt{2}}\right|^2 = \frac{1}{2}.

Each outcome is equally likely — exactly as you would expect from the symmetric form of ∣Φ+⟩|\Phi^+\rangle. Notice that you never needed to specify what happens to qubit 1; the marginal absorbs it by summing over all its values.

Marginals for product states

For a product state ∣ψ⟩=∣ψ0⟩⊗∣ψ1⟩|\psi\rangle = |\psi_0\rangle \otimes |\psi_1\rangle, summing over one qubit simply returns the probability already carried by the other qubit's own state. If ∣ψ0⟩=α∣0⟩+β∣1⟩|\psi_0\rangle = \alpha|0\rangle + \beta|1\rangle, then P(q0=0)=∣α∣2P(q_0 = 0) = |\alpha|^2 regardless of ∣ψ1⟩|\psi_1\rangle. The two qubits are statistically independent. For entangled states this independence breaks down — the qubits' individual marginals give only a partial picture of the joint state.

Try it

The state is ∣Φ+⟩=12(∣00⟩+∣11⟩)|\Phi^+\rangle = \tfrac{1}{\sqrt{2}}(|00\rangle + |11\rangle). Use the formula above to compute the marginal probability that qubit 0 measures 0, and return it.

Run your code to see the quantum state.

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