Build circuits with clear gate syntax, then compute outcomes quickly today here. Inspect statevectors, probabilities, and marginals; export results for research and learning easily.
| Qubits | Gate list | Key outcome |
|---|---|---|
| 2 | H 0 CNOT 0 1 |
Bell state with P(00)=0.5 and P(11)=0.5 |
| 1 | RY 0 1.570796 MEASURE 0 |
Equal superposition: P(0)=0.5, P(1)=0.5 |
| 3 | X 2 SWAP 0 2 |
Moves |001⟩ population to |100⟩ |
This simulator uses the statevector model. For n qubits, the state is a complex vector |ψ⟩ with 2^n amplitudes. Each gate is a unitary matrix U, and the circuit applies: |ψ′⟩ = U |ψ⟩.
Single-qubit gates use a 2×2 matrix acting on a chosen qubit, paired across basis states whose target bit differs. Controlled gates apply a conditional transformation when the control qubit is 1.
Measurement probabilities in the Z basis come from the Born rule: P(state) = |a_state|². Marginal probabilities for one qubit sum over all basis states that share the same bit value at that qubit.
Tip: Start with 2–3 qubits, validate your circuit, then scale up.
This calculator performs statevector simulation for small quantum circuits. It represents an n-qubit register as a complex vector with 2^n amplitudes and updates that vector by applying unitary gates. The output lists amplitudes, probabilities, Z‑basis marginals, and per‑qubit <Z> expectations to summarize the final state.
Statevector cost grows exponentially: memory scales with 2^n complex numbers and each single‑qubit gate touches paired amplitudes across the full vector. That is why this tool targets 1–6 qubits. Within this range, you can explore interference, entanglement, and measurement statistics without long runtimes or huge downloads.
Common Clifford gates (H, X, Y, Z, S) and the T gate support many textbook circuits. Continuous control is provided by rotations RX, RY, and RZ, where angles are entered in radians. For example, RY 0 1.570796 prepares an equal superposition on a single qubit, while RZ changes relative phase without changing probabilities.
Multi‑qubit behavior appears when control logic couples qubits. A standard Bell pair uses H 0 then CNOT 0 1, producing two dominant basis states with equal probability. Controlled‑Z (CZ) adds a conditional phase, useful for phase‑kickback and many variational circuits. SWAP is included to move information between wires when mapping logic to hardware layouts.
The calculator reports measurement marginals in the Z basis using the Born rule. These marginals summarize what you would see if you measured a qubit at the end of the circuit. Because the simulator stays in a pure statevector, the report does not permanently collapse the state; it provides probabilities for analysis and debugging.
A quick quality check is probability conservation: the sum of all basis probabilities should be approximately 1, with minor differences due to rounding. Another check is expectation bounds: -1 ≤ <Z> ≤ 1. If a circuit behaves unexpectedly, test smaller subcircuits, then re‑combine them once results match your design intent.
Use CSV when you want the full statevector for plotting, post‑processing, or comparing against another simulator. The PDF is a compact report for documentation, lab notes, or student submissions. In research workflows, exporting intermediate results helps track how parameter changes affect amplitudes and measurement distributions.
This tool models ideal unitary evolution and Z‑basis measurement summaries. It does not include noise channels, density matrices, mid‑circuit measurement collapse, or sampling shots. For hardware‑level studies, extend the model with decoherence, readout error, and repeated sampling. For learning and prototyping, the current scope is fast, transparent, and easy to verify.
It means the circuit is represented by a full complex vector of length 2^n. Gates update that vector exactly, producing amplitudes and probabilities for every computational basis state.
Rotation gates are defined using trigonometric functions of θ/2, and scientific workflows typically express θ in radians. If you have degrees, convert using θ(rad) = θ(deg) × π/180.
No. MEASURE lines report marginal probabilities for the selected qubit in the Z basis. The simulator keeps a pure statevector and does not perform destructive, sequential collapse.
Use two qubits, initialize |00⟩, then run: H 0 and CNOT 0 1. The statevector will show |00⟩ and |11⟩ with probability 0.5 each.
<Z> is the expected value of the Pauli‑Z operator. +1 indicates certainty of |0⟩, −1 indicates certainty of |1⟩, and values near 0 indicate a balanced or mixed outcome distribution.
Small deviations come from rounding the displayed values. Internally the simulator conserves norm for unitary gates, so the true sum remains approximately 1 within floating‑point precision.
Stay within 1–6 qubits and roughly 60 operations for quick feedback. If you need larger circuits, consider a backend optimized for vectorized linear algebra or a sampling‑based simulator.
Accurate simulations help learners debug circuits and build intuition.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.