Tutorials › Linear Algebra › Complex Vectors And Matrix Operations

Complex Eigenvalues and Complex Scalars · Tutorial 548 of 1000

Complex Vectors And Matrix Operations

Learn to carry out vector and matrix operations over the complex numbers while keeping dimensions, arithmetic, and scalar choices explicit.

Intermediate 11 min read

What You'll Learn

  • Add complex vectors and multiply them by real or complex scalars.
  • Compute a matrix-vector product over the complex numbers.
  • Compute matrix products entry by entry and check their dimensions.
  • Distinguish multiplication by a real scalar from multiplication by a complex scalar.
  • Verify matrix-product order and associativity using explicit calculations.

Complex Coordinates and Scalar Choices

When real matrices are used with complex eigenvalues and eigenvectors, the same matrix operations must be carried out with complex entries. The procedures are familiar, but every scalar multiplication and addition now uses complex arithmetic. It is also important to say which scalars are allowed: a complex vector can be scaled by a real number, but it can also be scaled by any complex number.

Write \(\mathbb{C}^n\) for the set of columns with \(n\) complex entries. If \(\mathbf{u},\mathbf{v}\in\mathbb{C}^n\), their sum is formed coordinate by coordinate. For \(\alpha\in\mathbb{C}\), the scalar multiple \(\alpha\mathbf{u}\) is formed by multiplying every coordinate by \(\alpha\). These operations also make sense when \(\alpha\in\mathbb{R}\), since every real number is a complex number. In particular, \(\mathbb{C}^n\) can be considered using either real or complex scalars; which scalar field is intended depends on the question.

Definition: For \(\mathbf{u}=(u_1,\dots,u_n)^{\top}\) and \(\mathbf{v}=(v_1,\dots,v_n)^{\top}\) in \(\mathbb{C}^n\), and \(\alpha\in\mathbb{C}\), define \(\mathbf{u}+\mathbf{v}=(u_1+v_1,\dots,u_n+v_n)^{\top}\) and \(\alpha\mathbf{u}=(\alpha u_1,\dots,\alpha u_n)^{\top}\). If the allowed scalars are restricted to \(\mathbb{R}\), then \(\alpha\) must be real. The zero vector has every coordinate equal to \(0\).

All vector-operation identities follow coordinate by coordinate from the corresponding rules of complex arithmetic. For example, the \(j\)-th coordinate of \(\alpha(\mathbf{u}+\mathbf{v})\) is \(\alpha(u_j+v_j)=\alpha u_j+\alpha v_j\), which is the \(j\)-th coordinate of \(\alpha\mathbf{u}+\alpha\mathbf{v}\). The same reasoning applies to real scalars, which obey the same arithmetic rules within \(\mathbb{C}\).

Worked Example: Adding and Scaling Complex Vectors

Let \(\mathbf{u}=(1+i,\,2-i)^{\top}\) and \(\mathbf{v}=(2-i,\,-1+3i)^{\top}\). Find \(\mathbf{u}+\mathbf{v}\), \((2-i)\mathbf{u}\), and \(2\mathbf{u}\). The last two calculations compare a complex scalar with a real scalar.

Add the corresponding coordinates:

$$ \mathbf{u}+\mathbf{v} = \begin{bmatrix} (1+i)+(2-i)\\ (2-i)+(-1+3i) \end{bmatrix} = \begin{bmatrix} 3\\ 1+2i \end{bmatrix}. $$

For the complex scalar multiple, distribute \(2-i\) across each coordinate and use \(i^2=-1\):

$$ (2-i)\mathbf{u} = \begin{bmatrix} (2-i)(1+i)\\ (2-i)(2-i) \end{bmatrix} = \begin{bmatrix} 2+2i-i-i^2\\ 4-2i-2i+i^2 \end{bmatrix} = \begin{bmatrix} 3+i\\ 3-4i \end{bmatrix}. $$

By contrast, scaling by the real number \(2\) gives

$$ 2\mathbf{u} = \begin{bmatrix} 2(1+i)\\ 2(2-i) \end{bmatrix} = \begin{bmatrix} 2+2i\\ 4-2i \end{bmatrix}. $$

Check: Adding \(\mathbf{u}\) and \(\mathbf{v}\) again by real and imaginary parts gives first coordinate \(3+0i\) and second coordinate \(1+2i\), as above. Also, \((2-i)(1+i)=2+i- i^2=3+i\), and \((2-i)^2=4-4i+i^2=3-4i\). The complex and real scalar multiples differ because the scalar \(2-i\) is not \(2\).

Matrix-Vector Products Over \(\mathbb{C}\)

A matrix \(\mathbf{A}\in\mathbb{C}^{m\times n}\) can multiply a vector \(\mathbf{x}\in\mathbb{C}^n\). The result is a vector in \(\mathbb{C}^m\): each output coordinate is the product of one row of \(\mathbf{A}\) with the column \(\mathbf{x}\). The number of columns of the matrix must equal the number of entries in the vector.

Definition: If \(\mathbf{A}=(a_{ij})\in\mathbb{C}^{m\times n}\) and \(\mathbf{x}=(x_1,\dots,x_n)^{\top}\in\mathbb{C}^n\), then \(\mathbf{A}\mathbf{x}\in\mathbb{C}^m\) is defined by \((\mathbf{A}\mathbf{x})_i=\sum_{j=1}^{n}a_{ij}x_j\) for each \(i=1,\dots,m\). All products and sums in this formula are in \(\mathbb{C}\).

The definition is the same as for real matrices and vectors, except that entries and intermediate values may be complex. A useful consequence is that a real matrix can act on a complex vector: its entries are also complex numbers, so the same row-by-column formula applies. The output need not be real.

Worked Example: A Complex Matrix Acting on a Complex Vector

Compute \(\mathbf{A}\mathbf{x}\) for \(\mathbf{A}=\begin{bmatrix}1&i\\2&1-i\end{bmatrix}\) and \(\mathbf{x}=(1,i)^{\top}\). The matrix has two columns and the vector has two entries, so the product is defined.

Compute each row-column product separately:

$$ \mathbf{A}\mathbf{x} = \begin{bmatrix} 1(1)+i(i)\\ 2(1)+(1-i)i \end{bmatrix} = \begin{bmatrix} 1-1\\ 2+i-i^2 \end{bmatrix} = \begin{bmatrix} 0\\ 3+i \end{bmatrix}. $$

Check: The first row gives \(1\cdot1+i\cdot i=1-1=0\). The second gives \(2\cdot1+(1-i)i=2+i+1=3+i\). Both coordinates agree with the result.

For comparison, consider the real matrix \(\mathbf{R}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\) acting on \(\mathbf{x}\). Its entries are real, but the vector is not. Direct multiplication gives

$$ \mathbf{R}\mathbf{x} = \begin{bmatrix} 1+2i\\ i \end{bmatrix}. $$

The complex output is expected: real entries do not turn a complex input vector into a real one.

Matrix-vector multiplication respects addition and scalar multiplication. This is a consequence of the distributive and associative laws in \(\mathbb{C}\), applied to each row.

Theorem: Let \(\mathbf{A}\in\mathbb{C}^{m\times n}\), let \(\mathbf{x},\mathbf{y}\in\mathbb{C}^n\), and let \(\alpha\in\mathbb{C}\). Then \(\mathbf{A}(\mathbf{x}+\mathbf{y})=\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}\) and \(\mathbf{A}(\alpha\mathbf{x})=\alpha(\mathbf{A}\mathbf{x})\).

Proof. For each row index \(i\), the \(i\)-th coordinate of the first left-hand side is \(\sum_{j=1}^{n}a_{ij}(x_j+y_j)\). Distributing each product gives \(\sum_{j=1}^{n}a_{ij}x_j+\sum_{j=1}^{n}a_{ij}y_j\), which is the \(i\)-th coordinate of \(\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}\). For the second identity, the \(i\)-th coordinate of \(\mathbf{A}(\alpha\mathbf{x})\) is \(\sum_{j=1}^{n}a_{ij}(\alpha x_j)\). Since complex multiplication is associative and commutative, this equals \(\alpha\sum_{j=1}^{n}a_{ij}x_j\), the \(i\)-th coordinate of \(\alpha(\mathbf{A}\mathbf{x})\). The coordinates agree for every \(i\), proving both vector identities. \(\square\)

Matrix Products and Their Order

If \(\mathbf{A}\in\mathbb{C}^{m\times n}\) and \(\mathbf{B}\in\mathbb{C}^{n\times p}\), the product \(\mathbf{A}\mathbf{B}\) is defined and has size \(m\times p\). Its entry in row \(i\), column \(j\) is the product of row \(i\) of \(\mathbf{A}\) with column \(j\) of \(\mathbf{B}\): \((\mathbf{A}\mathbf{B})_{ij}=\sum_{k=1}^{n}a_{ik}b_{kj}\). As with matrix-vector multiplication, all sums and products are taken in \(\mathbb{C}\). In general, the reverse product \(\mathbf{B}\mathbf{A}\) may have a different size or may not be defined at all.

Worked Example: Multiplying Complex Matrices in Both Orders

Let \(\mathbf{A}=\begin{bmatrix}1&i\\2&1-i\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}1&1-i\\i&2\end{bmatrix}\). Both products are defined, and both are \(2\times2\). Compute them entry by entry.

For \(\mathbf{A}\mathbf{B}\), the four row-column products are

$$ \begin{aligned} (\mathbf{A}\mathbf{B})_{11}&=1+i\cdot i=0,\\ (\mathbf{A}\mathbf{B})_{12}&=(1-i)+2i=1+i,\\ (\mathbf{A}\mathbf{B})_{21}&=2+i(1-i)=3+i,\\ (\mathbf{A}\mathbf{B})_{22}&=2(1-i)+2(1-i)=4-4i. \end{aligned} $$

Therefore \(\mathbf{A}\mathbf{B}=\begin{bmatrix}0&1+i\\3+i&4-4i\end{bmatrix}\).

Now reverse the order. The entries of \(\mathbf{B}\mathbf{A}\) are

$$ \begin{aligned} (\mathbf{B}\mathbf{A})_{11}&=1+2(1-i)=3-2i,\\ (\mathbf{B}\mathbf{A})_{12}&=i+(1-i)^2=-i,\\ (\mathbf{B}\mathbf{A})_{21}&=i+4=4+i,\\ (\mathbf{B}\mathbf{A})_{22}&=i^2+2(1-i)=1-2i. \end{aligned} $$

Thus \(\mathbf{B}\mathbf{A}=\begin{bmatrix}3-2i&-i\\4+i&1-2i\end{bmatrix}\), which differs from \(\mathbf{A}\mathbf{B}\).

Check: In \(\mathbf{A}\mathbf{B}\), the lower-left entry is \(2+i(1-i)=2+i-i^2=3+i\), and the lower-right entry is \(2(1-i)+(1-i)2=4-4i\). In \(\mathbf{B}\mathbf{A}\), the first column is \(\begin{bmatrix}1+2(1-i)\\i+4\end{bmatrix}=\begin{bmatrix}3-2i\\4+i\end{bmatrix}\), matching the displayed product. The two products are not interchangeable.

Associativity and a Matrix-Vector Check

Although matrix multiplication is not generally commutative, it is associative whenever the products involved are defined. This matters when a matrix product acts on a vector: one may group the factors in either order, without changing the result.

Theorem: If \(\mathbf{A}\in\mathbb{C}^{m\times n}\), \(\mathbf{B}\in\mathbb{C}^{n\times p}\), and \(\mathbf{C}\in\mathbb{C}^{p\times q}\), then \((\mathbf{A}\mathbf{B})\mathbf{C}=\mathbf{A}(\mathbf{B}\mathbf{C})\).

Proof. Both products are \(m\times q\). For any \(i\in\{1,\dots,m\}\) and \(j\in\{1,\dots,q\}\), the \((i,j)\)-entry of the left-hand side is \(\sum_{k=1}^{p}(\mathbf{A}\mathbf{B})_{ik}c_{kj} =\sum_{k=1}^{p}\left(\sum_{\ell=1}^{n}a_{i\ell}b_{\ell k}\right)c_{kj}\). Distributing the finite sums and regrouping gives \(\sum_{\ell=1}^{n}a_{i\ell}\left(\sum_{k=1}^{p}b_{\ell k}c_{kj}\right)\), using the associative and distributive laws of complex arithmetic. The expression in parentheses is \((\mathbf{B}\mathbf{C})_{\ell j}\), so the result is \((\mathbf{A}(\mathbf{B}\mathbf{C}))_{ij}\). Every entry agrees, hence the matrices are equal. \(\square\)

Worked Example: Checking the Grouping of a Matrix-Vector Product

Use the matrices from the previous example and \(\mathbf{x}=(1,i)^{\top}\). Compute \(\mathbf{A}(\mathbf{B}\mathbf{x})\) and \((\mathbf{A}\mathbf{B})\mathbf{x}\) independently.

First compute the intermediate vector:

$$ \mathbf{B}\mathbf{x} = \begin{bmatrix} 1+(1-i)i\\ i+2i \end{bmatrix} = \begin{bmatrix} 2+i\\ 3i \end{bmatrix}. $$

Then multiply by \(\mathbf{A}\):

$$ \mathbf{A}(\mathbf{B}\mathbf{x}) = \begin{bmatrix} 1&i\\ 2&1-i \end{bmatrix} \begin{bmatrix} 2+i\\ 3i \end{bmatrix} = \begin{bmatrix} 2+i+3i^2\\ 4+2i+3i(1-i) \end{bmatrix} = \begin{bmatrix} -1+i\\ 7+5i \end{bmatrix}. $$

For the other grouping, use the product already computed:

$$ (\mathbf{A}\mathbf{B})\mathbf{x} = \begin{bmatrix} 0&1+i\\ 3+i&4-4i \end{bmatrix} \begin{bmatrix} 1\\i \end{bmatrix} = \begin{bmatrix} (1+i)i\\ 3+i+(4-4i)i \end{bmatrix} = \begin{bmatrix} -1+i\\ 7+5i \end{bmatrix}. $$

Check: In the first calculation, \(3i(1-i)=3+3i\), so the second coordinate is \(4+2i+3+3i=7+5i\). In the second, \((4-4i)i=4i-4i^2=4+4i\), so the second coordinate is \(3+i+4+4i=7+5i\). Both groupings give the same vector, as the associativity theorem requires.

Common Mistakes and a Reliable Routine

A frequent arithmetic error is treating \(i^2\) as \(i\) rather than \(-1\). For instance, a wrong first-coordinate calculation in the matrix-vector example would be \(1+i\cdot i=1+i\), giving a nonzero result. The correction is \(i\cdot i=i^2=-1\), so \(1+i\cdot i=1-1=0\). When a product contains several complex terms, writing out \(i^2=-1\) before simplifying helps prevent a sign error.

Another mistake is to assume that matrix products commute because the entries are numbers. The entries do use commutative complex arithmetic, but the row-column arrangement changes when the matrix order changes. In the worked example, \((\mathbf{A}\mathbf{B})_{11}=0\), whereas \((\mathbf{B}\mathbf{A})_{11}=3-2i\). The products are therefore different. Before calculating, check the dimensions and the order; then compute each entry from the row of the left matrix and the column of the right matrix.

For any calculation over \(\mathbb{C}\), a dependable sequence is to check dimensions, write each coordinate or entry as a row-column product, carry out complex arithmetic, and finally substitute or recompute enough entries to catch sign errors. Keep the scalar field in view as well: multiplying by \(2\) and by \(2-i\) are different operations, even when both are applied to the same vector.

Check Your Understanding

For each question, show the complex arithmetic and check the dimensions before multiplying.

  1. For \(\mathbf{u}=(2+i,\,-i)^{\top}\) and \(\mathbf{v}=(1-2i,\,3+i)^{\top}\), compute \(\mathbf{u}+\mathbf{v}\) and \((1+i)\mathbf{u}\).
  2. Compute \(\begin{bmatrix}1&-i\\i&2\end{bmatrix}\begin{bmatrix}i\\1-i\end{bmatrix}\).
  3. For \(\mathbf{A}=\begin{bmatrix}1&i\\0&1\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}2&1\\i&0\end{bmatrix}\), compute \(\mathbf{A}\mathbf{B}\) and \(\mathbf{B}\mathbf{A}\). Are they equal?
  4. Explain why multiplying a real matrix by a complex vector can produce a vector with nonreal entries.
  5. State the dimension condition required for \(\mathbf{A}\mathbf{B}\) to be defined when \(\mathbf{A}\) has \(m\) rows and \(n\) columns.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon