# Quantum Principal Component analysis by Seth Lloyd

I am currently reading the paper quantum principal component analysis from Seth Lloyd's article Quantum Principal Component Analysis There is the following equation stated.

I know from the qiskit website, that we can express $$\mathrm{e}^{i\gamma B}$$ as $$\cos(\gamma)I + i\sin(\gamma)B$$ with $$\gamma$$ being some real number and $$B$$ is an involutory matrix. Can someone explain me why there is only a single $$\sigma$$ and no $$\rho$$ in $$(\cos^2\triangle t)\sigma$$ and a single $$\rho$$ and no $$\sigma$$ in $$(\sin^2\triangle t)\rho$$? Is it because of the partial trace?

Any intuition or approach is welcome. Many thanks in advance.

As you say, start by expanding $$e^{-iS\Delta t}=\cos(\Delta t)I-i\sin(\Delta t)S$$, so you'd be calculating $$(\cos(\Delta t)I-i\sin(\Delta t)S)\rho\otimes\sigma(\cos(\Delta t)I+i\sin(\Delta t)S).$$ If you multiply out all the terms, then the $$\cos^2(\Delta t)$$ comes from the two $$I$$ terms, leaving you with $$\rho\otimes\sigma$$. If you trace out the first term, you're left with $$\sigma$$.
Similarly, $$S(\rho\otimes\sigma)S=\sigma\otimes\rho$$, so if you trace out the first system, you're left with $$\rho$$.
It's actually the cross-terms that are the trickier ones. Take, for example, $$S(\rho\otimes\sigma)$$. If I try to trace out the first system, I have \begin{align} \sum_{i,j,k}|j\rangle\langle k|\langle i,j|S\rho\otimes\sigma|i,k\rangle&=\sum_{i,j,k}|j\rangle\langle k|\langle j,i|\rho\otimes\sigma|i,k\rangle \\ &=\sum_{i,j,k}|j\rangle\langle k|\langle j|\rho|i\rangle\langle i|\sigma|k\rangle \\ &=\sum_{j,k}|j\rangle\langle k|\langle j|\rho\sigma|k\rangle \\ &=\rho\sigma. \end{align}