# Why doesn't Z-gate change phase of |0⟩

Since the Pauli Z gate equate to a rotation around z axes of the Bloch sphere by $$\pi$$ radians, the phase of anything that lies on z axes is expected to change by $$\pi$$ by applying z-gate. As $$|0⟩$$ and $$|1⟩$$ lies on z-axis so their phase should change by $$\pi$$. So, why doesn't z-gate change the phase of $$|0⟩$$?

Mathematically it can be understood but as per definition of rotation representation of z-gate matrix doesn't seem to be correct as it only changes the phase of $$|1⟩$$ and not $$|0⟩$$. Why is it like this?

• Well, it creates a phase difference between the two let’s $|0\rangle$ and $|1\rangle$. If you apply a $Z$ gate to a computational basis state, you don’t do anything, by virtue of the unobservable change in global phase. Jul 24, 2022 at 2:48
• Well, $$Z(\alpha|0\rangle+\beta|1\rangle)=\alpha|0\rangle-\beta|1\rangle$$ So $$Z(|0\rangle)=|0\rangle$$, Jul 24, 2022 at 11:58

You can consider $$Z$$ gate to be a "negation" in Hadamard basis. If you apply the gate on state $$|+\rangle$$, you get $$|-\rangle$$ and vice versa.
In computational basis, state $$|0\rangle$$ remains unchanged and $$|1\rangle$$ is changed to $$-|1\rangle$$. However, you can ignore the minus because it is a global phase. So, there is no action of $$Z$$ in computational basis. To changes the computational basis states between each other, you can use $$X$$ gate.
A rotation by $$\pi\over2$$ around the Z-axis is done by applying $$iZ$$. However, this is equivalent to $$Z$$ up to unobservable global phase.