← Quantum Computing
Quantum Computing

Practical Gate Examples

The H-T-H sequence is a quantum interferometer, converting a T-gate phase shift into a measurable probability change

Source: mortalapps.com
TL;DR
  • The H -> T -> H sequence is a practical example of a quantum interferometer.
  • The first H gate splits the state into an equal superposition.
  • The T gate introduces a relative phase shift of 45 degrees.
  • The second H gate recombines the paths, causing quantum interference.
  • This interference translates the phase shift into a measurable probability difference (85.4% vs 14.6%).
  • This sequence is the foundation of quantum sensing, atomic clocks, and phase estimation.

Why This Matters

To solidify our understanding of quantum gates, we must apply them to practical, end-to-end examples. In this final topic, we will trace a qubit through a complete sequence of gates: $H \rightarrow T \rightarrow H$. This specific sequence is a common building block in quantum algorithms, used to create phase interference and translate phase shifts into measurable probability differences. By working through this example step-by-step, calculating the state vector, tracking its position on the Bloch sphere, and computing the final measurement probabilities, we will bring together everything we have learned in this section.

Core Intuition

Imagine you are a detective tracking a suspect across a city. You have a list of directions: 'Go north 3 blocks, turn right, go 1 block, then turn left.' To find the suspect, you must trace their path step-by-step, noting their location at each turn. Tracing a qubit through a gate sequence is the exact same process. We start at a known location ($|0\rangle$), apply our first instruction ($H$), note the new location ($|+\rangle$), apply the second instruction ($T$), and so on. By the end of the journey, we will know exactly where the qubit is and what we will see when we measure it.

Visualization

Open interactive version ↗

The H-T-H Sequence Tracer To visually guide the user through the complete H -> T -> H gate sequence on the Bloch sphere.

Technical Explanation

Let's analyze the sequence $H \rightarrow T \rightarrow H$ applied to the initial state $|0\rangle$. The mathematical expression for this sequence is written from right to left: $|\psi_{final}\rangle = H T H |0\rangle$. First, we apply the Hadamard gate: $|\psi_1\rangle = H|0\rangle = |+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$. Second, we apply the T gate to this state: $|\psi_2\rangle = T|\psi_1\rangle = \frac{1}{\sqrt{2}}(|0\rangle + e^{i\pi/4}|1\rangle)$. Third, we apply the second Hadamard gate: $|\psi_{final}\rangle = H|\psi_2\rangle = \frac{1}{\sqrt{2}}(H|0\rangle + e^{i\pi/4}H|1\rangle) = \frac{1}{2}((|0\rangle + |1\rangle) + e^{i\pi/4}(|0\rangle - |1\rangle))$. Grouping the terms yields: $|\psi_{final}\rangle = \frac{1+e^{i\pi/4}}{2}|0\rangle + \frac{1-e^{i\pi/4}}{2}|1\rangle$. Using Euler's formula, we can calculate the measurement probabilities: $P(0) = |\frac{1+e^{i\pi/4}}{2}|^2 = \cos^2(\pi/8) \approx 85.4\%$, and $P(1) = |\frac{1-e^{i\pi/4}}{2}|^2 = \sin^2(\pi/8) \approx 14.6\%$. This sequence has successfully translated a phase shift of $\pi/4$ into a measurable probability difference.

Key Takeaways

The H -> T -> H sequence is a practical example of a quantum interferometer.
The first H gate splits the state into an equal superposition.
The T gate introduces a relative phase shift of 45 degrees.
The second H gate recombines the paths, causing quantum interference.
This interference translates the phase shift into a measurable probability difference (85.4% vs 14.6%).
This sequence is the foundation of quantum sensing, atomic clocks, and phase estimation.