# Advanced single-qubit gates¶

New operations in this topic

Another convenient representation of a single-qubit state is

where and . This can be related to the previous representation by:

Defining gives

That is, are the Cartesian coordinates of a sphere of unit length . Here you see a one-to-one correspondence between qubit states () and the points on the surface of a unit sphere (). This is called the Bloch sphere representation of a qubit state.

We caution the reader from thinking that qubits can always have this simple geometric representation, as you will see that it breaks down when you have more than one qubit. That being said, it is a convenient tool to develop intuition for single-qubit quantum gates.

As mentioned before, single-qubit gates are represented by a unitary matrix The action of the quantum gate is found by multiplying the matrix representing the gate with the vector representing the quantum state:

A general unitary must be able to take the state to the above general state while satisfying . From this, you can derive

which is the most general form of a single-qubit unitary, and is implemented in IBM Quantum Composer using the gate.

Setting and defines the x-axis rotation gate, :

Setting and to defines the y-axis rotation gate, :

Setting and and multiplying by a global phase gives the z-axis rotation gate, :

Now you have the tools to rotate the state anywhere in the Bloch sphere. Let’s conduct a simple experiment to prove what we did. We will use to rotate the into the state parameterized by and . Like in the previous section, we can measure the and components by applying an gate before measurement, and an followed by an gate before measurement (see the X-measurement circuit and Y-measurement circuits below). To measure the component, we simply use the quantum circuit (see the Z-measurement circuit below).

**X-measurement circuit**

**Y-measurement Circuit**

**Z-measurement Circuit**

Doing this on the IBM Q Vigo system for 8192 shots gives (as taken on July 30, 2020 @ 12:00 EST):

Experiment |
value |
||
---|---|---|---|

x |
0.48975 |
0.51025 |
-0.0206 |

y |
0.36426 |
0.62574 |
-0.2615 |

z |
0.05908 |
0.94092 |
-0.8818 |

Like before, due to noise we need to re-normalize the data (how to handle noise correctly is an entire research topic unto itself, and we suggest the interested reader seek out resources on ‘quantum state tomography’), but for now we will use:

Putting this into gives and gives , which is very close to the values we put into .

Try out the different rotations yourself! If you want to explore the effects of in , be sure to start the qubit in a superposition state.