# How many $\sqrt{X}$ are there?

I was reading Square root of Pauli operators: is there a common convention to define them uniquely? and it got me thinking about square roots.

Recall the Pauli $$X$$ gate $$X=\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$$

How many unitary matrices $$U$$ are there such that $$U^2=X$$ In other words, how many unitary square roots does $$X$$ have? I would expect that there are $$4$$ square roots because each eigenvalue has 2 square roots.

However this naïve approach fails for some matrices, for example the identity $$I$$. Not only does $$\pm I$$ square to $$I$$ but also every matrix of the form $$VZV^{-1}$$ for $$V$$ unitary is a unitary square root of $$I$$. For example $$\pm I, \pm X, \pm Z , \pm Y$$ are all unitary matrices that square to $$I$$. As are all matrices of the form $$\begin{bmatrix} 0 & e^{i \theta} \\ e^{-i \theta} & 0 \end{bmatrix}$$

Edit: The relevant distinction here between $$X$$ having finitely many roots and $$I$$ having infinitely many roots is that $$X$$ has all distinct eigenvalues while $$I$$ has repeated eigenvalues.

I want to answer this on two levels.

## What are the $$X$$ and $$\sqrt{X}$$ gates?

A good way of seeing this is on the Bloch Sphere. The generic rotation around the $$x$$-axis is defined as $$R_x(\theta) = \cos(\theta/2)I - i\sin(\theta/2)X.$$ If $$\theta=\pi$$, then we get the $$X$$ gate, up to an overall phase. In simple terms, the $$X$$ gate is just a rotation of 180 degrees around the $$x$$-axis on the Bloch sphere.

Now $$\sqrt{X}$$ is just breaking up this rotation into two equal rotations. It should be apparent, there are only two ways of doing this. Either $$\sqrt{X}$$ is a 90 degrees clockwise rotation around the $$x$$-axis, or it is a 90 degrees anti-clockwise rotation around the $$x$$-axis.

# Do we have more freedom algebraically?

In your linked question, this answer tells us that there can be exactly four square roots $$\sqrt{X} = \pm 1 |+\rangle \langle +| \pm i |-\rangle \langle -|,$$ which yield $$X$$ without an overall phase. Two of these correspond to a 90 degree clockwise rotation with a phase inbuilt, and other two are a 90 degrees anti-clockwise rotation. To see this, note that with the choice of $$1,i$$, in the above, we get $$\sqrt{X} = \frac{1}{2} \begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \end{pmatrix} = \frac{1}{\sqrt{2}}e^{i\pi/4}(I-iX).$$ And if we make the choice $$-1,-i$$, we get $$\sqrt{X} = \frac{1}{2} \begin{pmatrix} -1-i & -1+i \\ -1+i & -1-i \end{pmatrix} = -\frac{1}{\sqrt{2}}e^{i\pi/4}(I-iX).$$ These differ by a minus sign and square to $$X$$.

Finally, if you allow an overall phase in $$X$$, i.e. if $$A = \sqrt{X}$$ and $$A^2 = e^{i\phi}X$$, then, you can define infinitely many $$\sqrt{X}$$.

• Just to clarify are you saying that the 4 unitary square roots of $X$ are $H diag(1,\pm i) H$ and $H diag(\pm i,1) H$? What about $H diag(-1,\pm i) H$ and $H diag(\pm i,-1) H$? Here $H$ is the hadamard. Feb 14 at 22:30
• I think you should compute these by hand. Only $H \text{diag}(1,\pm i)H$ and $H \text{diag}(-1,\pm i)H$ square to exactly $X$. These are the four matrices I (and the other answer) have indicated. The other four choices that you have given square to $-X$. Feb 14 at 22:54
• Ah you're right I computed them by hand. In retrospect it should have been obvious that flipping the elements on the diagonal gives the negative because $HZH=X$ but flipping the entries of $Z$ gives $-Z$ so $H(-Z)H=-X$. So any $2\times 2$ unitary matrix with distinct eigenvalues has exactly 4 square roots Feb 15 at 0:32
• Thanks again for this answer. I think the normalizations are off. It should be $$\sqrt{X} = \frac{1}{2} \begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \end{pmatrix} = \frac{1}{\sqrt{2}}e^{i\pi/4}(I-iX).$$ and $$\sqrt{X} = \frac{1}{2} \begin{pmatrix} -1-i & -1+i \\ -1+i & -1-i \end{pmatrix} = -\frac{1}{\sqrt{2}}e^{i\pi/4}(I-iX).$$ Apr 2 at 22:22
• Thanks, fixed the error. Apr 2 at 22:35