Web Simulation 

 

 

 

 

Quantum Gate Simulator 

Bloch Sphere Representation

A single qubit state can be represented as |ψ⟩ = cos(θ/2)|0⟩ + esin(θ/2)|1⟩, where θ ∈ [0, π] and φ ∈ [0, 2π]. The Bloch sphere visualizes this: the north pole (+Z) corresponds to |0⟩, the south pole (−Z) to |1⟩, and any point on the surface represents a pure qubit state.

1-Qubit Gates

  • X, Y, Z (Pauli): 180° rotations. X maps |0⟩ ↔ |1⟩.
  • H (Hadamard): Creates superposition: |0⟩ → (|0⟩+|1⟩)/√2.
  • S, T: Phase gates (90°, 45° about Z).
  • Rx(γ), Ry(γ), Rz(γ): Parametric rotation gates; γ sets the rotation angle.

2-Qubit Gates

  • CNOT: Q₀ control, Q₁ target. If control is |1⟩, applies X to target.
  • SWAP: Exchanges the states of Q₀ and Q₁.
  • CZ: Phase flip on Q₁ when Q₀ is |1⟩.

When the output is entangled, the Bloch spheres turn purple and show reduced density matrices (mixed-state approximation).

Input Q0

0
0

Input Q1

0
0

Gates

Output Q0

Output Q1

Measurement Probabilities

|00⟩
0%
|01⟩
0%
|10⟩
0%
|11⟩
0%

Usage

  1. Input State: Use θ and φ sliders to set each qubit. For 1-qubit mode, only Q₁ is shown; for 2-qubit gates (CNOT, SWAP, CZ), both Q₀ and Q₁ appear.
  2. Gates: 1-qubit gates apply to Q₁; 2-qubit gates act on both. For parametric gates (Rx, Ry, Rz), use the γ slider to set the rotation angle.
  3. Measurement Probabilities: The histogram shows P(|00⟩), P(|01⟩), P(|10⟩), P(|11⟩) from the current 4D state. Purple bars indicate entanglement.
  4. Measure System: Collapses the state to a single outcome (Born rule); output spheres jump to the measured basis state.
  5. Reset Simulation: Clears the measurement and restores the full probability distribution.
  6. Reset: Sets all inputs to |0⟩ and gate to H.