|q⟩ Bad Qubits

beginner · Physics · Math Foundations: Linear Algebra

Vector Addition and Scaling

Quantum states live in complex vector spaces, so the two most elementary operations — vector addition and scalar multiplication — form the backbone of everything that follows.

Vectors in Cn\mathbb{C}^n

A vector ψ|\psi\rangle in Cn\mathbb{C}^n is an ordered list of nn complex numbers:

ψ=(ψ1ψ2ψn),ψkC.|\psi\rangle = \begin{pmatrix} \psi_1 \\ \psi_2 \\ \vdots \\ \psi_n \end{pmatrix}, \qquad \psi_k \in \mathbb{C}.

For a two-level quantum system (such as a qubit or a spin-12\tfrac{1}{2} particle) the state space is C2\mathbb{C}^2, and n=2n = 2.

Addition

Adding two vectors means adding their components position by position:

ψ+ϕ=(ψ1+ϕ1ψ2+ϕ2ψn+ϕn).|\psi\rangle + |\phi\rangle = \begin{pmatrix} \psi_1 + \phi_1 \\ \psi_2 + \phi_2 \\ \vdots \\ \psi_n + \phi_n \end{pmatrix}.

Each sum ψk+ϕk\psi_k + \phi_k is an ordinary complex addition: real parts add with real parts, imaginary parts add with imaginary parts.

Scalar Multiplication

A scalar αC\alpha \in \mathbb{C} stretches (and rotates) a vector:

αψ=(αψ1αψ2αψn).\alpha\,|\psi\rangle = \begin{pmatrix} \alpha\,\psi_1 \\ \alpha\,\psi_2 \\ \vdots \\ \alpha\,\psi_n \end{pmatrix}.

Each product αψk\alpha\,\psi_k uses the full complex multiplication rule:

(a+bi)(c+di)=(acbd)+(ad+bc)i.(a + bi)(c + di) = (ac - bd) + (ad + bc)\,i.

Scaling by a phase eiθe^{i\theta} (which has modulus 1) rotates every component in the complex plane without changing any magnitudes.

Why This Matters for Quantum Mechanics

A superposition of states is literally a scaled sum of vectors. If 0|0\rangle and 1|1\rangle are the two basis vectors of C2\mathbb{C}^2:

ψ=α0+β1,α,βC,|\psi\rangle = \alpha\,|0\rangle + \beta\,|1\rangle, \quad \alpha,\beta \in \mathbb{C},

then α\alpha and β\beta are the amplitudes of the superposition. For a normalized state (one with α2+β2=1|\alpha|^2 + |\beta|^2 = 1) the probability of measuring outcome kk is ψk2|\psi_k|^2, so understanding how addition and scaling transform these amplitudes is essential for predicting measurement probabilities.

Worked Example

Let v=(1+2i3i)|v\rangle = \begin{pmatrix} 1+2i \\ 3-i \end{pmatrix} and w=(2i4i)|w\rangle = \begin{pmatrix} 2-i \\ 4i \end{pmatrix}.

Compute iv+wi\,|v\rangle + |w\rangle component by component.

First component:

i(1+2i)+(2i)=(i+2i2)+(2i)=(2+i)+(2i)=0.i(1+2i) + (2-i) = (i + 2i^2) + (2-i) = (-2+i) + (2-i) = 0.

Second component:

i(3i)+4i=(3ii2)+4i=(1+3i)+4i=1+7i.i(3-i) + 4i = (3i - i^2) + 4i = (1+3i) + 4i = 1+7i.

So iv+w=(01+7i)i\,|v\rangle + |w\rangle = \begin{pmatrix} 0 \\ 1+7i \end{pmatrix}.

Notice that the first component cancelled exactly to zero — a hint of destructive interference, the mechanism behind many quantum speed-ups.

Try it

This is a numerical exercise — your code should return a number, not a circuit. Using the vectors from the worked example, verify that the first component of iv+wi\,|v\rangle + |w\rangle has modulus 00.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.