Explainer
The math behind quantum computing: vectors, complex numbers, matrices
Quantum computing is written in linear algebra: a qubit's state is a two-entry vector of complex numbers whose squared sizes add up to 1, and every operation on it is a unitary matrix.[1][2] Combining qubits uses the tensor product, so n qubits need a vector with 2^n entries, which is why each extra qubit doubles the memory a classical simulation needs.[3][4]
This is the first step of the quantum computing course. After it, read superposition and entanglement, then how qubits work.
Why linear algebra
Quantum computers are described with the mathematics of vectors and matrices, and Microsoft’s Azure Quantum documentation says some familiarity with linear algebra is essential to understand them.[5] This page covers four ideas: the vector that holds the state, the rule that turns it into probabilities, the matrices that change it, and the product that combines qubits. If you have read linear algebra for machine learning, the vectors and matrices will be familiar; here their entries can be complex numbers.[6]
State vectors and complex amplitudes
A classical bit is either 0 or 1. A qubit can be 0, 1 or a superposition of the two.[7] Mathematicians write its state as a column of two numbers, called amplitudes. The column (1, 0) stands for 0 and (0, 1) stands for 1, and every other state is a weighted mix of these two.[8] The weights can be complex numbers, but there is one rule: their squared sizes must add up to 1.[1]
A column vector of dimension n is an ordered list of n complex numbers. Its norm is the square root of the sum of the squared magnitudes of its entries, and it is a unit vector when that norm is 1.[6] A single-qubit state is a unit vector in two dimensions, written α|0⟩ + β|1⟩ with |α|² + |β|² = 1.[1] The computational basis vectors (1, 0) and (0, 1) span the space.[8] The inner product ⟨u, v⟩ projects one vector onto another and lets you write a state as a sum of simpler states.[9]
Measurement: from amplitudes to probabilities
Looking at a qubit, called measuring it, gives a plain 0 or 1. The chance of each answer is the squared size of its amplitude. After the measurement, the qubit is left in the state it reported.[10] Multiplying the whole column by an overall sign changes nothing you can observe.[11]
Measuring α|0⟩ + β|1⟩ in the computational basis returns 0 with probability |α|² and 1 with probability |β|², and the state collapses to the matching basis vector.[10] A global phase multiplying the whole vector has no observable effect.[11] Quantum algorithms rely on interference, in which amplitudes reinforce some outcomes and cancel others; IBM calls interference the engine of quantum computing.[12] The Bloch sphere draws any single-qubit state as an arrow in three dimensions, but the picture breaks down for several qubits.[13]
Gates are matrices
A quantum operation, or gate, is a square grid of numbers called a matrix. A gate on one qubit is a 2x2 matrix, such as the Pauli X gate, and applying it means multiplying the state column by that matrix.[14] Quantum gates are a special kind of matrix, called unitary, that keeps the probabilities adding up to 1. Every unitary gate can be reversed.[2]
Quantum operations are unitary matrices: U†U = UU† = I, where U† is the conjugate transpose. Unitaries preserve vector norms, so total probability stays 1.[2] Unitary transformations and measurement are the only valid operations on a qubit, and the adjoint is what inverts a transformation.[15] Microsoft’s documentation notes that in practice you meet essentially two kinds of matrix: unitary ones for operations and Hermitian ones (M = M†).[16] The Clifford gates (H, S and the Paulis X, Y, Z), combined with the non-Clifford T gate, can approximate any single-qubit unitary.[17]
Many qubits: the tensor product and 2^n
To describe two qubits together, you combine their columns with an operation called the tensor product. Two 2-number columns become one 4-number column.[3] In general, n qubits need a column of 2^n numbers. So every extra qubit doubles the memory an ordinary computer needs to track the state.[4] Some combined states can’t be split back into separate qubits. These are called entangled, and their information sits in the links between the qubits.[18]
The joint state of independent qubits is the Kronecker product ψ ⊗ φ, which is not the same as matrix multiplication. Two qubits live in a 4-dimensional space.[3] An n-qubit state is a unit vector of dimension 2^n. Storing it classically doubles in cost with each qubit, and simulation time roughly doubles too.[4] States such as (|00⟩ + |11⟩)/√2 cannot be factored into a tensor product and are entangled. Their information is non-local, held in correlations.[18] The superconducting qubits and other hardware in this course all implement these same rules, so this notation carries through to quantum gates and circuits, algorithms and error correction.
What this primer leaves out
This page covers only what you need to follow the rest of the course. It skips density matrices, eigenvalues and observables, which the error-correction and algorithm pages introduce when they need them.
Read next
Next in the crash course
Quantum superposition and entanglement explained
What quantum superposition and entanglement are, what Bell tests proved, what entanglement cannot do, and why both matter for quantum computers and networks.
Questions readers ask
What math do I need to understand quantum computing?
Mainly linear algebra with complex numbers - vectors, matrices, matrix multiplication and the tensor product. Microsoft's quantum documentation calls some familiarity with linear algebra essential.[5][3]
Why are complex numbers used for qubits?
A qubit's state is a two-dimensional vector whose entries can be complex numbers; the only rule is that their squared magnitudes add up to 1.[1]
How do amplitudes turn into probabilities?
Measuring a qubit with amplitudes alpha and beta gives 0 with probability equal to the squared magnitude of alpha and 1 with probability equal to the squared magnitude of beta.[10]
What is a unitary matrix and why does it matter?
A unitary matrix is a square matrix whose conjugate transpose is its inverse. Quantum operations are unitary, so they preserve the vector's length and can be undone.[2][15]
Why is simulating quantum computers so hard for ordinary computers?
The state of n qubits is a vector of 2^n numbers, so each added qubit doubles the memory a classical simulation needs and roughly doubles its running time.[4]
Sources
· 18 claims from 2 publishers
Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.
- [1]
The state of a single qubit is described by a two-dimensional column vector of unit norm, so the squared magnitudes of its two entries must add up to 1. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [2]
Quantum operations are represented by unitary matrices, square matrices whose adjoint (conjugate transpose) equals their inverse, and unitary matrices preserve the norm of a vector. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [3]
The tensor (Kronecker) product, which is different from matrix multiplication, is used to represent the combined state of multiple qubits; two 2-dimensional qubit states combine into a 4-dimensional state. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- Operations on multiple qubits · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [4]
The state of n qubits is a unit vector of dimension 2^n, so each extra qubit doubles the memory needed to store the state on a classical computer and roughly doubles the computing time. confirmedas of 2026-11-22
- Operations on multiple qubits · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [5]
Microsoft's Azure Quantum documentation says some familiarity with linear algebra is essential to understand quantum computing. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [6]
In quantum computing, a column vector of dimension n is a list of n complex numbers arranged as a column, and a vector is a unit vector if its norm (the square root of the sum of the squared magnitudes of its entries) is 1. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [7]
While a classical bit is either 0 or 1, a qubit can be 0, 1 or a quantum superposition of 0 and 1. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [8]
By convention, the column vectors (1, 0) and (0, 1) stand for the classical states 0 and 1; they form a basis, so every qubit state can be written as a weighted sum of them. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [9]
The scalar (inner or dot) product of two vectors gives the projection of one vector onto another, and is used to express one vector as a sum of simpler vectors. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [10]
When a qubit with state vector (alpha, beta) is measured, the outcome 0 occurs with probability equal to the squared magnitude of alpha and the outcome 1 with probability equal to the squared magnitude of beta, and the qubit is left in the matching basis state. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [11]
Multiplying a whole state vector by an overall sign or phase (a "global phase") does not change any measurement probabilities. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [12]
Interference, in which quantum amplitudes reinforce some outcomes and cancel others, is described by IBM as the engine of quantum computing. confirmedas of 2026-10-10
- What is quantum computing? · IBM · Primary source (retrieved 2026-10-10)
- [13]
The Bloch sphere pictures a single-qubit state, which is a two-dimensional complex vector, as a three-dimensional real arrow, but the picture breaks down for multi-qubit states. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [14]
Quantum operations are represented by square matrices; single-qubit operations are 2x2 matrices, such as the Pauli X matrix. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [15]
The valid things a quantum computer can do to a qubit are unitary transformations and measurement, and the adjoint is needed to invert quantum transformations. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [16]
Microsoft's documentation says that in quantum computing there are essentially only two kinds of matrix to know, Hermitian and unitary. confirmedas of 2026-11-22
- Vectors and matrices in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [17]
The Pauli and other Clifford gates, combined with the non-Clifford T gate, can be composed to approximate any unitary transformation on a single qubit. confirmedas of 2026-11-22
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- The qubit in quantum computing · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- [18]
A multi-qubit state that cannot be written as the tensor product of single-qubit states is called entangled; its information is stored in the correlations between the qubits rather than in either one alone. confirmedas of 2026-11-22
- Operations on multiple qubits · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
- Operations on multiple qubits · Microsoft Learn (Azure Quantum documentation) · Primary source (retrieved 2026-11-22)
Revision history (1)
- Page created.
Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Aug 16, 2027.
Cite this page
"The math behind quantum computing: vectors, complex numbers, matrices." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/quantum-computing-math-primer
Spotted an error? Suggest a correction or emailcorrections@contentlora.com.