Quantum Phase Simulator — Relative Phase & Interference Interactive

Interactive laboratory for relative phase, showing an equatorial Bloch-sphere sweep and a second Hadamard gate that turns an invisible phase into a visible measurement-probability change.

← Quantum Computing Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Quantum Phase Simulator

Relative phase is invisible to a single direct measurement, yet it is one of the most important quantities in quantum computing. This simulator dials the phase of an equal superposition around the Bloch-sphere equator, then applies a second Hadamard gate to reveal exactly how that hidden phase turns into a real probability difference.

What the lab covers

• A phase slider sweeping phi from 0 to 360 degrees on the equator of the Bloch sphere. • Live labeled reference points for |+>, |->, |+i> and |-i>. • A one-click action applying a second Hadamard gate and reporting the resulting measurement probabilities. • Before/after probability comparison showing 50/50 pre-Hadamard regardless of phi, contrasted with the post-Hadamard result that depends entirely on phi.

Pre-built scenarios

• Set phi to 0 degrees, apply the second Hadamard, and confirm P(0) reaches 100% — fully constructive interference. • Set phi to 180 degrees and confirm P(0) drops to 0% — fully destructive interference. • Sweep phi continuously and watch P(0) trace a smooth cosine-squared curve between those two extremes.

Why phase is quantum computing's hidden resource

Because a plain measurement cannot see phase directly, algorithms that want to use it have to first encode useful information into phase and then design a sequence of gates that converts that phase difference into a probability difference — exactly the pattern reproduced here in miniature. This is the same principle behind phase estimation and many of the specific speedups quantum algorithms achieve over classical ones.

Frequently asked questions

If relative phase does not affect measurement, why does it matter?

It does not affect a single direct measurement of that qubit alone, but it fully determines what happens when the qubit later passes through another gate that recombines its amplitudes, such as a second Hadamard gate. At that point the phase becomes a real, measurable difference in outcome probabilities.

What is the difference between global phase and relative phase?

Global phase multiplies both amplitudes by the same factor and is never observable by any experiment. Relative phase is the phase difference between the |0> and |1> amplitudes specifically, and while it is invisible to a direct measurement, it is physically real and becomes visible through interference.

What happens at phi = 0 versus phi = 180 degrees after the second Hadamard?

At phi = 0 degrees the two amplitude paths reinforce fully, giving P(0) = 100% after the second Hadamard. At phi = 180 degrees they cancel fully, giving P(0) = 0% (certain to measure 1) — the exact constructive and destructive interference cases explored further in the Quantum Interference lab.

Is this the same phase used in phase-estimation quantum algorithms?

Yes, in essence. Quantum phase estimation encodes information into exactly this kind of relative phase and then uses interference, via controlled operations and an inverse Fourier transform, to read that hidden phase back out as a measurable result — the same "hide it in phase, reveal it with interference" principle shown here in its simplest form.

Related tools & guides