|q⟩ Bad Qubits

intermediate · Physics · Density Matrices & Mixed States

Checkpoint: Work with Density Matrices

This checkpoint chains together the whole module: build a joint density matrix, take a partial trace, and read off both a purity and an expectation value from the reduced state.

What you are computing

Start from the partially entangled pure state

ψ=cost00+sint11,t=π8.|\psi\rangle = \cos t\,|00\rangle + \sin t\,|11\rangle, \qquad t = \frac{\pi}{8}.

Its joint density matrix is ρAB=ψψ\rho_{AB} = |\psi\rangle\langle\psi|. Tracing out the second qubit gives a diagonal reduced state — the squared Schmidt coefficients on the diagonal:

ρA=TrBρAB=(cos2t00sin2t).\rho_A = \operatorname{Tr}_B\,\rho_{AB} = \begin{pmatrix}\cos^2 t & 0\\ 0 & \sin^2 t\end{pmatrix}.

From ρA\rho_A you extract two numbers seen throughout the module:

purity=Tr(ρA2)=cos4t+sin4t,ZA=Tr(ρAZ)=cos2tsin2t=cos2t.\text{purity} = \operatorname{Tr}(\rho_A^2) = \cos^4 t + \sin^4 t, \qquad \langle Z\rangle_A = \operatorname{Tr}(\rho_A Z) = \cos^2 t - \sin^2 t = \cos 2t.

Checks to keep you honest

Try it

Carry out all three steps — build ρAB\rho_{AB}, trace out BB, then compute the purity and ZA\langle Z\rangle_A of ρA\rho_A — and return their sum Tr(ρA2)+ZA\operatorname{Tr}(\rho_A^2) + \langle Z\rangle_A.

Run your code to see the quantum state.

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