# Multi-qubit gates on entangled states

I am a bit confused by the following scenario:

Suppose we are given an entangled state $$| \psi \rangle$$ that has $$2$$ qubits (we can generalize to $$n$$ qubits). Suppose we had a circuit like above. Because $$| \psi \rangle$$ is entangled, we cannot really CNOT each qubit, or Hadamard a single qubit. So how would we predict an outcome of such a circuit in general, mathematically?

And how could we extend this to more complex gates, like a CSWAP?

• why do you think that $|\psi\rangle$ being entangled means you cannot apply the CNOT or Hadamard on each qubit?
– glS
Mar 31 at 11:53

Suppose $$|\psi\rangle = (|00\rangle+|11\rangle)/\sqrt{2}$$. The effect of the first CNOT is to flip the first qubit, therefore the entagled state becomes $$|\psi'\rangle = (|10\rangle+|01\rangle)/\sqrt{2}$$. Mathematically, you consider the whole state $$|1\rangle|\psi\rangle = ..$$ and apply the CNOT matrix to the first and second qubit (starting from the top).
• What if $| \psi \rangle = \frac{1}{\sqrt{3}}( | 00 \rangle + | 01 \rangle + | 11 \rangle )$ being applied in a CNOT? In this case, there are two kets that have a “0” qubit in them. Mar 31 at 6:16
• In that case you get $|\psi'\rangle = \frac{1}{\sqrt{3}}(|10\rangle + |11\rangle + |01\rangle)$. It is linear algebra, so you just apply the gate to each of the superposed elements of your state. Mar 31 at 7:00