Scientia sine finibus

Linear Algebra / Unit 8, Complex Vector Spaces / Topic 8.2

Units and Topics

Unit 8. Complex Vector Spaces

8.2 Complex Vectors and the Inner Product

This topic allows the components of a vector to be complex numbers. Addition and multiplication by a number work as before. The dot product must change, because the old formula no longer gives a length. The new product is called the inner product, and it uses complex conjugates. The topic also defines the conjugate transpose of a matrix, which takes over the role of the transpose.

You need Topics 1.2, 1.4, 3.3, 6.2, and 8.1 for this topic.

1. Complex Vectors

A complex vector with n components is a list of n complex numbers. The set of all such vectors is written Cⁿ, in the same way that Rⁿ stands for the real vectors of Topic 1.4. Vectors are added component by component. A vector can be multiplied by any complex number, and such a number is called a scalar.

u = 1 + i2 iu = −1 + i2i u + 3i = 4 + i2 + i

All of the ideas of Unit 4 carry over without change: linear combinations, span, independence, basis, and dimension. The coefficients of a combination are now complex numbers. The space Cⁿ has the dimension n, and the standard basis vectors are a basis of it.

2. The Length of a Complex Vector

For a real vector, the squared length is the sum of the squares of the components. For a complex vector, that formula fails. Take the vector (1, i).

1² + i² = 1 − 1because i² = −11² + i² = 0

A vector that is not the zero vector must not have the length 0. The repair is to use the squared absolute value of each component in place of its square.

|v|² = |v₁|² + |v₂|² + … + |vₙ|²

From Topic 8.1, |z|² = z* z. For the vector (1, i), the squared length is 1 + 1 = 2, and the length is √2. A length is always a real number that is not negative, and only the zero vector has the length 0.

3. The Inner Product

The product that matches this length takes the conjugate of each component of the first vector.

⟨u, v⟩ = u₁* v₁ + u₂* v₂ + … + uₙ* vₙ

This number is called the inner product of u and v. With this definition, ⟨v, v⟩ = |v|², as required. For real vectors the conjugates change nothing, and the inner product is the dot product.

Books do not agree on which vector receives the conjugates. Physics books conjugate the first vector, and many mathematics books conjugate the second. This course conjugates the first vector, because Unit 9 uses the notation of quantum mechanics. When you read another book, check its convention first.

An example

Let u = (1 + i, 2) and v = (3, i).

⟨u, v⟩ = (1 − i)(3) + (2)(i)the conjugates of the components of u times the components of v⟨u, v⟩ = 3 − 3i + 2i = 3 − i⟨v, u⟩ = (3)(1 + i) + (−i)(2)the conjugates of the components of v times the components of u⟨v, u⟩ = 3 + 3i − 2i = 3 + i

The order matters. Exchanging the two vectors gives the complex conjugate.

Rules

  • ⟨v, u⟩ = ⟨u, v⟩*.
  • ⟨u, v + w⟩ = ⟨u, v⟩ + ⟨u, w⟩, and the same is true for a sum in the first place.
  • A scalar in the second place comes out unchanged: ⟨u, cv⟩ = c⟨u, v⟩.
  • A scalar in the first place comes out as its conjugate: ⟨cu, v⟩ = c*⟨u, v⟩.
  • ⟨v, v⟩ is real and not negative, and it is zero only for the zero vector.

4. The Conjugate Transpose

The conjugate transpose of a matrix A is found in two steps: take the transpose, and replace each entry with its complex conjugate. It is written A†, which is read as A dagger. It is also called the Hermitian conjugate or the adjoint of A. Many mathematics books write Aᴴ or A*.

A = 1i23 − i A† = 12−i3 + i

For a column vector u, the conjugate transpose u† is a row that holds the conjugates of the components. The inner product is then a row times a column.

⟨u, v⟩ = u†v

Rules

  • (A†)† = A.
  • (A + B)† = A† + B† and (cA)† = c* A†.
  • (AB)† = B†A†. The order is reversed, as for the transpose.
  • ⟨Au, v⟩ = ⟨u, A†v⟩. A matrix moves across the inner product as its conjugate transpose.

The last rule is the complex version of the rule of Topic 3.3, which moved a real matrix across the dot product as its transpose. For a matrix with real entries, the conjugate transpose is the transpose.

5. Orthogonal Vectors and Orthonormal Bases

Two complex vectors are called orthogonal when their inner product is zero. A set of vectors is orthonormal when the vectors are orthogonal to each other and each has the length 1.

q₁ = 1/√2 1i q₂ = 1/√2 1−i ⟨q₁, q₂⟩ = (1/2)((1)(1) + (−i)(−i))the conjugates of the components of q₁ times the components of q₂⟨q₁, q₂⟩ = (1/2)(1 + i²)multiply⟨q₁, q₂⟩ = 0because i² = −1

Each of the two vectors has the squared length (1/2)(1 + 1) = 1. They are an orthonormal basis of C².

Components in an orthonormal basis

As in Topic 6.2, the components of a vector in an orthonormal basis are inner products. The basis vector goes in the first place.

v = c₁q₁ + c₂q₂ + … with ci = ⟨qi, v⟩

For v = (0, 1) and the basis above:

c₁ = ⟨q₁, v⟩ = (−i)(1)/√2 = −i/√2the first coordinatec₂ = ⟨q₂, v⟩ = (i)(1)/√2 = i/√2the second coordinate(−i)(i)/2 + (i)(−i)/2 = 1/2 + 1/2 = 1the check: the second component of c₁q₁ + c₂q₂

The squared length of a vector is the sum of the squared absolute values of its components in any orthonormal basis.

|v|² = |c₁|² + |c₂|² + …

In the example, 1/2 + 1/2 = 1.

In quantum mechanics, a state is a complex vector of length 1. The numbers ci are the amplitudes of the possible results of a measurement, and |ci|² is the probability of result i. The equation above says that the probabilities add up to 1. Topic 9.3 develops this.

The Gram-Schmidt process of Topic 6.2 works in Cⁿ with one change: each dot product is replaced by the inner product, with the vector that is already in the orthonormal set in the first place.

6. Phase Factors

Multiply a vector v by a number eiθ of absolute value 1. Each component turns by the angle θ in the complex plane, and no absolute value changes. The length of the vector stays the same.

For the inner product, the rules of Part 3 give ⟨u, eiθv⟩ = eiθ⟨u, v⟩. The inner product is multiplied by the phase factor, so its absolute value stays the same. Two vectors that are orthogonal stay orthogonal.

Try it: the length of a complex vector

The vector v has two complex components. Drag v₁ and v₂ in the complex plane. The readout compares the sum of the squares, which is not a length, with the sum of the squared absolute values. The slider multiplies both components by eiθ. The dashed arrows show the result.

Common Mistakes

  • Calculating a length or an inner product without the conjugates. The vector (1, i) would get the length 0.
  • Putting the conjugates on the second vector while following a formula of this course. The result is the conjugate of the correct answer.
  • Assuming that ⟨u, v⟩ = ⟨v, u⟩. The two are conjugates of each other.
  • Taking the transpose without the conjugates, or the conjugates without the transpose, when A† is needed.
  • Pulling a scalar out of the first place of an inner product without conjugating it.
  • Finding a component as ⟨v, q⟩. The basis vector belongs in the first place.

Summary

FactStatement
Squared length|v|² = |v₁|² + … + |vₙ|²
Inner product⟨u, v⟩ = u₁* v₁ + … + uₙ* vₙ = u†v
Exchange of the vectors⟨v, u⟩ = ⟨u, v⟩*
Scalars⟨u, cv⟩ = c⟨u, v⟩ and ⟨cu, v⟩ = c*⟨u, v⟩
Conjugate transposeA†: transpose, and conjugate each entry. (AB)† = B†A†
Moving a matrix⟨Au, v⟩ = ⟨u, A†v⟩
Componentsci = ⟨qi, v⟩ in an orthonormal basis

Practice

Work each problem on paper first. Then open the answer to check your work.

1. Find the lengths of (3, 4i) and (1 + i, 1 − i).

|(3, 4i)|² = 9 + 16 = 25add the squared absolute values of the components|(3, 4i)| = 5|(1 + i, 1 − i)|² = 2 + 2 = 4each component has the squared absolute value 2|(1 + i, 1 − i)| = 2

2. For u = (i, 1) and v = (2, 1 + i), find ⟨u, v⟩ and ⟨v, u⟩.

⟨u, v⟩ = (−i)(2) + (1)(1 + i)the conjugates of the components of u times the components of v⟨u, v⟩ = −2i + 1 + i = 1 − i⟨v, u⟩ = 1 + ithe conjugate

3. Is (1, i) orthogonal to (1, −i)? Is it orthogonal to (i, −1)?

⟨(1, i), (1, −i)⟩ = (1)(1) + (−i)(−i) = 1 − 1 = 0the first pair is orthogonal⟨(1, i), (i, −1)⟩ = (1)(i) + (−i)(−1) = 2ithe second pair is not orthogonal

In fact (i, −1) is i times (1, i).

4. Find the unit vector in the direction of (1, 1 + i).

squared length = 1 + 2 = 3length = √3unit vector = (1/√3)(1, 1 + i)

5. Find the conjugate transpose of 21 + i3i4.

Exchange rows and columns, and conjugate each entry: 2−3i1 − i4.

6. Find the components of v = (2, 0) in the orthonormal basis q₁, q₂ of Part 5.

c₁ = ⟨q₁, v⟩ = (1)(2)/√2 = √2c₂ = ⟨q₂, v⟩ = √2|c₁|² + |c₂|² = 2 + 2 = 4the check: this is |v|²

Python Practice

Step 1. A complex vector and its length

A complex vector is typed with np.array, as before, with the components written with j. The code below shows the mistake of Part 2 first. The expression v @ v adds the squares of the components, with no conjugates. The instruction np.linalg.norm calculates the correct length.

Python

The first result is 0, which is not a length. The second result is 1.414, which is √2.

Now find the length of the vector (3, 4i) of Practice Problem 1.

Python

Step 2. The inner product

The instruction np.vdot(u, v) calculates the inner product. It takes the conjugates of the first vector, which is the convention of this course.

Python

The result is 3 − i, as in Part 3. Now calculate the inner product with the two vectors in the other order, and store it under the name p.

Python

Step 3. The conjugate transpose

For a matrix A, the expression A.conj() takes the conjugate of each entry, and .T takes the transpose. Together, A.conj().T is the conjugate transpose.

Python

The result is the matrix of Part 4. The next box checks the rule that moves a matrix across the inner product. The two printed numbers should be equal.

Python

Both results are 3 − i.

Step 4. Components in an orthonormal basis

The code below uses the orthonormal basis of Part 5. It calculates the components of v as inner products, with the basis vector in the first place, and then builds the vector again from its components.

Python

Both components are 1.414, which is √2, as in Practice Problem 6. The last line gives the vector (2, 0) back. Now find the components of the vector (0, 1).

Python

The components are −i/√2 and i/√2, as in Part 5.

Step 5. A phase factor

The code below multiplies a vector by eiθ with θ = 1.2 radians. It prints the length before and after, and the absolute value of an inner product before and after.

Python

The length is 3.162 both times, and the absolute value of the inner product is 7 both times. A phase factor changes neither one. Change 1.2 to any other real number and run the code again to check.

Quiz

This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.

Choose how your answers are checked

1. Find the length of the complex vector (2i, 1, 2).

2. Let u = (1, i) and v = (2, 3). Find the inner product ⟨u, v⟩.

3. u and v are complex vectors. Which number is equal to ⟨v, u⟩?

4. Which vector is orthogonal to (1, i) in the complex inner product?

5. Let A = 21 + i3i4. Find the entry of A† in row 1, column 2.

Next: Topic 8.3, Hermitian Matrices