3.3.3 Non-Clifford Gates
The most general operation that a quantum computer can perform is a unitary matrix in 2n dimensions. A finite set of gates that can approximate any unitary matrix arbitrarily well is known as a universal gate set. This is similar to how certain sets of classical logic gates, such as {AND, NOT}, are functionally complete and can be used to build any Boolean function.
Up to this point, all the gates we have discussed (X,Y,Z,H,S,S†, and CNOT) are members of a special group of gates known as the Clifford group. These gates can be simulated efficiently on a classical computer (see the Gottesman-Knill theorem). Therefore, the Clifford group is not universal. It cannot harness the full power of quantum computation; for that, we must include at least one non-Clifford gate in our circuits.
Any unitary matrix can be written as a combination of single- and two-qubit gates [Barenco et al., 1995]. (This is unlike classical reversible computing, where 3-bit gates such as Toffoli are additionally required for functional completeness.) It turns out that adding almost any non-Clifford gate to single-qubit Clifford gates and CNOT gates is universal. There are several popular choices for non-Clifford gates, but we implement T as well as T†. These are given by
The T gate essentially makes it possible to reach all different points of the Bloch sphere. We can see that by increasing the number of T -gates in our circuit (the so-called T -depth) we start to cover the Bloch sphere more densely with states we can reach. The following figures depict the attainable states by increasing T -depth from 0, 1, ... up to 5. In the final Bloch sphere for T -depth 5, we have highlighted a few points in red, green, and blue, which correspond to the Clifford+T scores given below. Run these circuits to see if you end up at those points!
T-Depths are 0, 1, 2, 3, 4, and 5.
Exercise 1 Red State The T gate essentially makes it possible to reach all different points of the Bloch sphere. We can see that by increasing the number of T -gates in our circuit (the so-called T -depth) we start to cover the Bloch sphere more densely with states we can reach. The following figures depict the attainable states by increasing T -depth from 0, 1, ... up to 5. In the final Bloch sphere for T -depth 5, we have highlighted a few points in red, green, and blue, which correspond to the Clifford+T scores given below. Run these circuits to see if you end up at those points!
Run with existing cache and 1024 shots for the above circuits. Execution results are:
Distribution:
Qubits:
Quantum Score file
qreg q,5; gate h, [[0.7071067811865476,0.7071067811865476],[0.7071067811865476,-0.7071067811865476]];gate t, [[1,0],[0,0.7071067811865476+0.7071067811865476i]];gate s, [[1,0],[0,i]];gate bloch, [[1,0],[0,0.7071067811865476+0.7071067811865476i]]; h q[1];t q[1];h q[1];t q[1];s q[1];bloch q[1];
Notice we input to Q1 but get results for Q0.
Exercise 2 Green State
Run with existing cache and 1024 shots for the above circuits. Execution results are:
Distribution:
(1) I don’t see any green! (2) this is for qubit 0, not qubit 1. Maybe there is a bug.
Quantum Score file
qreg q,5; gate h, [[0.7071067811865476,0.7071067811865476],[0.7071067811865476,-0.7071067811865476]];gate t, [[1,0],[0,0.7071067811865476+0.7071067811865476i]];gate s, [[1,0],[0,i]];gate bloch, [[1,0],[0,0.7071067811865476+0.7071067811865476i]]; h q[1];t q[1];h q[1];t q[1];s q[1];h q[1];t q[1];h q[1];t q[1];h q[1];t q[1];h q[1];s q[1];bloch q[1];
However, if you simulate with idea processor, you get orange state for Q1.
Exercise 3 Blue State
Run with existing cache and 1024 shots for the above circuits. Execution results are:
Distribution:
Qubits:
I don’t see any blue state. Again it is Q0 not Q1.
Quantum Score file
qreg q,5; gate h, [[0.7071067811865476,0.7071067811865476],[0.7071067811865476,-0.7071067811865476]];gate t, [[1,0],[0,0.7071067811865476+0.7071067811865476i]];gate s, [[1,0],[0,i]];gate bloch, [[1,0],[0,0.7071067811865476+0.7071067811865476i]]; h q[1];t q[1];h q[1];t q[1];h q[1];t q[1];s q[1];h q[1];t q[1];h q[1];t q[1];s q[1];h q[1];bloch q[1];
However, if you simulate with idea processor, you get orange (not blue!) state for Q1.
So I did not reach the conclusion (red, green, blue) desired in the text.