Introducing yet another gate

Applying Hadamard twice returns the qubit to its initial state again. From this we can conclude that the information stored in the qubit has not been lost. This also means that even if the measurement results appear purely random, the qubit is nevertheless in a well-defined state.

So far, we have just explored four different states a qubit can be in. In fact all of these four states have names, with the two new ones being called:

The X gate not only toggles a qubit between the \(\ket{0}\) and \(\ket{1}\) states, but generally rotates the state of a qubit around the x axis.

The following animation shows, where those states are on the Bloch sphere marked with red dots:

Combining gates

However, H and X are not the only gates. Quantum computers have plenty more. One of them is the T gate, which can be thought of as a 45° rotation around the north-south pole axis of our sphere (hover over the gate button to see the axis). This rotation angle around the north-south pole axis is also called the phase.

!
The so far unknown T gate seems to have no effect on \(\ket{0}\) and \(\ket{1}\).
Insert a Hadamard gate H before and after the T gate. How does this affect the measurement result?
My measurements

After 1000 measurements we get the following distribution:

What is the probability for measuring \(\ket{1}\) when starting in state \(\ket{0}\) ?

Answer the question to continue ...

This also means that quantum states can not be described just with probabilities, as the states created with a H gate and with H followed by a T gate will be measured the same even though they are different.
You will sometimes experience the following notation called the ket notation: \(\sqrt{0.85} |0⟩+\sqrt{0.15} |1⟩\).
The factors associated with the different measurement outcomes \(|0⟩\) and \(|1⟩\) are called amplitudes. The probability for obtaining one of the outcomes is given by the square of the amplitude, e.g. \(P(|0⟩) = \sqrt{0.85}^2 = 0.85\).
Also the \(|+⟩\) and \(|-⟩\) states can be written this way:


  • \(|+⟩ = \frac{1}{\sqrt{2}} |0⟩+ \frac{1}{\sqrt{2}} |1⟩\)
  • \(|-⟩ = \frac{1}{\sqrt{2}} |0⟩ - \frac{1}{\sqrt{2}} |1⟩\)

In this module, we do not want to stress this too much, but if you are interested to learn more, check the glossary or stay tuned for our expanded curriculum for circuit magicians.

You can also use the animation below to see how sandwiching a T gate between two H gates affect a qubit's state.