# Showing that $S(\rho_{XB}||\sigma_{XB})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$ for classical-quantum states

Having some trouble showing that $$S(\rho_{XB}||\sigma_{XB})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$ for $$\rho_{XB}=\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}$$ and $$\sigma_{XB}=\sum_{x}p(x)|x\rangle\langle x|\otimes\sigma_{B}^{x}$$

I know that $$S(\rho_{XB}||\sigma_{XB})=\mathrm{Tr}(\rho_{XB}\log(\rho_{XB}))-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))$$ and $$\mathrm{Tr}(\rho_{XB}\log(\rho_{XB}))=-S(X)-\sum_{x}p(x)S(\rho_{B}^{x})$$ due to its classical-quantum nature. However, this implies that $$-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))=S(X)+\sum_{x}p(x)S(\rho_{B}^{x})+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$.

Taking $$-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))=-\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x} \log(\sum_{x}p(x)|x\rangle\langle x|\otimes\sigma_{B}^{x}))=$$

$$-\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}(\sum_{x}|x\rangle\langle x|\otimes \log(p(x)\sigma_{B}^{x})))=\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}\log(p(x)\sigma_{B}^{x}))=$$

$$-\sum_{x}p(x)\mathrm{Tr}(\rho_{B}^{x}\log(p(x)\sigma_{B}^{x}))=-\sum_{x}p(x)\mathrm{Tr}(\rho_{B}^{x}(\log(p(x))+\log(\sigma_{B}^{x})))=$$

$$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$

As can be seen, this is not enough to cancel the other terms, which can be seen when putting these two together, you get $$-S(X)-\sum_{x}p(x)S(\rho_{B}^{x})+S(X)+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})-\sum_{x}p(x)S(\rho_{B}^{x})$$ This could only equal the desired exprerssion if $$\rho_{B}^{x}$$ were pure states, which is specified nowhere in the text I am reading.

Where have I gone wrong?

Edit: As Rammus stated in his answer, I went wrong with $$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$ Instead, it should be $$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))-\sum_{x}p(x)Tr(\rho_{B}^{x}log(\sigma_{B}^{x}))$$ Putting this back into the original equation gives the desired equality.

• can you rewrite the latex commands with \ln instead of log. It will make your problem more readable. Sep 22, 2021 at 11:38
• Please try to use aligned environments as well when you have multiple equalities in a row. Sep 22, 2021 at 12:03
• @Rammus on the subject of the aligned environments, and possibly other notation based etiquette, does this forum have a post that details that? Obviouslt if there is a way to make these more readable to those providing answers, I will happily do so. Sep 22, 2021 at 15:02
• @GaussStrife I don't know of one but I would just aim to write as you would expect to look if it was in a book or a research article. I.e., $\log$ instead of $log$, well spaced equations, explanatory text where necessary etc, Sep 22, 2021 at 15:30

As you say, $$\mathrm{Tr}[\rho_{XB} \log \rho_{XB}] = -S(X) + \sum_{x} p(x) \mathrm{Tr}[\rho_{B}^x \log \rho_B^x].$$

But if you can prove the above statement, then the exact same derivation gives you $$\mathrm{Tr}[\rho_{XB} \log \sigma_{XB}] = - S(X) + \sum_{x} p(x) \mathrm{Tr}[\rho_B^x \log \sigma_B^x].$$

If you put both together then you get \begin{aligned} D(\rho_{XB} \|\sigma_{XB}) &= \mathrm{Tr}[\rho_{XB} \log \rho_{XB}] - \mathrm{Tr}[\rho_{XB} \log \sigma_{XB}] \\ &= -S(X) + \sum_{x} p(x) \mathrm{Tr}[\rho_{B}^x \log \rho_B^x] + S(X) - \sum_{x} p(x) \mathrm{Tr}[\rho_B^x \log \sigma_B^x] \\ &= \sum_{x} p(x) \mathrm{Tr}[\rho_{B}^x \log \rho_B^x] - \sum_{x} p(x) \mathrm{Tr}[\rho_B^x \log \sigma_B^x] \\ &= \sum_{x} p(x) \left(\mathrm{Tr}[\rho_{B}^x \log \rho_B^x] - \mathrm{Tr}[\rho_B^x \log \sigma_B^x]\right) \\ &= \sum_{x} p(x) D(\rho_{B}^x \|\sigma_B^x) \end{aligned}

• Yes, I foolishly equated $-Tr(\rho_{B}^{x}log\sigma_{B}^{x})=D(\rho_{B}^{x}||\sigma_{B}^{x})$ on line 8. What mistake did I make on line 7? Sep 22, 2021 at 12:19
• You have a $\mathrm{tr}[\log \sigma_B^x]$. Sep 22, 2021 at 12:53