egtry / Quantum States & Qubits Step by Step

Z Gate Sign

The Z gate changes a sign that matters only when amplitudes later interfere.

Calculate the baseline

Z preserves the zero amplitude and negates the one amplitude. The direct measurement probabilities remain unchanged.

Apply an ideal Z gate to the normalized real amplitudes (0.6, 0.8). What is the output probability of zero?

  1. Z: (0.6, 0.8) → (0.6, -0.8) — Apply the ideal gate to amplitudes before squaring.
  2. a′ = a; b′ = −b — Keep the signs: interference happens at the amplitude level.
  3. P0 = (0.6)² = 0.36 1; P1 = 0.64 — Read the two computational-basis probabilities.
  4. ✓ — Independent check: Unitary gate conserves norm; independently reconstruct the complementary probability.

Enable JavaScript to control the model and practise.

Compare a second case

Applying Z to an already negative one amplitude restores its positive sign. Relative signs matter when a later operation recombines amplitudes.

Apply an ideal Z gate to the normalized real amplitudes (0.6, -0.8). What is the output probability of zero?

  1. Z: (0.6, -0.8) → (0.6, 0.8) — Apply the ideal gate to amplitudes before squaring.
  2. a′ = a; b′ = −b — Keep the signs: interference happens at the amplitude level.
  3. P0 = (0.6)² = 0.36 1; P1 = 0.64 — Read the two computational-basis probabilities.
  4. ✓ — Independent check: Unitary gate conserves norm; independently reconstruct the complementary probability.

Enable JavaScript to control the model and practise.

Test the boundary and practise

For a zero basis state the one amplitude is already zero. Z leaves this state unchanged.

Apply an ideal Z gate to the normalized real amplitudes (1, 0). What is the output probability of zero?

  1. Z: (1, 0) → (1, 0) — Apply the ideal gate to amplitudes before squaring.
  2. a′ = a; b′ = −b — Keep the signs: interference happens at the amplitude level.
  3. P0 = (1)² = 1 1; P1 = 0 — Read the two computational-basis probabilities.
  4. ✓ — Independent check: Unitary gate conserves norm; independently reconstruct the complementary probability.

Enable JavaScript to control the model and practise.

Recap