Solution (source code)

= Solution

A <basic measurement> is specified by an <orthonormal basis> $\{|b_j\rangle\}_{j=0}^{d-1}$. The <Born rule> for the <density matrix> $\rho$ gives the outcome <probabilities>
$$
\boxed{p(j)=\langle b_j|\rho|b_j\rangle=\operatorname{Tr}\bigl(\rho|b_j\rangle\langle b_j|\bigr).}
$$
These <probabilities> are nonnegative by <positive semidefiniteness> and sum to one by the <resolution of the identity> and unit <trace>. In the <computational basis>, the answers are simply the diagonal entries $\rho_{jj}$.<The Theory of Quantum Information by John Watrous/Basic notions of quantum information>[§2.3, Definition 2.34, measurement probabilities]{ref}