Solution (source code)

= Solution

Use logarithms to base two, so <Von Neumann entropy> and <quantum relative entropy> are measured in bits. For <density operators> $\rho,\sigma$,
$$
\boxed{S(\rho)=-\operatorname{Tr}(\rho\log_2\rho),\qquad
D(\rho\|\sigma)=\operatorname{Tr}[\rho(\log_2\rho-\log_2\sigma)].}
$$
The <quantum relative entropy> formula applies when the <support of a positive operator> $\rho$ is contained in that of $\sigma$; otherwise $D(\rho\|\sigma)=+\infty$. Use $0\log_2 0=0$ in the <Von Neumann entropy> formula.

The binary <density operator> $\omega[p]$ is diagonal with <eigenvalues> $1-p,p$. Its <Von Neumann entropy> is the <binary entropy>:
$$
\boxed{S(\omega[p])=h_2(p)=-(1-p)\log_2(1-p)-p\log_2p.}
$$
The two diagonal <density operators> commute, so their <quantum relative entropy> is
$$
\boxed{D(\omega[p]\|\omega[q])=(1-p)\log_2\frac{1-p}{1-q}+p\log_2\frac pq.}
$$
A term with zero numerator has value zero; a positive numerator and zero denominator give $+\infty$. In particular, $D(\omega[0]\|\omega[0])=D(\omega[1]\|\omega[1])=0$, whereas $q=0,p>0$ or $q=1,p<1$ gives $+\infty$.