Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 9

Phase Gates: S and T

Recommended resources

Welcome to your next lesson in our module on "Manipulating Qubits with Quantum Gates."

In the previous lesson, we explored the foundational Pauli (X, Y, Z) and Hadamard (H) gates. We saw how they perform fundamental operations like bit-flips, phase-flips, and creating superpositions, which correspond to 180-degree rotations on the Bloch sphere. While powerful, these gates only offer coarse control. To build sophisticated quantum algorithms, we need finer-grained manipulation of a qubit's state.

This lesson focuses on exactly that. Our learning goal is to apply the phase gates (S and T) and explain their effect on a qubit's phase. These gates allow for more subtle rotations, giving us the precision needed to harness quantum interference. We'll see how they relate to the Z gate but perform smaller rotations, and we'll revisit the crucial concept of reversibility in this new context.

1. Understanding Quantum Phase

Before we look at the gates themselves, let's solidify our understanding of "phase." In the context of a qubit, phase refers to the rotation of its state vector around the z-axis of the Bloch sphere.

A change in phase doesn't alter the probability of measuring or , but it critically affects the relative relationship between the and amplitudes in a superposition state . This is somewhat analogous to phase in your field of electrical engineering; the phase difference between voltage and current in an AC circuit doesn't change their magnitudes but is essential for determining power factor and overall system behavior. In quantum computing, this relative phase is the key ingredient for interference, which powers many quantum algorithms.

The following video provides an excellent introduction to phase, explaining how it's represented mathematically and distinguishing between "global phase" (which is unobservable) and "relative phase" (which is vital).

Quantum Computing Course: 1.5 Introduction to Phase

This video from the Quantum Soar channel explains the concept of phase in quantum computing.

Please watch the following segments: The introduction to phase explains its connection to z-axis rotation and the use of complex exponentials like e^{i\phi}. The next part explains the important distinction between global and relative phase. Finally, watch from here to the end for a clear explanation of why phase doesn't change measurement probabilities.


2. The Phase Gates: S and T

The Pauli-Z gate we saw last time is actually a specific type of phase gate. It applies a phase shift of radians (180 degrees). The S and T gates are other important phase gates that apply smaller, more precise rotations.

A general phase gate that rotates a qubit by an angle around the z-axis has the matrix form:

Notice how this matrix leaves the component untouched (multiplying it by 1) and only modifies the phase of the component.

The S and T gates are special instances of this general gate. The following video introduces them clearly.

IQIS Lecture 2.4 — Pauli gates, Clifford gates, and the T-gate

This lecture by Artur Ekert from the Institute for Quantum Information Science (IQIS) formally defines the S and T gates.

First, watch this section to see how the Pauli-Z gate fits into the general family of phase gates. Then, watch this key segment, which defines the S gate as a \pi/2 phase shift and the T gate as a \pi/4 phase shift.

Let's formalize those definitions.

The S Gate (or Phase Gate)

The S gate applies a (90-degree) rotation around the z-axis. It corresponds to . Since , its matrix is:

Geometrically, it's a quarter-turn around the z-axis.

The T Gate (or Gate)

The T gate applies an even finer (45-degree) rotation around the z-axis. It corresponds to . Its matrix is:

where . The T gate is especially important because, when combined with the Hadamard and CNOT gates (which we'll see later), it forms a "universal" set of gates. This means any quantum algorithm can be constructed from just these few gates.

This table provides a great visual summary of these gates, their symbols, and matrices.

Quantum Logic Gates Reference
A summary table of common quantum gates, including the Phase (S) and \(\pi/8\) (T) gates, showing their circuit symbols and matrix representations.

3. Applying the S and T Gates

Let's see these gates in action with a concrete example. We'll start with a qubit in the state, which we create by applying a Hadamard gate to .

Initial state:

On the Bloch sphere, this state vector points along the positive x-axis.

Now, let's apply the S gate:

The resulting state is . Geometrically, our state vector has rotated from the x-axis to the y-axis, a 90-degree turn around the z-axis, exactly as expected.

Next, let's apply the T gate to the same initial state:

The resulting state is . This corresponds to a 45-degree rotation around the z-axis.

Quantum Circuit with Hadamard and Rz Gate on Bloch Sphere
This image visualizes a similar operation. On the left is the circuit. On the right, the Bloch sphere for `q_0` shows the final state after applying a Hadamard gate and then an `Rz(pi/4)` gate, which is precisely the T gate. You can see the vector has rotated 45 degrees from the x-axis in the x-y plane.

4. Reversibility and Inverse Phase Gates

In our last lesson, we saw that the Pauli and Hadamard gates are their own inverses (, ). This is not true for the S and T gates. If you apply the S gate twice, you don't get the identity. Instead, you get:

Applying the S gate twice is equivalent to a Z gate!

Since all quantum gates must be reversible (unitary), the S and T gates must have unique inverse gates. The inverse of a gate is its conjugate transpose, denoted . For phase gates, which are diagonal, this simply means taking the complex conjugate of the diagonal elements.

The following reading explains this and introduces the inverse gates.

Single Qubit Gates

This resource from the "Learning Quantum" GitBook provides great visualizations and a clear explanation of phase gates and their inverses.

Read the sections on the Phase Gate (S Gate) and The T Gate. Pay attention to the GIF animations showing the rotations on the Bloch sphere. Then, read the section on Reversibility, which introduces the Reverse Phase Gate (S^\dagger). This directly reinforces the concept of reversibility for gates that are not their own inverse.

As the resource shows, the inverse of the S gate is the S-dagger gate ():

This applies a rotation of , undoing the original S gate. Likewise, the inverse of the T gate is the T-dagger gate (), which applies a rotation of .


Conclusion

In this lesson, we added two crucial tools, the S and T gates, to our quantum toolkit. These gates give us fine-grained control over a qubit's phase, which is essential for the interference effects that power quantum algorithms.

Key Takeaways:

  • Quantum phase corresponds to a qubit's rotation around the z-axis of the Bloch sphere. While it doesn't affect measurement probabilities, the relative phase in a superposition is fundamental to quantum computation.
  • The S gate applies a phase shift to the state, represented by the matrix .
  • The T gate applies a phase shift to the state, represented by .
  • Unlike the Pauli gates, S and T are not their own inverses. Their reversibility is guaranteed by their conjugate transpose inverses, and , which perform rotations in the opposite direction.

Preview of the Next Lesson:
So far, we have applied single gates to qubits one at a time. The real power of quantum computing comes from combining them. In the next lesson, we will learn how to compose sequences of single-qubit gates to compute a final state vector. This will involve multiplying gate matrices together, moving us one step closer to designing and understanding complete quantum circuits.