Sequential qubit measurement correlation (source code)

= Sequential qubit measurement correlation
{title2=$E_{\mathbf n}(U)=\tfrac12\operatorname{Tr}(NUNU^\dagger)$}

Prepare $I/2$, measure a Pauli observable $N=\mathbf n\cdot\boldsymbol\sigma$, apply a fixed <unitary operator> $U$, then measure $N$ again. If the first and second <eigenvalue> labels are $j,k\in\{+1,-1\}$, their joint <probability> is $\frac12|\langle n_k|U|n_j\rangle|^2$. Consequently
$$
E_{\mathbf n}(U)=\mathbb E[jk]=\frac12\operatorname{Tr}(NUNU^\dagger).
$$
The first outcome has <probability> $1/2$ and its conditional state is $|n_j\rangle$ by the <Lüders rule>. Summing $jk$ times the joint <probabilities> and using $N=\sum_jj|n_j\rangle\langle n_j|$ proves the <trace> formula. This temporal correlation differs from the spatial correlation $\langle\psi|N\otimes N|\psi\rangle$ of two simultaneously measured <qubits>.