Qubit Gates: Polar Projections & Measurement Histogram

A single qubit's pure state |ψ⟩ = cos(θ/2)|0⟩ + esin(θ/2)|1⟩ lives on the Bloch sphere, but a sphere is awkward to read exactly on a flat screen. This 2D companion draws the same state as two honest projections — a top-down disc showing the phase φ and equatorial radius sinθ, and a side-on disc showing the height cosθ — both updated by real 2×2 complex gate matrices (X, Y, Z, Hadamard, S, T, or a general axis-angle rotation you set yourself). A live probability bar shows P(|0⟩) = cos²(θ/2) and P(|1⟩) = sin²(θ/2), and the measurement panel runs an actual weighted-random projective measurement — a single collapsing shot, or a batch of up to 1000 repeated trials whose outcome histogram converges to those exact probabilities.