Bloch sphere
Prepare one pure qubit, apply gates and observe an ideal Z measurement.
About this tool
This tool represents one ideal, pure qubit |ψ⟩ = a|0⟩ + b|1⟩, with |a|² + |b|² = 1. Prepare sets a = cos(θ/2) and b = exp(iφ) sin(θ/2), with θ from 0 to 180° and φ from −180 to 180°. These fields remain the preparation settings; gates change the current amplitudes. Editing an input ends the current trial until Prepare is pressed again. Reset clears the result and keeps the fields.
The Bloch coordinates are x = 2 Re(a* b), y = 2 Im(a* b), z = |a|² − |b|², where a* is the complex conjugate. Current φ is wrapped into [−180°, 180°); at either pole it is undefined. The sphere is an abstract state representation, shown in a fixed orthographic projection. A shorter projected arrow does not mean the pure state has a shorter Bloch vector. +x and −x correspond to |±⟩; +y and −y to |±i⟩.
The matrices use the ordered basis (|0⟩, |1⟩): X exchanges a and b; Y maps them to −ib and ia; Z changes the sign of b; H gives (a+b)/√2 and (a−b)/√2; T multiplies b by exp(iπ/4). These are deterministic unitary operations. The displayed amplitudes retain their global phase through gates. Multiplying both amplitudes by the same exp(iχ) changes neither the Bloch point nor any measurement probabilities. Relative phase can change the effect of a later gate.
Measure Z draws one simulated outcome with Born probabilities P(0) = |a|² and P(1) = |b|², then replaces the state by |0⟩ or |1⟩. A further Z measurement without an intervening gate gives the same outcome with certainty. The last measurement shows its probabilities before collapse, separately from the probabilities now. The counters include all measurements since preparation, even if gates intervene; their frequencies do not estimate the current Born probabilities. Prepare clears counters and the action history. The last 24 actions are shown in time order. No ensemble, hardware noise, extra qubits or tomography is modeled.
Valid preparation settings and the current state, counters and short history are retained through navigation. Very small positive probabilities are displayed in scientific notation. Floating-point rounding limits numerical precision; no near-pole probability is deliberately set to zero.
Sources: IBM Quantum Learning, Bloch sphere; Born rule and unitary gates; global phase; repeated measurements.