QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
  1. Docs
  2. Q-sphere and Bloch spheres
Learn
  • Quantum basics
  • OpenQASM 3 cheat sheet
  • All gates, with the math
  • Every gate, interactive
  • Entanglement: how CNOT connects qubits
Circuits
  • Dynamic circuits: if/else, loops and conditions
Lessons
  • Learning path: from one qubit to algorithms
  • Quantum machine learning by hand
Run
  • Compile (transpile): levels, basis gates, topology
  • Simulators, noise, T1/T2 and fake backends
  • Python in the Playground
  • GitHub and git in the Playground
  • Articles and sharing
Analyze
  • Metrics: comparing distributions
  • Q-sphere and Bloch spheres
Hardware
  • Real IBM Quantum hardware
  • Device topology and calibration heat maps
  • Benchmark circuits: MQT Bench and QASMBench
Advanced
  • Circuit cutting, in depth
Story
  • The story of quantum computing
  • The Hamiltonian: where gates come from
  • What to expect next
Documentation/Analyze/Q-sphere and Bloch spheres

Q-sphere and Bloch spheres

Two pictures of a state: the Q-sphere shows the whole multi-qubit state; Bloch spheres show each qubit alone.

Q-sphere: each basis state with non-zero amplitude is a dot. Latitude = Hamming weight (|0…0⟩ at the north pole, |1…1⟩ at the south pole). Dot size ∝ probability, colour = phase on a 0 → 2π wheel, with the global phase fixed so the largest amplitude is real and positive.

ρq​=Trothers​∣ψ⟩⟨ψ∣,r=(Trρq​X, Trρq​Y, Trρq​Z),purity=Trρq2​
Bloch vector of one qubit from its reduced density matrix. |r| = 1 for a pure, unentangled qubit; |r| = 0 and purity ½ for a maximally entangled one (Bell state).

The step slider replays the circuit one DAG layer at a time (step 0 = |0…0⟩), so you can watch entanglement appear when the CNOT is applied.

Five pictures of one state

ViewWhat it shows
Q-sphereAll basis states at once: size = probability, colour = phase, latitude = Hamming weight.
BarsProbability |a|² per basis state; each bar keeps the phase colour, so a Z gate changes colours but not heights.
AmplitudesReal and imaginary part of every amplitude as grouped bars: the raw statevector, signs included.
LineMagnitude |a| and phase/π as two lines over the basis states; interference shows up as magnitudes moving while phases line up.
BlochOne sphere per qubit from the reduced density matrix; a qubit is tagged entangled when its purity drops below 0.99.

Debug mode: breakpoints and stepping

The Debug tab in the IDE (and the Playground) runs the whole circuit on the server in one call and lets you walk through it like a program: Debug/Continue (F5), Step over (F10), Step back (Shift+F10), Restart (Ctrl/⌘+Shift+F5), Stop (Shift+F5). Click a gate in the circuit, or the gutter next to a line of OpenQASM 3 or Python, to set a red breakpoint; Continue runs to the next one. The current gate is highlighted, future gates are dimmed, and a timeline under the circuit scrubs to any step.

Every step carries the gate matrix, the statevector before and after (table and kets), the probabilities, the Bloch vectors with purity, and the fidelity. With a fake backend as the noise model, each gate is translated to the device's native gates and run on a density-matrix simulator with that device's noise, so the Fidelity chart shows how far the real state drifts from the ideal one gate by gate. Debug mode covers up to 4 qubits and 80 gates; measurements appear as one final step with sampled counts.

F(ρ,∣ψ⟩)=⟨ψ∣ρ∣ψ⟩,purity=Trρ2
Fidelity of the noisy state ρ against the ideal |ψ⟩, and purity of the whole register (1 = pure).
← Previous
Metrics: comparing distributions
Next →
Real IBM Quantum hardware
On this page
  • Five pictures of one state
  • Debug mode: breakpoints and stepping
Try it in the IDE →
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in