# How to think about the Z gate in a Bloch sphere?

I am confused about how to understand the $Z$ gate in a Bloch sphere.

Considering the matrix $Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$ it is understandable that $Z|0\rangle = |0\rangle$ and $Z|1\rangle = -|1\rangle$.

It is explained here that $Z$ gate is $\pi$ rotation around the $Z$ axis. Then, how should I understand $Z|1\rangle = -|1\rangle$? Since $|1\rangle$ is the south pole, I feel it is natural to think that $\pi$ rotation around the $Z$ axis does not do anything.

The way to think about the Bloch sphere is in terms of the density matrix for the state. $Z$ acting on either $|0\rangle\langle 0|$ or $|1\rangle\langle 1|$ does nothing, as is true for any diagonal density matrix. To see the effect of the rotation, you need to look at how any non-diagonal density matrix is changed by $Z$, such as $|+\rangle\langle +|$.

$|1\rangle$ and $-|1\rangle$ are assigned to the same point on the Bloch sphere because they are equal up to global phase. Algebraically: $|1\rangle \equiv -|1\rangle$ where $\equiv$ means "equal up to global phase". Meaning there is some $\theta$ such that $-|1\rangle = e^{i \theta} |1\rangle$.

The thing that is confusing you is that, despite the fact that $|0\rangle \equiv Z |0\rangle$ and $|1\rangle \equiv Z |1\rangle$, this is not true for linear combinations of the two. For example, $Z |+\rangle \not\equiv Z |+\rangle$ even though $|+\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle$.

As per Wikipedia, we can write any pure state as $$|\psi\rangle = \cos\left( \frac{\theta}{2} \right) |0 \rangle + e^{i \phi} \sin\left( \frac{\theta}{2} \right) |1 \rangle$$

Where $\theta$ and $\phi$ are the angles on the Bloch sphere: Almost any point on the surface (i.e. pure state) has a unique representation in terms of the angles, except for the poles. Just like on the Earth the South Pole has no well-defined longitude (any longitude works the same), for the $|1 \rangle$ state any phase $\phi$ means the same thing. The “latitude” $\theta$ is here $\pi$, let's plug that into the equation:

$$|1\rangle = \cos\left( \frac{\pi}{2} \right) |0 \rangle + e^{i \phi} \sin\left( \frac{\pi}{2} \right) |1 \rangle =$$ $$= 0 + e^{i \phi} |1 \rangle$$

If you are familiar with Euler's identity, you will probably recognise $e^{i \phi}$ as a rotation in the complex plane. In particular, since $Z$ is a rotation for $\phi = \pi$, we get the famous $e^{i \pi} = -1$, finally arriving at $|1 \rangle = - |1 \rangle$.

• This is wrong. Writing $|1\rangle=-|1\rangle$ is misleading: these are equivalent states in that they only differ by a global phase, but this doesn't mean that the state vectors are the same. You get that result because you are assuming there to be a bijection between state vectors and points on the Bloch sphere, which is not the case. The bijection stands between points on the Bloch sphere and states described as density matrices – glS Jun 2 '18 at 17:30
• @glS Thanks, the $1=-1$ that follows from that did seem fishy. Does it make sense to improve that answer from your perspective, or is it hopelessly wrong? – Norrius Jun 2 '18 at 19:29