◆ Prerequisite · Optional

Linear Algebra, Complex Numbers & Python — Before Module 1

No quantum computing yet — just the three toolkits every module after this one quietly assumes you already have: vectors and matrices, complex numbers, and enough Python to follow the code. If any of it already feels familiar, skim; if none of it does, take your time here first.

3 Chapters Zero Quantum Assumed 9 Quick-Check Questions 1 Primer Assessment ~30 min
P
Before the story starts
A quiet page before Module 6

Even Maya — whose molecule classifier you'll follow starting in Module 6 — went back and brushed up on exactly these three things first. This page is that brush-up, for you.

PRIMER 1

Linear Algebra & Vector Spaces

Every quantum state you will ever meet in this course — a qubit, a pair of qubits, a whole register of them — is, underneath, just a list of numbers. Every quantum gate that changes that state is just a grid of numbers that transforms the list. That is the entire secret this chapter needs you to walk away with.

A vector is simply an ordered list of numbers. In two dimensions, the vector (3, 2) can be drawn as an arrow starting at the origin and ending at the point 3 across and 2 up. Drag the sliders below and watch the arrow move exactly where you'd expect.

A Vector, as an Arrow
3 2
Vector = (3, 2), length \u2248 3.61

A matrix is a grid of numbers that transforms a vector into a new one — rotating it, stretching it, flipping it, or some mix of all three. Multiplying a vector by a matrix is just following the matrix's instructions for where the arrow's tip should move to.

A Matrix Transforming That Same Vector
Dashed = original vector. Solid = after the transformation.

One special case matters more than any other in this whole course: an eigenvector of a matrix is a vector that the matrix only scales — it never changes direction, only length. Every other vector gets pushed off its original line. Drag the angle slider below and watch for the two spots where the solid arrow never leaves the dashed line.

Finding an Eigenvector
30\u00b0
This matrix (stretch x2 sideways, leave vertical alone) rotates most vectors off their original line.

Last idea for this chapter: when you combine two separate quantum systems — say, two individual qubits — into one joint system, you use the tensor product. A 2-number vector combined with another 2-number vector produces a 4-number vector, built by multiplying every pair of entries.

Tensor Product — A Worked Example
Vector A
1
0
\u2297
Vector B
0
1
=
Combined (A\u2297B)
1\u00d70 = 0
1\u00d71 = 1
0\u00d70 = 0
0\u00d71 = 0
  • Vector = an ordered list of numbers, drawable as an arrow.
  • Matrix = a grid of numbers that transforms a vector into a new one.
  • Eigenvector = a vector a specific matrix only stretches or shrinks, never rotates off its own line.
  • Tensor product = the operation for combining two separate systems into one joint, bigger vector.
Why this matters: in Module 6 onward, "quantum state" means vector, "quantum gate" means matrix, and "two qubits together" means tensor product. Every word changes; the math underneath does not.
◈ Quick Check
0 / 3
PRIMER 2

Complex Numbers & Dirac Notation

Ordinary numbers can only stretch a vector or flip it. Quantum mechanics needs one more move — a kind of rotation baked into the number itself — and that is exactly what a complex number gives you.

A complex number has two parts: a real part and an imaginary part, written a + bi, where i is defined so that i\u00b2 = \u22121 (something no ordinary real number can do). You can plot a + bi on a 2D plane exactly like a vector — real part on the horizontal axis, imaginary part on the vertical one.

The Complex Plane
3 2
re im
3 + 2i — magnitude \u2248 3.61, phase \u2248 33.7\u00b0

Two things about a complex number matter constantly in this course: its magnitude (distance from the origin — how "big" it is) and its phase (the angle it points at). In quantum mechanics, a state's complex numbers are called amplitudes, and the rule connecting them to something measurable is: probability = magnitude squared. Try it below.

Amplitudes \u2192 Probabilities (auto-normalized)
|\u03B1|\u00B2 + |\u03B2|\u00B2 = 1.00 \u2014 a valid quantum state

Physicists write quantum states in Dirac notation (also called bra-ket notation) instead of plain vector brackets — mostly because it is compact and makes a few operations very readable. Tap each card to see what the symbols mean.

Bra-Ket Glossary — Tap Each Card
  • Complex number = a + bi, plottable on a 2D plane just like a vector.
  • Magnitude = distance from the origin; phase = the angle it points at.
  • Amplitude = the quantum-mechanics name for these complex numbers inside a state.
  • Probability = |amplitude|\u00B2 — the single most-used formula in this entire course.
  • Ket |\u03C8\u27E9 = a quantum state, written as a column of amplitudes; bra \u27E8\u03C8| = its mirror image, used for computing overlaps.
Why this matters: every gate you'll apply from Module 6 onward is a matrix of complex numbers, and every measurement result you'll compute comes from squaring one of those numbers.
◈ Quick Check
0 / 3
PRIMER 3

Python & NumPy Primer

Every code snippet you'll see from here on — Qiskit, PennyLane, all of it — sits on top of one library: NumPy. It is Python's toolkit for exactly the two things Primer 1 and 2 just covered: vectors of numbers, and vectors of complex numbers.

A NumPy array is how Python represents a vector or matrix. Read each snippet below, guess the output, then reveal it.

Predict the Output — Creating a Vector
import numpy as np
v = np.array([3, 2])
print(v)
print(v.shape)
[3 2]
(2,)
Predict the Output — Matrix-Vector Multiplication
import numpy as np
M = np.array([[0, -1], [1, 0]]) # a 90\u00b0 rotation
v = np.array([1, 0])
print(M @ v)
[0 1] # the vector (1,0) rotated 90\u00b0 becomes (0,1) \u2014 matches Primer 1's matrix demo
Predict the Output — Complex Numbers in NumPy
import numpy as np
z = 3 + 4j # NumPy/Python use 'j' for i
print(np.abs(z)) # magnitude
print(np.angle(z, deg=True)) # phase in degrees
5.0
53.13... # same magnitude/phase idea from Primer 2
Quick-Reference Cheat Sheet
np.array([1, 0])
Create a vector
np.array([[1,0],[0,1]])
Create a matrix
M @ v or np.dot(M, v)
Matrix-vector or matrix-matrix multiply
v.shape
Check an array's dimensions
3 + 4j
A complex number (Python uses j, not i)
np.abs(z) / np.angle(z)
Magnitude / phase of a complex number
np.kron(a, b)
Tensor (Kronecker) product of two arrays
matplotlib.pyplot
The standard plotting library used alongside NumPy
  • NumPy arrays are how every vector and matrix in this course actually gets represented in code.
  • The @ operator (or np.dot) performs matrix multiplication — the code version of Primer 1's transformations.
  • Python spells i as j in complex number literals, purely a notation quirk to remember.
  • np.kron is the tensor product from Primer 1, ready to use on real arrays.
Why this matters: when Module 6 shows you a line like qml.RY(theta, wires=0), it is quietly doing exactly the matrix-vector multiplication you just predicted above — just with a name instead of a raw matrix.
◈ Quick Check
0 / 3
◆ Adaptive Assessment

Primer Assessment

Three synthesis questions, one per chapter. Your result adapts to your whole session — chapters where you struggled above get flagged for review here.