# Why is the subscript like this in the equation $\sum_i |\psi_i\rangle \langle\psi_i| = \sum_{ijk} u_{ij} u_{ik}^{*}|\phi_j\rangle \langle\phi_k|$?

In Nielsen's book when proving "Unitary freedom in the ensemble for density matrices"(Theorem 2.6):

$$\text{Suppose }|\widetilde{\psi_i}\rangle = \sum\limits_{j}u_{ij} |\widetilde{\phi_j}\rangle$$ Then in Equation 2.168: $$\sum_i |\widetilde{\psi_i}\rangle \langle\widetilde{\psi_i}| = \sum_{ijk} u_{ij} u_{ik}^{*}|\widetilde{\phi_j}\rangle \langle\widetilde{\phi_k}|$$

In equation 2.168 adjoint of the tilded psi has now the element in the unitary matrix u being ik conjugated($$u_{ik}^*$$). Now I understand that the column index after the adjoint will not be the same due to the transpose(hence k instead of j), what I don't understand is why the row index (i) is unchanged. I know it's probably something simple that I am missing, but I would appreciate your help.

The proof begins with let $$|\psi_i\rangle = \sum_j u_{ij} |\varphi_j\rangle$$ where $$U = (u_{ij})_{ij}$$ is some unitary matrix. But now, \begin{aligned} |\psi_i\rangle \langle \psi_i| &= \left(\sum_j u_{ij} |\varphi_j\rangle \right)\left(\sum_k u_{ik} |\varphi_k\rangle\right)^{\dagger} \\ &= \left(\sum_j u_{ij} |\varphi_j\rangle \right)\sum_k u_{ik}^* \langle\varphi_k| \\ &= \sum_{jk} u_{ij} u_{ik}^* |\varphi_j\rangle \langle\varphi_k|. \end{aligned}
On the first line $$\dagger$$ denotes the hermitian conjugate (adjoint operator); on the second line we used that $$\dagger$$ is conjugate-linear (here $$u_{ik}^*$$ is the complex conjugate of the complex number $$u_{ik}$$) and on the last line we just rearranged the sums and moved the complex numbers to the front.