Pure-qubit overlap identity (source code)

= Pure-qubit overlap identity
{title2=$|\langle u|v\rangle|^2=\tfrac12(1+u\cdot v)$}

Write each pure <density matrix> as $(I+r\cdot\sigma)/2$. The <trace> identities of the <Pauli matrices>, $\operatorname{Tr}\sigma_i=0$ and $\operatorname{Tr}(\sigma_i\sigma_j)=2\delta_{ij}$, make the <trace> of their product equal to the displayed overlap. Antipodal unit vectors represent <orthogonal> states; vectors at right angles correspond to squared overlap one half. For mixed states the same <trace> formula gives Hilbert–Schmidt overlap, not in general quantum fidelity.