QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
02 · Bits, qubits and notation0%

You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.

Learn/QC 101Quantum Foundations·Lesson 2 of 7

Bits, qubits and notation

Kets, amplitudes and how a register of qubits is written down.

Beginner12 min read6 sections · 2 questions+45
By the end you will be able to
  1. 01Read |0⟩, |1⟩ and α|0⟩ + β|1⟩ aloud and say what each symbol means.
  2. 02Explain the normalisation rule |α|² + |β|² = 1.
  3. 03Write the state of a two-qubit register and map it to the labels QubitLab shows.

A classical bit is 0 or 1. A qubit is described by two complex numbers, called amplitudes, attached to the two classical outcomes. Physicists write the outcomes as kets: |0⟩ and |1⟩. The general state is a weighted sum of the two.

∣ψ⟩=α∣0⟩+β∣1⟩,∣α∣2+∣β∣2=1
α and β are the amplitudes. Their squared magnitudes are the probabilities of reading 0 and 1, so they must add to one.
Definition
Amplitude

A complex number attached to one outcome. Its squared magnitude |a|² is the probability of that outcome; its phase cannot be seen in a single measurement, but it decides how amplitudes add or cancel later.

Worked solution
Is this a valid qubit state?

Check |ψ⟩ = (3/5)|0⟩ + (4i/5)|1⟩, then find the probability of reading 1.

  1. 1|α|² = (3/5)² = 9/25.
  2. 2|β|² = |4i/5|² = (4/5)² = 16/25: the i only changes the phase, not the size.
  3. 39/25 + 16/25 = 1, so the state is normalised.

Answer: Valid. P(1) = 16/25 = 0.64.

01Kets are column vectors

Definition
Ket |x⟩

Dirac's notation for the state labelled x. Written as a column vector it has a 1 in position x and 0 everywhere else, so |0⟩, |1⟩, |00⟩ … are the basis vectors every other state is built from.

∣0⟩=(10​),∣1⟩=(01​),α∣0⟩+β∣1⟩=(αβ​)
Gates will be 2×2 matrices acting on these vectors. Nothing more exotic than linear algebra is needed for the whole course.

02Several qubits

Two qubits have four basis states: |00⟩, |01⟩, |10⟩, |11⟩, each with its own amplitude. n qubits have 2ⁿ. QubitLab labels states with the rightmost character being qubit 0, the same convention Qiskit uses, so |10⟩ means qubit 1 is 1 and qubit 0 is 0.

∣ψ⟩=x∈{0,1}n∑​ax​∣x⟩,x∑​∣ax​∣2=1
Hands-on

Read a statevector

Open this circuit and switch the results to the State tab. The table lists every basis state with its probability and phase; compare the labels with the qubit order on the wires.

OpenQASM 3
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
x q[1];
h q[0];
Sign in to run (nothing is saved)
Open in the IDE Open in the Playground
Common mistake

Do not read an amplitude as a probability. In (|0⟩ + |1⟩)/√2 the amplitude of |1⟩ is 1/√2 ≈ 0.707, but the probability of measuring 1 is its square, 1/2.

Knowledge check

2 questions · one try each counts

Question 1

A qubit is in the state (|0⟩ + |1⟩)/√2. What is the probability of measuring 1?

Sign in to answer and climb the ranks; you will come back to this lesson.

Question 2

How many amplitudes describe a 5-qubit register?

Sign in to answer and climb the ranks; you will come back to this lesson.

Key takeaway

A qubit is a unit vector with two complex entries; a register of n qubits is a unit vector with 2ⁿ entries. Probabilities are squared magnitudes of amplitudes.

Finished reading?

Knowledge check: 2 questions waiting above. Questions are optional. Mark it complete, or press Next: moving on marks it complete too.

Up next
Lesson 3 · 12 min
Superposition and the Hadamard gate
Where superpositions come from, what phase is, and why H twice does nothing.
Further reading
  • Docs: states and basics
More in Quantum Foundations
  • Why quantum computing?
  • Measurement
  • Quantum Coin Game & Interference
Why quantum computing?Superposition and the Hadamard gate
In this lesson0%
  1. Introduction
  2. Kets are column vectors
  3. Several qubits
  4. Try it: Read a statevector
  5. Knowledge check
  6. Key takeaway
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in