Tutorials › Linear Algebra › Coordinates in Matrix Spaces

Coordinates and Change of Basis · Tutorial 391 of 1000

Coordinates in Matrix Spaces

Find and interpret matrix coordinates by matching entries to an ordered basis, then reconstruct the original matrix from its coordinate vector.

Intermediate 10 min read

What You'll Learn

  • Define the matrix space of real matrices of a fixed size and its standard matrix-unit basis.
  • Write coordinates in the specified order of an ordered basis.
  • Convert a matrix to coordinates in the standard matrix-unit basis.
  • Find coordinates in other matrix-space bases by matching entries.
  • Reconstruct a matrix and check that its entries agree with the original.

Matrices as Vectors

A matrix is not only an arrangement of numbers on which we perform matrix operations. Once its size is fixed, it is also a vector in a vector space: matrices of that size can be added entry by entry and multiplied by real scalars. This lets us ask familiar coordinate questions. Given an ordered basis of matrices, what numbers represent a particular matrix, and how do those numbers reconstruct it?

Throughout this tutorial, scalars are real. For positive integers \(m\) and \(n\), the set \(\mathbb{R}^{m\times n}\) of all \(m\times n\) real matrices is a vector space with entrywise addition and scalar multiplication. Its zero vector is the zero matrix \(\mathbf{O}\). A basis of this space is an ordered list of matrices that is linearly independent and spans the whole space. The order matters: it determines the order of the entries in every coordinate vector.

Definition: If \(\mathcal{B}=(\mathbf{B}_1,\dots,\mathbf{B}_p)\) is an ordered basis of a matrix space, the coordinates of a matrix \(\mathbf{A}\) relative to \(\mathcal{B}\) are the unique scalars \(c_1,\dots,c_p\) such that \(\mathbf{A}=c_1\mathbf{B}_1+\cdots+c_p\mathbf{B}_p\). The coordinate vector is the column \([\mathbf{A}]_{\mathcal{B}}=(c_1,\dots,c_p)^{\top}\).

The definition makes coordinates depend on the chosen basis, not just on the matrix itself. A coordinate vector is therefore meaningful only together with its ordered basis. To reconstruct the matrix, multiply each basis matrix by its corresponding coordinate and add the results.

Theorem (Coordinate reconstruction): If \(\mathcal{B}=(\mathbf{B}_1,\dots,\mathbf{B}_p)\) is a basis of a vector space of matrices, then every matrix \(\mathbf{A}\) in that space has exactly one coordinate vector \([\mathbf{A}]_{\mathcal{B}}\), and \(\mathbf{A}=\sum_{k=1}^{p}c_k\mathbf{B}_k\) when \([\mathbf{A}]_{\mathcal{B}}=(c_1,\dots,c_p)^{\top}\).

Proof. Because \(\mathcal{B}\) spans the space, \(\mathbf{A}\) is a linear combination of its members, so at least one list of coefficients \(c_1,\dots,c_p\) reconstructs \(\mathbf{A}\). Suppose another list \(d_1,\dots,d_p\) also reconstructs it. Subtracting the two expressions gives \(\sum_{k=1}^{p}(c_k-d_k)\mathbf{B}_k=\mathbf{O}\). Since the basis is linearly independent, every coefficient \(c_k-d_k\) is zero. Thus \(c_k=d_k\) for all \(k\), proving uniqueness; the reconstruction equation is the expression whose coefficients define the coordinate vector. \(\square\)

The Standard Matrix-Unit Basis

For each row index \(i\) and column index \(j\), let \(\mathbf{E}_{ij}\) be the \(m\times n\) matrix with a \(1\) in row \(i\), column \(j\), and zeros elsewhere. Fix the row-by-row order \(\mathcal{E}=(\mathbf{E}_{11},\dots,\mathbf{E}_{1n},\mathbf{E}_{21},\dots,\mathbf{E}_{mn})\): move across each row from left to right, then continue down to the next row. For example, the order for \(2\times3\) matrices is \((\mathbf{E}_{11},\mathbf{E}_{12},\mathbf{E}_{13},\mathbf{E}_{21},\mathbf{E}_{22},\mathbf{E}_{23})\).

Theorem: The ordered list of all \(mn\) matrix units in row-by-row order is a basis of \(\mathbb{R}^{m\times n}\). If \(\mathbf{A}=[a_{ij}]\), then its coordinate vector in this basis lists the entries of \(\mathbf{A}\) row by row.

Proof. First, any \(\mathbf{A}=[a_{ij}]\) can be written as \(\sum_{i=1}^{m}\sum_{j=1}^{n}a_{ij}\mathbf{E}_{ij}\), because the summand \(a_{ij}\mathbf{E}_{ij}\) places \(a_{ij}\) in position \((i,j)\) and zero in every other position. Adding all these summands gives exactly \(\mathbf{A}\), so the matrix units span the space. Next, suppose \(\sum_{i=1}^{m}\sum_{j=1}^{n}c_{ij}\mathbf{E}_{ij}=\mathbf{O}\). The entry in position \((i,j)\) on the left is \(c_{ij}\), while that entry on the right is \(0\). Thus \(c_{ij}=0\) for every pair \((i,j)\), proving linear independence. Hence the list is a basis. In this basis, the coefficient of \(\mathbf{E}_{ij}\) is precisely \(a_{ij}\), so following the stated order gives the entries row by row. \(\square\)

Worked Example: Coordinates in the Standard Basis

Find the coordinates of \(\mathbf{A}=\begin{bmatrix}2&-1&0\\3&4&5\end{bmatrix}\) in the row-by-row matrix-unit basis of \(\mathbb{R}^{2\times3}\), then reconstruct \(\mathbf{A}\).

The ordered basis is \((\mathbf{E}_{11},\mathbf{E}_{12},\mathbf{E}_{13},\mathbf{E}_{21},\mathbf{E}_{22},\mathbf{E}_{23})\). Matching each entry of \(\mathbf{A}\) to its corresponding matrix unit gives

$$ \mathbf{A} =2\mathbf{E}_{11}-\mathbf{E}_{12}+0\mathbf{E}_{13} +3\mathbf{E}_{21}+4\mathbf{E}_{22}+5\mathbf{E}_{23}. $$

Therefore the coordinate vector, with one entry for each basis matrix in order, is

$$ [\mathbf{A}]_{\mathcal{E}} = \begin{bmatrix} 2\\-1\\0\\3\\4\\5 \end{bmatrix}. $$

Check: placing these coefficients back at their matrix-unit positions gives the first row \((2,-1,0)\) and the second row \((3,4,5)\), so the reconstructed matrix is \(\begin{bmatrix}2&-1&0\\3&4&5\end{bmatrix}=\mathbf{A}\).

Coordinates in a Different Ordered Basis

For a basis other than the matrix-unit basis, the coordinates are still the coefficients in a linear combination, but they no longer need to equal the entries of the matrix. A direct method is to write an unknown linear combination of the basis matrices and match its entries with the target matrix. The matching equations must be read using the basis matrices in their given order.

Worked Example: A Diagonal-and-Off-Diagonal Basis

Consider the ordered list in \(\mathbb{R}^{2\times2}\)

$$ \mathcal{B}= \left( \begin{bmatrix}1&0\\0&1\end{bmatrix}, \begin{bmatrix}1&0\\0&-1\end{bmatrix}, \begin{bmatrix}0&1\\0&0\end{bmatrix}, \begin{bmatrix}0&0\\1&0\end{bmatrix} \right). $$

Find the coordinates of \(\mathbf{A}=\begin{bmatrix}4&5\\-2&0\end{bmatrix}\) relative to this basis.

Write the unknown coefficients as \(x,y,z,w\), in the displayed basis order. The proposed representation is

$$ x\begin{bmatrix}1&0\\0&1\end{bmatrix} +y\begin{bmatrix}1&0\\0&-1\end{bmatrix} +z\begin{bmatrix}0&1\\0&0\end{bmatrix} +w\begin{bmatrix}0&0\\1&0\end{bmatrix} = \begin{bmatrix}x+y&z\\w&x-y\end{bmatrix}. $$

Matching the four entries to \(\mathbf{A}\) gives \(x+y=4\), \(z=5\), \(w=-2\), and \(x-y=0\). Adding the first and fourth equations gives \(2x=4\), so \(x=2\); then \(y=4-x=2\). The other equations give \(z=5\) and \(w=-2\). In the specified order,

$$ [\mathbf{A}]_{\mathcal{B}} = \begin{bmatrix}2\\2\\5\\-2\end{bmatrix}. $$

Check: adding the scaled basis matrices gives \(2\begin{bmatrix}1&0\\0&1\end{bmatrix} +2\begin{bmatrix}1&0\\0&-1\end{bmatrix} +5\begin{bmatrix}0&1\\0&0\end{bmatrix} -2\begin{bmatrix}0&0\\1&0\end{bmatrix} =\begin{bmatrix}4&5\\-2&0\end{bmatrix}\). The original matrix is recovered exactly.

The same entry-matching equations show why the displayed list is indeed a basis, rather than merely a list that happens to represent this one matrix. For any \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\), the equations are \(x+y=a\), \(z=b\), \(w=c\), \(x-y=d\), with the unique solution \(x=(a+d)/2\), \(y=(a-d)/2\), \(z=b\), \(w=c\). Thus the list spans every \(2\times2\) matrix. The unique solution for each target also shows that a linear combination equalling the zero matrix has only zero coefficients, so the list is linearly independent.

Entry Matching with a Reordered, Combined Basis

A basis matrix can have several nonzero entries, so one coordinate can affect several positions of the reconstructed matrix. This is not a complication in the definition; it is a reason to calculate the entire linear combination before reading off coefficients. The next example has basis matrices that overlap in the first row and in the second row.

Worked Example: Coordinates in a Combined Basis

Use the ordered list \(\mathcal{C}=(\mathbf{C}_1,\mathbf{C}_2,\mathbf{C}_3,\mathbf{C}_4)\) in \(\mathbb{R}^{2\times2}\), where

$$ \mathbf{C}_1=\begin{bmatrix}1&1\\0&0\end{bmatrix},\quad \mathbf{C}_2=\begin{bmatrix}0&1\\0&0\end{bmatrix},\quad \mathbf{C}_3=\begin{bmatrix}0&0\\1&1\end{bmatrix},\quad \mathbf{C}_4=\begin{bmatrix}0&0\\0&1\end{bmatrix}. $$

Find the coordinates of \(\mathbf{M}=\begin{bmatrix}2&5\\-1&3\end{bmatrix}\). For coefficients \(x,y,z,w\), in order, the combination is

$$ x\mathbf{C}_1+y\mathbf{C}_2+z\mathbf{C}_3+w\mathbf{C}_4 = \begin{bmatrix}x&x+y\\z&z+w\end{bmatrix}. $$

Matching entries gives \(x=2\), \(x+y=5\), \(z=-1\), and \(z+w=3\). Therefore \(y=5-2=3\), \(w=3-(-1)=4\), and

$$ [\mathbf{M}]_{\mathcal{C}} = \begin{bmatrix}2\\3\\-1\\4\end{bmatrix}. $$

Check: \(2\mathbf{C}_1=\begin{bmatrix}2&2\\0&0\end{bmatrix}\), \(3\mathbf{C}_2=\begin{bmatrix}0&3\\0&0\end{bmatrix}\), \(-\mathbf{C}_3=\begin{bmatrix}0&0\\-1&-1\end{bmatrix}\), and \(4\mathbf{C}_4=\begin{bmatrix}0&0\\0&4\end{bmatrix}\). Their sum is \(\begin{bmatrix}2&5\\-1&3\end{bmatrix}=\mathbf{M}\).

The entry formulas also verify that \(\mathcal{C}\) is a basis: for any \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\), they have the unique solution \(x=a\), \(y=b-a\), \(z=c\), \(w=d-c\). Hence every matrix is represented, and the representation is unique.

Reconstruction and a Common Ordering Pitfall

Coordinates are useful only if they preserve the chosen order. In the standard matrix-unit basis, the convention here is row by row. In another basis, the first coordinate always multiplies the first listed matrix, the second coordinate multiplies the second listed matrix, and so on. If a basis is reordered, the coordinate vector must be reordered with it; the matrix represented by a list of numbers can change when the basis order changes.

Common mistake: silently switching to column-by-column order. For \(\mathbf{A}=\begin{bmatrix}1&2\\3&4\end{bmatrix}\), the row-by-row coordinate vector is \(\begin{bmatrix}1&2&3&4\end{bmatrix}^{\top}\), corresponding to \((\mathbf{E}_{11},\mathbf{E}_{12},\mathbf{E}_{21},\mathbf{E}_{22})\). A wrong calculation lists the entries column by column and reports \(\begin{bmatrix}1&3&2&4\end{bmatrix}^{\top}\) while keeping that same basis order. Reconstructing with those coefficients gives \(\begin{bmatrix}1&3\\2&4\end{bmatrix}\), not the original matrix. The correction is to match each coefficient to the stated basis order: use \(\begin{bmatrix}1&2&3&4\end{bmatrix}^{\top}\). Column-by-column listing can also be used, but only if the basis is explicitly ordered column by column as well.

For an unfamiliar ordered basis, a reliable check is to take the proposed coordinate vector, multiply its entries by the basis matrices in order, and add entry by entry. If the result is not the target matrix, either a coefficient or the basis order has been mishandled. For the standard basis, this check reduces to placing each coordinate back in its designated matrix position.

Check Your Understanding

Use the specified basis order in each question, and verify coordinates by reconstructing the matrix.

  1. Write the row-by-row standard matrix-unit coordinate vector of \(\begin{bmatrix}0&-2\\5&1\end{bmatrix}\) in \(\mathbb{R}^{2\times2}\).
  2. In the basis from the diagonal-and-off-diagonal example, find the coordinates of \(\begin{bmatrix}3&-1\\4&2\end{bmatrix}\).
  3. For the ordered basis \((\mathbf{C}_1,\mathbf{C}_2,\mathbf{C}_3,\mathbf{C}_4)\) in the combined-basis example, write the matrix represented by \(\begin{bmatrix}1&2&0&3\end{bmatrix}^{\top}\).
  4. Explain why knowing the list of coordinate entries without knowing the ordered basis may not determine a unique matrix.
  5. For any matrix \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\), find its coordinates in the diagonal-and-off-diagonal basis and check the reconstruction.

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