Pauli-X: deterministic flip
Input: |0⟩
Sequence: X(q0)
Intermediate/final: |0⟩ → |1⟩
Probabilities: P(1)=100%
A quantum “truth table” is not a Boolean AND/OR table. It shows how a unitary gate or circuit transforms each computational basis ket into amplitudes with magnitudes, phases, and measurement probabilities. Use the quick gate reference or build a circuit to calculate its state-vector map and unitary matrix.
Symbol
Action
Inverse
Key property
No gate steps. The circuit is the identity.
Conventional symbols: ● control, ⊕ controlled-X target, connected ● for CZ, and connected × for SWAP. Qubit 0 is the top wire.
Method: each table row is U|b⟩. The probability of outcome |x⟩ is P(x)=|⟨x|U|b⟩|².
| Input basis |b⟩ | Output state, amplitudes, magnitude, probability, and phase |
|---|
Each example uses input |0…0⟩. Load it to inspect the complete transformation table and unitary.
Input: |0⟩
Sequence: X(q0)
Intermediate/final: |0⟩ → |1⟩
Probabilities: P(1)=100%
Input: |0⟩
Sequence: H(q0)
Intermediate/final: |0⟩ → (|0⟩+|1⟩)/√2
Probabilities: P(0)=P(1)=50%
Input: |10⟩ in top-wire order |q0 q1⟩
Sequence: X(q0), CNOT(q0→q1)
Intermediate: |00⟩ → |10⟩
Final/probability: |11⟩, 100%
Input: |00⟩
Sequence: H(q0), CNOT(q0→q1)
Intermediate: (|00⟩+|10⟩)/√2 in top-wire order
Final: (|00⟩+|11⟩)/√2; 50% each
Input: |10⟩ in top-wire order
Sequence: X(q0), SWAP(q0,q1)
Intermediate: |00⟩ → |10⟩
Final/probability: |01⟩, 100%
Input: |0⟩
Sequence: H(q0), Z(q0)
Intermediate: (|0⟩+|1⟩)/√2
Final: (|0⟩−|1⟩)/√2; still 50% each
Input: |0⟩
Sequence: H, Z, H
Intermediate: |0⟩ → |+⟩ → |−⟩
Final: |1⟩, because HZH=X—not phase kickback
A classical reversible gate permutes basis states. A quantum gate can also create superpositions and relative phases, so its table must preserve complex amplitudes. For example, H maps |0⟩ to (|0⟩+|1⟩)/√2 rather than one Boolean output.
An amplitude is a complex number a+bi. Its magnitude is √(a²+b²), and its measurement probability is a²+b². Probabilities discard phase, so the state-vector and probability views answer different questions.
The selected steps multiply into one circuit matrix U. Its columns are the output vectors for the displayed input basis order. Unitarity preserves total probability and makes every supported gate reversible.
Multiplying the entire state by one phase has no observable effect. Changing the phase of only some terms is relative phase; later gates can convert it into different probabilities through interference. HZH=X is phase-to-bit conversion, not phase kickback. True kickback needs a controlled operation and a target eigenstate.
The bars show theoretical computational-basis probabilities. A physical measurement samples one outcome and collapses the state. This simulator does not sample shots or insert measurement operations.
Internally q0 is the least-significant bit and is the top wire. In default Qiskit-style labels, |q1 q0⟩ means CNOT q0→q1 uses the rightmost character as control and the leftmost as target: |01⟩→|11⟩. Switch to top-wire order and the same mapping reads |10⟩→|11⟩.
The simulator is intentionally small and ideal: 1–3 qubits, the listed fixed gates, no noise, no decoherence, no connectivity or timing constraints, no parameterized rotations, and no mid-circuit measurement or classical control.
This page performs an ideal client-side state-vector simulation using double-precision JavaScript complex arithmetic. It applies each 2 × 2 gate to paired amplitudes and controlled/permutation gates by basis-index mapping, then constructs the circuit unitary by simulating every basis vector. Values below 10−10 are treated as numerical zero for display; exact forms are recognized for common introductory constants, while decimals remain the computed source of truth.
Method references: IBM Quantum Composer state-vector and probability visualizations and Google Cirq simulation documentation.
Reviewed and updated: .
They have basis-state transformation tables. Unlike Boolean truth tables, they may map one input ket to several output kets with complex amplitudes and phases.
H|0⟩=(|0⟩+|1⟩)/√2 and H|1⟩=(|0⟩−|1⟩)/√2. Both inputs give 50/50 measurement probabilities, but their relative signs differ.
For |control target⟩: |00⟩→|00⟩, |01⟩→|01⟩, |10⟩→|11⟩, |11⟩→|10⟩. Check the selected display order before identifying characters.
A unitary such as H can create a superposition. The output is one quantum state with multiple basis components, not several simultaneous classical answers.
Probability is amplitude magnitude squared, so rotating an amplitude in the complex plane does not change its magnitude. Relative phase becomes observable when later operations make amplitudes interfere.
The default is Qiskit style, |q(n−1)…q0⟩, where top-wire q0 is rightmost. The alternate option writes the top wire first as |q0 q1…⟩.
Yes for normalized states and unitary evolution, apart from tiny floating-point error. Every row displays its computed total as a check.
No. It calculates ideal computational-basis probabilities but does not sample shots, collapse states, or model real-device noise.