QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
  1. Docs
  2. Quantum basics
Learn
  • Quantum basics
  • OpenQASM 3 cheat sheet
  • All gates, with the math
  • Every gate, interactive
  • Entanglement: how CNOT connects qubits
Circuits
  • Dynamic circuits: if/else, loops and conditions
Lessons
  • Learning path: from one qubit to algorithms
  • Quantum machine learning by hand
Run
  • Compile (transpile): levels, basis gates, topology
  • Simulators, noise, T1/T2 and fake backends
  • Python in the Playground
  • GitHub and git in the Playground
  • Articles and sharing
Analyze
  • Metrics: comparing distributions
  • Q-sphere and Bloch spheres
Hardware
  • Real IBM Quantum hardware
  • Device topology and calibration heat maps
  • Benchmark circuits: MQT Bench and QASMBench
Advanced
  • Circuit cutting, in depth
Story
  • The story of quantum computing
  • The Hamiltonian: where gates come from
  • What to expect next
Documentation/Learn/Quantum basics

Quantum basics

A qubit is the quantum version of a bit. Instead of being only 0 or 1, it can be in a superposition of both until it is measured.

The state of one qubit is a unit vector in a two-dimensional complex space. We write the two basis states as |0⟩ and |1⟩, and a general state as:

∣ψ⟩=α∣0⟩+β∣1⟩,∣α∣2+∣β∣2=1
α and β are complex amplitudes. |α|² is the probability of measuring 0, |β|² the probability of measuring 1.

Every single-qubit state can be drawn as a point on the Bloch sphere. The north pole is |0⟩, the south pole is |1⟩, and points on the equator are equal superpositions with different phases:

∣ψ⟩=cos2θ​∣0⟩+eiφsin2θ​∣1⟩
θ is the angle from the north pole, φ the angle around the Z axis. In the State tab, QubitLab shows this vector for every qubit.

Two or more qubits live in the tensor product space. Two qubits have four basis states |00⟩, |01⟩, |10⟩, |11⟩. Qiskit orders bits with qubit 0 on the right, so |10⟩ means q1 = 1 and q0 = 0.

∣Φ+⟩=2​1​(∣00⟩+∣11⟩)
The Bell state: an entangled pair. Neither qubit has a state of its own, so both Bloch arrows shrink to zero length.

Measurement in the computational basis gives a classical bit: outcome x with probability |amplitude of x|². After measuring, the state collapses to that outcome. Running the same circuit many times (shots) and counting outcomes estimates the probabilities.

p(x)=∣⟨x∣ψ⟩∣2,p^​(x)=shotscounts(x)​

Gates are unitary matrices U (U†U = I). A circuit is a product of gates applied in time order, so the final state is U_n … U_2 U_1 |0…0⟩. The Compile step in QubitLab shows this matrix for circuits up to 3 qubits.

Why OpenQASM 3? Every circuit sent to a simulator or real hardware is OpenQASM 3: a safe description of a circuit that the server can parse and check before anything executes. Python you write in the Playground is different: it runs in an isolated sandbox with no network, no files and no secrets (see Python in the Playground).

Next →
OpenQASM 3 cheat sheet
Try it in the IDE →
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in