Loading 3D engine…

⚛️ Quantum Computing Simulation

Drag directly on the sphere to set a qubit state, or apply a gate below — each button runs the real 2×2 complex matrix on the amplitudes and smoothly rotates the state vector to its new position.

Single-qubit gates

State: |0⟩
θ = , φ =
P(measure 0) = |α|²: 100%
P(measure 1) = |β|²: 0%

2-qubit entanglement

State: |00⟩
Correlation: none

How it works

A qubit's pure state |ψ⟩ = α|0⟩ + β|1⟩ maps one-to-one onto a point on the Bloch sphere. Each gate is a fixed 2×2 unitary matrix acting on the complex amplitudes (α, β):

H = 1/√2 [ 1 1 ] X = [ 0 1 ] [ 1 -1 ] [ 1 0 ] Y = [ 0 -i ] Z = [ 1 0 ] [ i 0 ] [ 0 -1 ] S = [ 1 0 ] [ 0 i ]

Applying a gate multiplies the amplitude vector (α,β) by the matrix — geometrically each one is a fixed rotation of the Bloch sphere (X/Y/Z: 180° about their own axis, H: 180° about the (x+z) diagonal, S: 90° about z).

For two qubits, H on A then CNOT (control A, target B) turns the separable |00⟩ into the entangled Bell state (|00⟩+|11⟩)/√2. Neither qubit alone has a definite state anymore — both reduced Bloch vectors shrink to the sphere's center — but measuring A instantly forces B to the same outcome, however far apart they are.

Drag on the sphere to set a qubit state · Drag empty space to orbit · Scroll to zoom