Multi-Qubit Circuit & Entanglement Builder

This simulator maintains a genuine 2- or 3-qubit quantum state as a full 2ⁿ-dimensional complex amplitude vector, not a shortcut approximation. Placing an H, X or Z gate on a wire expands that gate's real 2×2 matrix into the full register via a tensor-product update; placing a CNOT applies its real 4×4 two-qubit matrix across whichever pair of qubits you choose as control and target. Build a circuit gate by gate, watch every basis-state amplitude and probability update live, and use the Bell-state or GHZ-state presets to see the state-vector engine produce genuine entanglement — verified here by partial-tracing the state down to a single qubit's reduced density matrix and reporting its purity, which drops to exactly 0.5 for a real Bell pair.