# Computation of qubits with quantum gates using density matrix form

I'm making a quantum circuit with qubits and quantum gates. While I'm doing it, I have some problem with it. My calculation process is below.

As you can see, start qubit is $$|0 \rangle$$ and after 'X' gate, the result will be $$|1 \rangle$$. And I checked if the result of quantum circuit and density matrix form of $$|1 \rangle$$ are different. As you can see, they are different.

Here are my questions.

1. Why it occurs?
2. If they are different, is my calculation wrong?

When you evolve a pure state under the action of a gate $$U$$, it evolves from $$|\psi\rangle\rightarrow U|\psi\rangle.$$ However, a density matrix such as $$\rho=|\psi\rangle\langle\psi|$$ evolves differently. You must calculate $$\rho\rightarrow U\rho U^\dagger.$$ So, in this case, you must calculate $$\left(\begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array}\right)\left(\begin{array}{cc} 1 & 0 \\ 0 & 0 \end{array}\right)\left(\begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array}\right)=\left(\begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array}\right).$$

• Thank you for reply. Why we have to multiply conjugate transpose matrix? I wonder the reason. Could you tell me about it?
– 김동민
Oct 30 '20 at 8:45
• Simply because the bra of $U|\psi\rangle$ is $(U|\psi\rangle)^\dagger = \langle \psi |U^\dagger$. Therefore the evolution $|\psi\rangle\mapsto U|\psi\rangle$ is in the density matrix picture $|\psi\rangle\langle \psi |\mapsto U|\psi\rangle\langle \psi |U^\dagger$ Oct 30 '20 at 9:21
• Could you be more in detail? I can't understand now.
– 김동민
Oct 30 '20 at 9:46
• You know that to convert a state $|\psi\rangle$ into a density matrix, you rewrite it as $\rho=|\psi\rangle\langle\psi|$. How do you rewrite the state $U|\psi\rangle$ as a density matrix? Oct 30 '20 at 10:42
• Okay! I got this. Thank you
– 김동민
Oct 30 '20 at 11:09