# Why does $H^2=X^2 =I$ not imply $H=X$?

if $$HH = I$$ and $$XX =I$$, then is $$H=X$$?

$$HH = I = XX$$ or, $$HH = XX$$ then, taking under root, is $$H = X$$?

This is absurd but how to disprove it?

• The argument is obviously flawed since it fails even in the good ol' integers: $1\cdot 1=1$ and $(-1)\cdot(-1)=1$ but $1\ne-1$. One way to disprove it for the Hadamard and Pauli $X$ gate is to carry out the calculations. Nov 26 '21 at 8:20

Obviously $$H\neq X$$, as they are simply different matrices/operators.
The reason for the apparent "contradiction" is that the square root of a matrix (or of any number, for that matter) is not unique. What you are seeing here is that both $$H$$ and $$X$$ are valid square roots of the identity matrix $$I$$.
In fact, you can derive infinitely many possible square roots of $$I$$. Start observing that you can write $$I=\mathbb P(u)+\mathbb P(v)$$ for any pair of orthonormal vectors, $$\langle u,v\rangle=0$$ and $$\langle u,u\rangle=\langle v,v\rangle=1$$, where $$\mathbb P(u)\equiv uu^\dagger$$ denotes the projector onto $$u$$. Taking the square root via the eigendecomposition in the usual way then gives you $$\sqrt{I} = s \mathbb P(u) + t\mathbb P(v),$$ where $$s,t\in\mathbb C$$ are square roots of $$1$$, and thus $$s,t\in\{+1,-1\}$$. You thus get four possible solutions for every choice of two orthonormal vectors.
You get $$H$$ and $$X$$ choosing $$s=-t=1$$ and $$u=(1,1)^T/\sqrt2$$ and $$u=(1,0)$$, respectively.