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:
- \(\ket{+}\): state a qubit is in, after a Hadamard gate is applied to a qubit in state \(\ket{0}\)
- \(\ket{-}\): state a qubit is in, after a Hadamard gate is applied to a qubit in state \(\ket{1}\)
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.
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:
-
A
15%
-
B
25%
-
C
50%
-
D
100%
That's right! If we apply an H gate before and after the
T gate, we get with 85% probability \(\ket{0}\) as
the measurement result for a start value of \(\ket{0}\) and only with 15% \(\ket{1}\).
This means that any change of the phase (e.g. by another gate like the T gate), no matter how small, can be
revealed by embedding it between two Hadamard gates. Applying only the Hadamard gate H
before the T gate will still change its state, but won’t be
visible in the measurement outcome.
Not quite!
If we apply an H gate before and after the T gate, we get with 85% probability \(\ket{0}\) as
the measurement result for a start value of \(\ket{0}\) and only with 15% \(\ket{1}\).
This means that any change of the phase (e.g. by another gate like the T gate), no matter how small, can be
revealed by embedding it between two Hadamard gates. Applying only the Hadamard gate H
before the T gate will still change its state, but won’t be
visible in the measurement outcome.
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.