# Why is the controlled-Z gate a symmetric gate?

I want to understand why this gate is symmetric.

Consider a two qubits circuit (q1, q2) with a gate CZ controlled by the first q1, then if q1 is in the state $$(a, b)^T$$ and q2 is the state $$(c, d)^T$$, the system is in state $$(a, b)^T\otimes (c, d)^T= (ac, ad, bc, bd)^T= \psi$$ using Kronecker product.

Given that $$CZ= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix}$$ we can find that the system after the gate is applied will be in the state $$CZ.\psi= (ac, ad, bc, -bd)^T$$

Now, let us consider q2 to be the controlling qubit and q1 to be the target; then $$CZ$$ should be applied to $$\psi'= (c, d)^T\otimes (a, b)^T= (ca, cb, da, db)^T$$ ( one way to think about it is to leave the gate fixed and swap q1 and q2 positions )

to result in $$CZ.\psi'= (ac, bc, ad, -bd)^T$$, but this is not equal to $$CZ.\psi$$. Notice how it is almost the same if we exchange the second and third coordinates.

What am I missing?

My problem is that the 'swap' gate changes the state of the whole system, or that we should abandon the Kronecker representation of the tensor product??

You swapped the qubits before applying the CZ gate to them; you need to swap them again before comparing the final state to the results of applying the other CZ gate.

This reasoning is much easier to do in Dirac notation, though...

• ok thank you, I think I understand. By the way how do you swap $(ac, bc, ad, -bd)$ ? as I can't write it as a tensor. Commented Jul 3 at 23:09
• You won't be able to write that state as a tensor, since the qubits are entangled after applying CZ gate. You swap them using the SWAP gate Commented Jul 4 at 1:21