Phase and rotation gates
Continuous changes of angle, and the phase conventions behind familiar gate names.
- Relate S and T to the phase gate P.
- Calculate a Y rotation on the zero state.
A relative phase gate
Section titled “A relative phase gate”It leaves the magnitude of each amplitude unchanged. Therefore it does not change Z-basis probabilities immediately. S is , T is and Z is .
The interference experiment places P between two H gates so you can observe its effect.
A rotation is related, but check its convention
Section titled “A rotation is related, but check its convention”For a standalone one-qubit operation, , so they differ only by global phase. Controlled versions require more care: a phase on one controlled branch can become a relative phase in the larger system.
The Y rotation is
Applying it to zero gives amplitudes and . At , the probabilities are and .
Practise
Section titled “Practise”Set the qubit explorer’s polar angle to 120° and phase to 0°. Compare it with the Y-rotation example. Then apply S and T and explain why the displayed Z probabilities stay fixed while the arrow moves.
Follow a phase in the complex plane
Section titled “Follow a phase in the complex plane”The S gate rotates the one amplitude by a quarter turn while leaving the zero amplitude fixed. Its magnitude does not change. Applying it to plus produces the positive-y state, whose Z probabilities are still equal. Another S produces minus, and two more return plus. The diagram follows the amplitude, while the Bloch sphere follows the corresponding physical state.
A phase gate does not rotate the entire statevector by a common factor unless the input has only one occupied basis component. On a general superposition, it changes the phase difference between components. A later H can reveal that difference as unequal probabilities. This is the same mechanism used by the interference lab, now expressed through named gates.
Worked example: T followed by H
Section titled “Worked example: T followed by H”Begin with plus. T multiplies the one amplitude by a phase of 45 degrees. The state before readout has amplitudes one over the square root of two and one half plus i over two. After H, the output probabilities are
These are approximately 85.4 percent and 14.6 percent. The immediate post-T histogram would have been equal, so the final H is essential to this readout. You can derive the result by adding the complex components or by using the half-angle interference formula. Agreement between those methods is a useful check on angle units and phase signs.
Applying T twice gives S, applying it four times gives Z, and applying it eight times gives the identity. These are exact identities for the stated phase convention. They do not imply that repeated physical gates have no errors or that a compiler should always implement an angle through repeated T gates. Native operations and fault-tolerant synthesis can change the best implementation.
Phase gates and Z rotations
Section titled “Phase gates and Z rotations”P and the Z rotation differ by a common phase when acting alone on a one-qubit state. Their isolated measurement predictions therefore agree. Their printed amplitudes can differ because one convention fixes the zero amplitude while the other shares opposite half-angle phases between both components. Compare physical states rather than assuming identical matrices.
If the operation is controlled, that common phase can become relative between the control’s inactive and active branches. Replacing a controlled phase gate with a controlled Z rotation may require an additional correction on the control. This is a useful warning against dropping phases too early in a subroutine that will later be embedded in a larger circuit.
A Y rotation changes population
Section titled “A Y rotation changes population”A Y rotation on zero has real amplitudes given by the cosine and sine of half its angle. At an angle of 60 degrees, the probabilities are three quarters and one quarter. At 180 degrees, the output is one. Unlike a diagonal phase gate, this rotation changes Z populations directly. The axis and sign convention must be stated before interpreting a rotation parameter.
The explorer’s polar slider prepares the standard angle state directly. It is not a general-purpose button applying an incremental Y rotation to whatever state is currently present. If you change a preparation angle after pressing gates, the slider defines a fresh state. Use the gate buttons for transformations and the sliders for preparation, and record which action produced your result.
Test S and T on a known input
Section titled “Test S and T on a known input”This instance opens at plus. Predict the amplitudes after S, then reveal. Reset and apply T followed by H. Predict the probabilities using the worked result above. Compare the real and imaginary table entries before relying on rounded percentages. Applying H to the final state again should undo that last H and recover the phase-shifted plus preparation.
Qubit explorer
Prepare a pure qubit, apply gates, then compare amplitudes, phases and Z-basis probabilities. Reset restores the initial preparation shown by the lesson’s controls.
Prepare your experiment using the controls. Record a prediction, then reveal the statevector or run the experiment.
Changing the preparation or circuit starts a new prediction.
Take it further
Prepare θ = 120°, φ = 90°. Predict both complex amplitudes. Then change φ without changing θ.
Initial setup · reference state
| Basis | Amplitude a + bi | Magnitude | Phase (rad) | Probability |
|---|---|---|---|---|
| |0⟩ | 0.707107 + 0i | 0.707107 | 0.000000 | 50.0% |
| |1⟩ | 0.707107 + 0i | 0.707107 | 0.000000 | 50.0% |
Signs and complex phases are part of the state. Phase is undefined for a zero amplitude. A shared global phase changes no probabilities; relative phases can affect a later operation. Values are rounded to six decimal places.
Prediction to try: Predict the amplitudes and Z-basis probabilities for the preparation and gates you have chosen. If starting from |0⟩, what will H do?
Challenge: Prepare θ = 120°, φ = 90°. Predict both complex amplitudes. Then change φ without changing θ.
Open the live experiment studioFor a rotation-style preparation, reset and choose polar angle 60 degrees with zero relative phase. Calculate both amplitudes and check the three-quarter/one-quarter distribution. Then change the phase to 90 degrees without changing the polar angle. Explain why the population stays fixed while the one amplitude becomes imaginary.
Practice: distinguish two inverse claims
Section titled “Practice: distinguish two inverse claims”A student says S is its own inverse because applying it does not change Z probabilities. Calculate S squared on plus and compare with the original state. Find an inverse using only repeated S gates.
Check your reasoning
Two S gates produce Z, which maps plus to minus. Those are different physical states despite equal Z probabilities. Three S gates implement the inverse of one S, since four quarter turns make a full turn. A gate’s inverse must restore the entire state for every input, including relative phases, rather than merely preserving one chosen histogram.
Check your understanding
Section titled “Check your understanding”When comparing phase conventions across tools, first test zero, plus and a state with an imaginary component. Zero exposes an overall phase choice, plus reveals relative phase, and the complex input catches conjugation or sign errors that real inputs can hide. State which differences are physically equivalent before changing a correct implementation merely to match another tool’s printed entries.
Is S its own inverse because it preserves Z probabilities?
Answer: No; S² = Z and S⁻¹ = S³. Preserving one histogram is not an inverse test. S must be undone by a negative quarter turn, implemented by S³.
Reference: IBM Quantum — Quantum information.
Ready for the next step?
Your progress stays in this browser.