# What are the I, X, Z gates in quantum gates? [closed]

Can someone please explan how the $$\rm I$$, $$\rm X$$ and $$\rm Z$$ gates work?

If $$\rm{I = X^2 = Z^2}$$, can you explain why this is the case or why it wouldn't work?

• What do you mean by "how do they work"? Can you be more specific? Also, what does their involution have anything to do with their ability to "work"? Aug 11 '20 at 7:47

$$I$$ is identity operator, which means that input state is not affected. In mathematical notation: $$I|\psi\rangle = |\psi\rangle$$.
$$X$$ operator is a negation. It changes 0 to 1 and conversely, i.e. $$X|0\rangle = |1\rangle$$ and $$X|1\rangle = |0\rangle$$. If it is applied on a qubit in arbitrary superposition, i.e. $$|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$$, the state changes to $$X|\psi\rangle = \beta|0\rangle + \alpha|1\rangle$$.
$$Z$$ operator is a little bit more difficult to understand for beginners. The operator changes a phase of qubit. Consider for example state $$|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$$. This state is an equally distributed superposition of state $$|0\rangle$$ and $$|1\rangle$$. When you apply $$Z$$ operator, you get a state $$|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$$. This is also an equally distributed superpositon of $$|0\rangle$$ and $$|1\rangle$$, however, the phase changed as you can see from minus sign before $$|1\rangle$$. If it is applied on a qubit in arbitrary superposition, i.e. $$|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$$, the state changes to $$Z|\psi\rangle = \alpha|0\rangle - \beta|1\rangle$$. Again, only the phase changes.
An identity $$I = X^2 = Z^2$$ can be easily verified by direct multiplication of matrix representations of the operators: $$X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$ and $$Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.$$
• A small addition: you may also find it intuitive to think of $X^{2} = Z^{2} = I$ like this: if $X$ flips the $|0\rangle$ to the $|1\rangle$ state and vice-versa, then $X^{2} = X*X$ just does the flip twice, which is equal to doing nothing (i.e. $I$ operation). The same reasoning applies to the $Z$ gate.