Proof

We only prove (ii), and the proof of (i) is similar and easier. For every $\rho \in \mathcal{D}\left({\mathcal{H}}_{\mathit{all}}\right)$, by Proposition 4.2.3 (iv) we observe:

$\begin{array}{l}\begin{array}{ll}tr\left[\left({M}_{0}^{†}P{M}_{0}& +{M}_{1}^{†}\left(wlp.S.\left(wlp.\mathbf{while}.P\right)\right){M}_{1}\right)\rho \right]\\ =tr\left(P{M}_{0}\rho {M}_{0}^{†}\right)+tr\left[\left(wlp.S.\left(wlp.\mathbf{while}.P\right)\right){M}_{1}\rho {M}_{1}^{†}\right]\\ =tr\left(P{M}_{0}\rho {M}_{0}^{†}\right)+tr\left[\left(wlp.\mathbf{while}.P\right)⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right]\\ +\left[tr\left({M}_{1}\rho {M}_{1}^{†}\right)-tr\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right]\\ =tr\left(P{M}_{0}\rho {M}_{0}^{†}\right)+tr\left[P⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right]+\left[tr\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\\ -tr\left(⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right]+\left[tr\left({M}_{1}\rho {M}_{1}^{†}\right)-tr\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right]\\ =tr\left[P\left({M}_{0}\rho {M}_{0}^{†}+⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right)\right]\\ +\left[tr\left({M}_{1}\rho {M}_{1}^{†}\right)-tr\left(⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right]\\ =tr\left(P⟦\mathbf{while}⟧\left(\rho \right)\right)+\left[tr\left(\rho {M}_{1}^{†}{M}_{1}\right)-tr\left(⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right)\right]\\ =tr\left(P⟦\mathbf{while}⟧\left(\rho \right)\right)+\left[tr\left(\rho \left(I-{M}_{0}^{†}{M}_{0}\right)\right)-tr\left(⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right)\right]\\ =tr\left(P⟦\mathbf{while}⟧\left(\rho \right)\right)+\left[tr\left(\rho \right)-tr\left({M}_{0}\rho {M}_{0}^{†}+⟦\mathbf{while}⟧\left(⟦S⟧\left({M}_{1}\rho {M}_{1}^{†}\right)\right)\right)\right]\\ =tr\left(P⟦\mathbf{while}⟧\left(\rho \right)\right)\end{array}\hfill \end{array}$

Get Foundations of Quantum Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.