Bayesian update after a projective measurement (source code)

= Bayesian update after a projective measurement
{title2=$p(h\mid m)=p_h\operatorname{Tr}(P_m\rho_h)/\sum_kp_k\operatorname{Tr}(P_m\rho_k)$}

For candidate <density matrices> $\rho_h$ with prior <probabilities> $p_h$, a <projective measurement> has outcome likelihood $p(m\mid h)=\operatorname{Tr}(P_m\rho_h)$. <Bayes' theorem> gives the displayed posterior whenever the denominator is positive. An outcome certifies one candidate only when every other candidate has zero likelihood there. If all candidates have the same outcome likelihood, observing it leaves their prior probabilities unchanged.