liveBook · Manning

Rz gate

As explained in Building Quantum Software with Python

The RZ gate is a single-qubit quantum gate that rotates the zero and one amplitudes in opposite directions by half of a specified angle.

The RZ gate rotates the amplitudes of a single-qubit state in opposite directions. For angle θ, the |0⟩ amplitude turns clockwise by θ/2, while the |1⟩ amplitude turns counterclockwise by θ/2. Their magnitudes, and therefore the outcome probabilities, remain unchanged. section 3.2.2

Represent a state as a pair of amplitudes and update both directions:

  • Multiply the |0⟩ amplitude by cis(-θ/2). section 3.2.2
  • Multiply the |1⟩ amplitude by cis(θ/2). section 3.2.2
  • Keep both amplitude magnitudes, and thus both measurement probabilities, unchanged. section 3.2.2

Applying RZ(π/3)

theta = pi/3 state = [cis(-theta/2)*state[0], cis(theta/2)*state[1]] section 3.2.2

Figure 3.22 The general form of the effect of the RZ gate on a pair of amplitudes
figure

Visualizes the opposite rotations applied to the two amplitudes. section 3.2.2

How Building Quantum Software with Python covers it

How deep it goes
Explains amplitude directions, probability preservation, and a direct state-update implementation, without deriving matrix internals.
Examples
Demonstrates RZ(π/3) through a two-element state-update expression and amplitude-direction diagrams.
What it assumes
Assumes single-qubit amplitudes and probabilities, while using complex-number multiplication to express rotations.
What you can do after
Apply it by multiplying each amplitude by an opposite half-angle complex rotation.
How it connects
Connects single-qubit states, complex amplitudes, phase, and measurement probabilities with the Z, P, H, and Y gates.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Quantum Software with Python. The section links point to the parts of the book it draws on.