Why can a phase change the final Z-basis measurement probabilities without changing them immediately?
A phase gate changes the relative phase between amplitudes. The final Hadamard recombines them, converting a phase difference into observable probability differences.
State and transformation
On narrow screens, scroll the equation horizontally to view every term.
Quantum circuit
Circuit wire labels follow the Qiskit indexing convention; Statevector results are computed with an ideal simulator, not hardware.
Analytic predictions and simulator results
Swipe the results table horizontally to see all columns.
| Quantity | Analytic prediction | Computed value or classical sample |
|---|---|---|
| φ = 90° · final P(0) | 50% | 50% · Qiskit |
| φ = 180° · final P(0) | 0% | ≈0% · Qiskit |
| Before the final H | P(0) = P(1) = 50% | 50% / 50% · NumPy |
Values are reported from the previously completed local experiments: exact ideal statevector probabilities (Qiskit), classical NumPy sampling where stated, and the specified NumPy density-matrix calculation. These are not observations from physical quantum hardware. Rounded values are shown for readability.
Minimal Qiskit example
This independently written teaching snippet illustrates the verified circuit principle without disclosing the private lab source. Run it with NumPy and Qiskit installed; this abbreviated public snippet has undergone source and syntax review, but not a separate Qiskit-enabled execution test.
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
def final_probabilities(degrees):
circuit = QuantumCircuit(1)
circuit.h(0)
circuit.p(np.deg2rad(degrees), 0)
circuit.h(0)
return Statevector.from_instruction(circuit).probabilities()
for angle in (0, 90, 180):
print(angle, np.round(final_probabilities(angle), 6))
assert np.allclose(final_probabilities(180), [0, 1])This example uses the ideal P(φ) = diag(1, e^{iφ}) gate. The middle phase operation preserves 50:50 Z-basis probabilities after the first H; the final H changes the relevant measurement basis.
Computations are local ideal statevector calculations. Nothing here sends jobs to an IBM Quantum device or cloud backend.
What we can conclude
Relative phase leaves the intermediate Z-basis probabilities unchanged, but the final Hadamard mixes the amplitudes so the relative phase changes the output probabilities. The state remains normalized.
A common global phase has no observable consequence. The relative phase here becomes relevant only after a second Hadamard. The historical finite-shot counts are classical NumPy draws, not quantum-device measurements.