Introduction to Quantum Computing

Chapter 2
Essential Mathematics for Quantum Computing

Diploma in Quantum Computing
Introduction to Quantum Computing   •   Diploma

Essential Mathematics for Quantum Computing

Introduction

Quantum computing is built on a mathematical language that combines linear algebra, complex numbers, probability, and operator theory. This mathematics is not merely a formal description: it determines how quantum information is represented, transformed, measured, and interpreted. A qubit is represented by a vector, a quantum gate by a matrix, and a measurement outcome by a probability calculated from a complex amplitude.

This chapter develops the mathematical foundations required to describe single-qubit systems and introduces the notation used throughout quantum computing. The emphasis is on conceptual understanding, accurate calculation, and practical interpretation rather than on abstract proof.

Learning Objectives

By the end of this chapter, you should be able to:

  • perform arithmetic with complex numbers;
  • represent quantum states as vectors and in Dirac notation;
  • calculate vector norms, inner products, and probabilities;
  • distinguish valid quantum states from invalid vectors;
  • multiply matrices and vectors to model quantum operations;
  • explain tensor products and construct multi-qubit states;
  • identify unitary operators and explain why quantum gates are reversible;
  • calculate and interpret eigenvalues and eigenvectors in simple cases;
  • apply these ideas to a practical quantum-circuit problem.

1. Complex Numbers and Probability Amplitudes

A complex number has the form

z = a + bi

where a and b are real numbers and i is the imaginary unit satisfying i2 = -1. The real part of z is a, and the imaginary part is b.

Complex numbers are essential because quantum states use probability amplitudes, which may have both magnitude and phase. Probabilities themselves are real and non-negative, but amplitudes can be complex.

Basic operations

For z1 = a + bi and z2 = c + di:

z1 + z2 = (a + c) + (b + d)i
z1z2 = (ac − bd) + (ad + bc)i

The complex conjugate changes the sign of the imaginary part:

z^* = a − bi

The modulus, or absolute value, is

|z| = √(zz^*) = √(a2 + b2)

The modulus gives the magnitude of an amplitude. Its square is especially important in quantum mechanics:

|z|2 = zz^* = a2 + b2

For example, if z = 3 + 4i, then z^* = 3 − 4i and |z| = 5.

A non-zero complex number may also be written in polar form:

z = reiθ

where r = |z| is the magnitude and θ is the phase angle. Using Euler’s identity, eiθ = cosθ + isinθ. Two amplitudes with the same magnitude but different phase can produce different interference effects.

2. Vectors and Quantum States

A column vector is an ordered list of numbers. A single-qubit state is represented by a two-component complex vector:

|ψ⟩ = [ α ; β ]

Here α and β are complex amplitudes associated with the computational basis states |0⟩ and |1⟩. More explicitly,

|ψ⟩ = α|0⟩ + β|1⟩

with

|0⟩ = [ 1 ; 0 ] |1⟩ = [ 0 ; 1 ]

The symbol |ψ⟩ is called a ket. It denotes a state vector. The corresponding bra is its conjugate transpose:

⟨ψ| = |ψ⟩† = [ α^* β^* ]

The dagger symbol † means transpose and complex conjugate. Thus, the bra corresponding to 2/√5 ; i/√5 is [2/√5 −i/√5].

Normalization

A physical quantum state must have total probability one. For a qubit this requires

|α|2 + |β|2 = 1

This is the normalization condition. A vector that does not satisfy it can be normalized by dividing it by its norm, provided it is not the zero vector.

The norm of a vector |ψ⟩ is

||ψ|| = √(⟨ψ|ψ⟩)

For a qubit,

||ψ|| = √(|α|2 + |β|2)

Worked example: normalization

Consider the vector

|v⟩ = [ 1 ; i ]

Its squared norm is |1|2 + |i|2 = 1 + 1 = 2, so its norm is √2. The normalized state is therefore

|ψ⟩ = (1/√2)[ 1 ; i ]

The probabilities of measuring zero and one are both 1/2. The phase of the second amplitude is different from that of the first, even though the measurement probabilities are equal.

3. Inner Products, Orthogonality, and Measurement

The inner product of two vectors is a complex number. For states |ψ⟩ and |φ⟩, it is

⟨φ|ψ⟩ = ∑j φj^*ψj

For two-dimensional vectors |ψ⟩ = [α ; β] and |φ⟩ = [γ ; δ],

⟨φ|ψ⟩ = γ^*α + δ^*β

Two vectors are orthogonal if their inner product is zero. The computational basis is orthonormal because

⟨0|0⟩ = ⟨1|1⟩ = 1

and

⟨0|1⟩ = ⟨1|0⟩ = 0

For a measurement in the computational basis, the Born rule states that the probability of obtaining outcome |0⟩ is

P(0) = |⟨0|ψ⟩|2

and the probability of obtaining outcome |1⟩ is

P(1) = |⟨1|ψ⟩|2

For |ψ⟩ = α|0⟩ + β|1⟩, these reduce to P(0) = |α|2 and P(1) = |β|2. The probabilities sum to one for a normalized state.

Measurement generally changes the state. If a measurement produces zero, the post-measurement state is |0⟩; if it produces one, the post-measurement state is |1⟩. Before measurement, the state may be a superposition; after a computational-basis measurement, it has been projected onto one basis state.

4. Matrices and Linear Transformations

A matrix is a rectangular array of numbers. A matrix acts on a vector through matrix multiplication. If A is an m × n matrix and x is an n-component vector, then Ax is an m-component vector.

For example,

[ a b ; c d ][ x ; y ] = [ ax + by ; cx + dy ]

Matrix multiplication is associative, (AB)C = A(BC), but is generally not commutative: AB ≠ BA. This non-commutativity is important because the order of quantum gates can affect the final state.

The identity matrix is

I = [ 1 0 ; 0 1 ]

and satisfies I|ψ⟩ = |ψ⟩. A matrix inverse A-1 satisfies A-1A = AA-1 = I, when the inverse exists.

Common single-qubit matrices

The Pauli matrices are

X = [ 0 1 ; 1 0 ] Y = [ 0 −i ; i 0 ] Z = [ 1 0 ; 0 −1 ]

The X gate exchanges |0⟩ and |1⟩. The Z gate leaves |0⟩ unchanged and multiplies |1⟩ by −1. The Y gate combines a bit flip with phase factors.

The Hadamard gate is

H = (1/√2)[ 1 1 ; 1 −1 ]

It transforms the basis states as follows:

H|0⟩ = (|0⟩ + |1⟩)/√2
H|1⟩ = (|0⟩ − |1⟩)/√2

Applying H to |0⟩ produces equal measurement probabilities, while the relative phase differs when the input is |1⟩.

5. Unitary Operators and Reversibility

A matrix U is unitary if

U†U = UU† = I

This condition implies that U-1 = U†. A unitary operation preserves inner products and therefore preserves vector norms:

||U|ψ⟩|| = |||ψ⟩||

Consequently, a unitary operation maps valid quantum states to valid quantum states and preserves total probability. Ideal quantum gates are represented by unitary matrices and are reversible.

For example, X† = X and X2 = I, so applying an X gate twice returns the original state. Similarly, H† = H and H2 = I.

The physical meaning of unitarity is significant: closed-system quantum evolution cannot destroy information. Noise and measurement are not generally represented by a single unitary operation on the system alone; they require a more general description.

6. Tensor Products and Multi-Qubit Systems

The tensor product combines state spaces. If

|a⟩ = [ a1 ; a2 ] |b⟩ = [ b1 ; b2 ]

then

|a⟩⊗|b⟩ = [ a1b1 ; a1b2 ; a2b1 ; a2b2 ]

A two-qubit system has dimension four. Its computational basis is conventionally ordered as

|00⟩, |01⟩, |10⟩, |11⟩

represented by four-component vectors. For example,

|01⟩ = [ 0 ; 1 ; 0 ; 0 ]

under the ordering above.

The tensor product is not ordinary multiplication. It preserves the structure of subsystems and produces a vector whose dimension is the product of the dimensions. In general, an n-qubit state requires 2n complex amplitudes.

Operators also combine through tensor products. If a gate A acts on the first qubit and B on the second, the joint operation is A⊗B. The resulting matrix has dimension four by four for two qubits.

Some multi-qubit states cannot be written as a tensor product of individual single-qubit states. Such states are entangled. For example, the Bell state

|Φ^+⟩ = (|00⟩ + |11⟩)/√2

is normalized, but it cannot be expressed as |a⟩⊗|b⟩. Measuring either qubit in the computational basis gives zero or one with equal probability, but the two results are perfectly correlated.

7. Eigenvalues and Eigenvectors

An eigenvector of a matrix A is a non-zero vector |v⟩ for which

A|v⟩ = λ|v⟩

The scalar λ is the corresponding eigenvalue. Eigenvectors represent directions that a transformation does not rotate into a different direction; it only scales them, possibly changing their phase.

Eigenvalues are found from the characteristic equation

det(A − λI) = 0

For the Z gate, |0⟩ and |1⟩ are eigenvectors:

Z|0⟩ = +|0⟩ Z|1⟩ = −|1⟩

Thus, the eigenvalues are +1 and −1.

For a unitary matrix, every eigenvalue has modulus one. To see this, if U|v⟩ = λ|v⟩ and |v⟩ is non-zero, norm preservation gives ||U|v⟩|| = |||v⟩||, while the eigenvalue equation gives ||U|v⟩|| = |λ| |||v⟩||. Therefore |λ| = 1.

Eigenvectors are especially useful for understanding measurements and repeated operations. If a state is an eigenstate of an operation, applying that operation changes only its phase or scale, not its physical direction.

8. Worked Application: A Simple Quantum Circuit

Consider a qubit initially in |0⟩. Apply a Hadamard gate followed by a Pauli-X gate.

First,

H|0⟩ = (|0⟩ + |1⟩)/√2

Then,

XH|0⟩ = (X|0⟩ + X|1⟩)/√2 = (|1⟩ + |0⟩)/√2

Since addition is commutative for vectors, this is

(|0⟩ + |1⟩)/√2

The final probabilities are P(0) = 1/2 and P(1) = 1/2. The X operation changes the labels of the basis components, but the equal probabilities remain equal.

Now compare this with applying X first and H second:

HX|0⟩ = H|1⟩ = (|0⟩ − |1⟩)/√2

The measurement probabilities are again equal, but the relative phase is different. A later gate can reveal this difference through interference. This illustrates why matrix order matters, even when immediate measurement probabilities happen to be the same.

9. Illustrative Case: Designing a State-Preparation Procedure

Background

A training laboratory wants students to prepare a qubit that produces zero and one with probabilities 0.25 and 0.75 when measured in the computational basis.

Problem

Construct a normalized state with these measurement probabilities and identify a simple gate sequence that can produce it from |0⟩.

Analysis

The Born rule requires amplitude magnitudes

|α| = √0.25 = 1/2 |β| = √0.75 = √3/2

A valid real-amplitude target state is therefore

|ψ⟩ = (1/2)|0⟩ + (√3/2)|1⟩

It is normalized because (1/2)2 + (√3/2)2 = 1/4 + 3/4 = 1.

A rotation about the y-axis can prepare this state. The single-qubit rotation is

Ry(θ) = [ cos(θ/2) −sin(θ/2) ; sin(θ/2) cos(θ/2) ]

For input |0⟩, the output is

Ry(θ)|0⟩ = cos(θ/2)|0⟩ + sin(θ/2)|1⟩

Choose cos(θ/2) = 1/2 and sin(θ/2) = √3/2, giving θ/2 = π/3 and therefore θ = 2π/3.

Outcome

Applying Ry(2π/3) to |0⟩ produces the desired state. Repeating the experiment many times should give frequencies approaching 25% zero and 75% one, subject to statistical variation and device errors.

Learning points

The amplitudes are not probabilities; their squared magnitudes are probabilities. Normalization must be checked before interpreting a state. A phase could also be added to the second amplitude without changing this immediate computational-basis distribution, although it may affect later interference.

10. Practical Limitations and Best Practices

Real quantum processors introduce errors through decoherence, imperfect control, measurement error, and unwanted coupling to the environment. The ideal mathematical model uses unitary gates and exact amplitudes, whereas practical systems use calibrated physical pulses and error-mitigation or error-correction techniques.

The following practices reduce common errors:

  1. Check dimensions before multiplying matrices and vectors.
  2. Normalize every proposed state.
  3. Use conjugate transpose, not ordinary transpose, in complex inner products.
  4. Square amplitude magnitudes, not amplitudes themselves, to obtain probabilities.
  5. Preserve gate order when multiplying operators.
  6. State the computational-basis ordering for multi-qubit vectors.
  7. Distinguish global phase, which does not affect measurement statistics, from relative phase, which can affect interference.
  8. Verify numerical results using both algebra and a simulator when available.

Quantum software tools can automate matrix multiplication and circuit simulation, but they do not remove the need to understand dimensions, normalization, basis conventions, and the meaning of output probabilities. In professional work, an apparently plausible result may still be wrong if a qubit-order convention or conjugation rule has been applied incorrectly.

Chapter Summary

Complex numbers provide magnitudes and phases for quantum probability amplitudes. A qubit is a normalized vector |ψ⟩ = α|0⟩ + β|1⟩, with measurement probabilities determined by the Born rule. Bras, kets, inner products, norms, and orthogonality provide the basic language for states and measurements.

Matrices represent linear transformations, and quantum gates are unitary matrices that preserve norms and are reversible. Tensor products construct multi-qubit states and operators, while also making clear why the state-space dimension grows exponentially with the number of qubits. Eigenvalues and eigenvectors help explain repeated operations and measurement-related structure. These mathematical tools support the design, analysis, and verification of quantum circuits.

Key Terms

Complex number: A number of the form a + bi, where i2 = −1.

Complex conjugate: The number obtained by changing a + bi to a − bi.

Amplitude: A generally complex coefficient whose squared magnitude determines a measurement probability.

Ket: Dirac notation for a state vector, such as |ψ⟩.

Bra: The conjugate transpose of a ket, such as ⟨ψ|.

Norm: The length or magnitude of a vector.

Normalization: The requirement that the total probability of all outcomes equals one.

Inner product: A scalar product such as ⟨φ|ψ⟩.

Orthogonal: Two vectors whose inner product is zero.

Computational basis: The basis consisting of |0⟩ and |1⟩ for a qubit.

Born rule: The rule that assigns probability |⟨x|ψ⟩|2 to measurement outcome x.

Matrix: A rectangular array representing a linear transformation.

Unitary operator: An operator satisfying U†U = I.

Tensor product: An operation combining vector or operator spaces.

Superposition: A linear combination of basis states.

Entanglement: A multi-qubit relationship that cannot be represented as a product of individual states.

Eigenvector: A non-zero vector whose direction is preserved by an operator.

Eigenvalue: The scalar associated with an eigenvector.

Relative phase: The phase difference between amplitudes, which can affect interference.

Global phase: A common phase factor that does not change measurement probabilities.

Review Questions

5 Short Answer Questions

  1. What condition must a single-qubit state satisfy to be normalized?
  2. Why are complex conjugates used in inner products?
  3. What is the difference between an amplitude and a probability?
  4. State the defining equation for a unitary matrix.
  5. What is the dimension of the state space of three qubits?

5 Long Answer Questions

  1. Explain Dirac notation and show how a qubit state is represented in both ket and column-vector form.
  2. Describe how the Hadamard gate acts on |0⟩ and |1⟩, including the resulting probabilities.
  3. Explain tensor products and use them to construct the state |10⟩.
  4. Explain why unitarity preserves total probability and makes ideal quantum gates reversible.
  5. Compare global phase and relative phase, and explain why their physical effects differ.

3 Analytical / Application Questions

  1. Determine whether |v⟩ = (1/√3)[1 ; 1 ; 1] is normalized. If it is, calculate the probability of each computational-basis outcome.
  2. Calculate the final state and measurement probabilities when H is applied to |1⟩ and then Z is applied.
  3. A two-qubit state is |ψ⟩ = (|00⟩ + |01⟩)/√2. Determine whether it can be written as a product of two single-qubit states, and justify your answer.

Multiple Choice Questions with Answers

Question 1

Which condition normalizes the single-qubit state |ψ⟩ = α|0⟩ + β|1⟩?

A. α + β = 1

B. |α|2 + |β|2 = 1

C. |α| + |β| = 1

D. αβ = 1

Correct Answer: B. |α|2 + |β|2 = 1

Question 2

What is the modulus of 3 + 4i?

A. 3

B. 4

C. 5

D. 7

Correct Answer: C. 5

Question 3

For a normalized state |ψ⟩, what is the probability of measuring |0⟩?

A. |⟨1|ψ⟩|2

B. ⟨0|ψ⟩

C. |⟨0|ψ⟩|2

D. ⟨ψ|ψ⟩2

Correct Answer: C. |⟨0|ψ⟩|2

Question 4

Which equation defines a unitary matrix U?

A. U + U† = I

B. U†U = I

C. U2 = 0

D. det(U) = 0

Correct Answer: B. U†U = I

Question 5

What is the dimension of the state vector for four qubits?

A. 4

B. 8

C. 12

D. 16

Correct Answer: D. 16

Question 6

What does the Pauli-X gate do to |0⟩?

A. It produces |0⟩

B. It produces −|0⟩

C. It produces |1⟩

D. It produces (|0⟩ + |1⟩)/√2

Correct Answer: C. It produces |1⟩

Question 7

If U|v⟩ = λ|v⟩ and U is unitary, what must be true of a non-zero eigenvector’s eigenvalue?

A. |λ| = 0

B. |λ| = 1

C. λ = 2

D. λ must be real and positive

Correct Answer: B. |λ| = 1

Question 8

What is the state H|0⟩?

A. |0⟩

B. |1⟩

C. (|0⟩ + |1⟩)/√2

D. (|0⟩ − |1⟩)/√2

Correct Answer: C. (|0⟩ + |1⟩)/√2

Question 9

Which operation combines two single-qubit state spaces into a two-qubit state space?

A. The ordinary sum

B. The determinant

C. The tensor product

D. The trace

Correct Answer: C. The tensor product

Question 10

For the state |ψ⟩ = (1/2)|0⟩ + (√3/2)|1⟩, what is the probability of measuring one?

A. 0.25

B. 0.50

C. 0.75

D. 1.25

Correct Answer: C. 0.75

Introduction to Quantum Computing
Chapter 2 of 14