Tutorials › Linear Algebra › Blockwise Changes of Basis for Block Matrices

Similarity and Change of Basis for Operators · Tutorial 479 of 1000

Blockwise Changes of Basis for Block Matrices

See how to change coordinates independently within diagonal blocks while preserving the block structure of an operator matrix.

Intermediate 10 min read

What You'll Learn

  • Interpret diagonal blocks as the matrices of an operator on separate invariant summands
  • Build one change-of-basis matrix from the changes chosen within each block
  • Compute the transformed blocks using the correct similarity direction
  • Verify a blockwise transformation by checking the equation \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\)
  • Recognize why a block-diagonal change of basis does not remove a nonzero off-diagonal block

Changing Coordinates One Block at a Time

A matrix may describe an operator acting separately on several parts of a vector space. If the basis lists the vectors for each part together, the matrix has diagonal blocks and zeros between them. A new basis for each part can then be chosen independently: the full basis change is assembled from those smaller changes, and the transformed operator matrix retains the same block structure. This lets us do a larger change-of-basis calculation through smaller ones without mixing the parts.

We work over \(\mathbb{R}\). Suppose a finite-dimensional vector space is written as a direct sum \(V=V_1\oplus\cdots\oplus V_k\). This means every \(\mathbf{v}\in V\) has a unique expression \(\mathbf{v}=\mathbf{v}_1+\cdots+\mathbf{v}_k\) with \(\mathbf{v}_i\in V_i\). Suppose \(T:V\to V\) maps each \(V_i\) into itself. In bases formed by listing a basis of \(V_1\), then a basis of \(V_2\), and so on, the matrix of \(T\) is block diagonal: each diagonal block records the action on one summand.

Definition: A block-diagonal matrix with specified diagonal blocks \(\mathbf{A}_1,\dots,\mathbf{A}_k\) is written \(\operatorname{diag}(\mathbf{A}_1,\dots,\mathbf{A}_k)\). It has \(\mathbf{A}_i\) in block position \((i,i)\), and a zero matrix in every off-diagonal block position. The block sizes must fit the chosen row and column partition.

For a single operator represented in an old basis and a new basis, the coordinate convention is important. Let \(\mathbf{P}\) have as its columns the new basis vectors written in old coordinates. If \(\mathbf{x}_{\mathrm{new}}\) is a coordinate column in the new basis, then its old-coordinate column is \(\mathbf{P}\mathbf{x}_{\mathrm{new}}\). Thus the old matrix \(\mathbf{A}\) sends it to \(\mathbf{A}\mathbf{P}\mathbf{x}_{\mathrm{new}}\). To express that result in new coordinates, multiply by \(\mathbf{P}^{-1}\). The new matrix is therefore \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), or equivalently it satisfies \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\).

The Blockwise Change-of-Basis Rule

Theorem: Let \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\dots,\mathbf{A}_k)\), where each \(\mathbf{A}_i\in\mathbb{R}^{n_i\times n_i}\). For each \(i\), let \(\mathbf{P}_i\in\mathbb{R}^{n_i\times n_i}\) be invertible, and set \(\mathbf{P}=\operatorname{diag}(\mathbf{P}_1,\dots,\mathbf{P}_k)\). Then \(\mathbf{P}\) is invertible and \[ \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \operatorname{diag}\bigl( \mathbf{P}_1^{-1}\mathbf{A}_1\mathbf{P}_1,\dots, \mathbf{P}_k^{-1}\mathbf{A}_k\mathbf{P}_k \bigr). \] In particular, changing basis separately within the diagonal blocks leaves the off-diagonal blocks zero.

Proof. Define \(\mathbf{Q}=\operatorname{diag}(\mathbf{P}_1^{-1},\dots,\mathbf{P}_k^{-1})\). In block multiplication, the \((i,j)\) block of \(\mathbf{Q}\mathbf{P}\) is \(\mathbf{P}_i^{-1}\mathbf{P}_i=\mathbf{I}_{n_i}\) when \(i=j\), and is the zero matrix when \(i\ne j\). Hence \(\mathbf{Q}\mathbf{P}=\mathbf{I}\). The same block multiplication gives \(\mathbf{P}\mathbf{Q}=\mathbf{I}\), so \(\mathbf{Q}=\mathbf{P}^{-1}\). Next, \(\mathbf{A}\mathbf{P}\) has diagonal block \(\mathbf{A}_i\mathbf{P}_i\) in position \((i,i)\) and zero blocks elsewhere. Multiplying on the left by \(\mathbf{Q}\) gives diagonal block \(\mathbf{P}_i^{-1}\mathbf{A}_i\mathbf{P}_i\) in position \((i,i)\) and zero blocks elsewhere. This is the stated formula. \(\square\)

The theorem uses the same ordering of summands in the old and new bases. Each \(\mathbf{P}_i\) acts only on coordinates belonging to \(V_i\). Its inverse converts the resulting coordinates back into that summand’s new coordinate system. The calculation within one block is exactly an ordinary similarity transformation; the block-diagonal arrangement ensures that these transformations do not interfere with one another.

Worked Example: Changing Both Two-Dimensional Blocks

Let \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\mathbf{A}_2)\), where \(\mathbf{A}_1=\begin{bmatrix}2&1\\0&3\end{bmatrix}\) and \(\mathbf{A}_2=\begin{bmatrix}1&0\\2&4\end{bmatrix}\). Use \(\mathbf{P}_1=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) and \(\mathbf{P}_2=\begin{bmatrix}1&0\\1&1\end{bmatrix}\) to find the new matrix.

The inverses are \(\mathbf{P}_1^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\) and \(\mathbf{P}_2^{-1}=\begin{bmatrix}1&0\\-1&1\end{bmatrix}\), as multiplication of each pair gives \(\mathbf{I}_2\). First compute the products on the right:

$$ \mathbf{A}_1\mathbf{P}_1 = \begin{bmatrix}2&1\\0&3\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} = \begin{bmatrix}2&3\\0&3\end{bmatrix}, \qquad \mathbf{A}_2\mathbf{P}_2 = \begin{bmatrix}1&0\\2&4\end{bmatrix} \begin{bmatrix}1&0\\1&1\end{bmatrix} = \begin{bmatrix}1&0\\6&4\end{bmatrix}. $$

Now multiply on the left by the corresponding inverses:

$$ \mathbf{P}_1^{-1}\mathbf{A}_1\mathbf{P}_1 = \begin{bmatrix}1&-1\\0&1\end{bmatrix} \begin{bmatrix}2&3\\0&3\end{bmatrix} = \begin{bmatrix}2&0\\0&3\end{bmatrix}, \qquad \mathbf{P}_2^{-1}\mathbf{A}_2\mathbf{P}_2 = \begin{bmatrix}1&0\\-1&1\end{bmatrix} \begin{bmatrix}1&0\\6&4\end{bmatrix} = \begin{bmatrix}1&0\\5&4\end{bmatrix}. $$

Therefore \(\mathbf{P}=\operatorname{diag}(\mathbf{P}_1,\mathbf{P}_2)\) and \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) are

$$ \mathbf{P}= \begin{bmatrix} 1&1&0&0\\ 0&1&0&0\\ 0&0&1&0\\ 0&0&1&1 \end{bmatrix}, \qquad \mathbf{B}= \begin{bmatrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&1&0\\ 0&0&5&4 \end{bmatrix}. $$

Check: the two diagonal blocks of \(\mathbf{A}\mathbf{P}\) are \(\begin{bmatrix}2&3\\0&3\end{bmatrix}\) and \(\begin{bmatrix}1&0\\6&4\end{bmatrix}\). The corresponding blocks of \(\mathbf{P}\mathbf{B}\) are \(\mathbf{P}_1\begin{bmatrix}2&0\\0&3\end{bmatrix}=\begin{bmatrix}2&3\\0&3\end{bmatrix}\) and \(\mathbf{P}_2\begin{bmatrix}1&0\\5&4\end{bmatrix}=\begin{bmatrix}1&0\\6&4\end{bmatrix}\). All off-diagonal blocks are zero in both products, so \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\), verifying the transformation.

Different Block Sizes, Independent Choices

The theorem does not require all blocks to have the same size. A one-dimensional summand can be left unchanged while a larger summand gets a nontrivial basis change. The only requirement is that each \(\mathbf{P}_i\) be square and invertible with the size matching its block.

Worked Example: One Scalar Block and One Two-Dimensional Block

Take \(\mathbf{A}=\operatorname{diag}(7,\mathbf{A}_2)\), where \(\mathbf{A}_2=\begin{bmatrix}2&0\\0&5\end{bmatrix}\). Keep the first block fixed with \(\mathbf{P}_1=[1]\), and take \(\mathbf{P}_2=\begin{bmatrix}1&1\\0&1\end{bmatrix}\).

Here \(\mathbf{P}_2^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). The block computation is

$$ \mathbf{A}_2\mathbf{P}_2 = \begin{bmatrix}2&0\\0&5\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} = \begin{bmatrix}2&2\\0&5\end{bmatrix}, \qquad \mathbf{P}_2^{-1}\mathbf{A}_2\mathbf{P}_2 = \begin{bmatrix}1&-1\\0&1\end{bmatrix} \begin{bmatrix}2&2\\0&5\end{bmatrix} = \begin{bmatrix}2&-3\\0&5\end{bmatrix}. $$

The assembled matrices are \(\mathbf{P}=\begin{bmatrix}1&0&0\\0&1&1\\0&0&1\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}7&0&0\\0&2&-3\\0&0&5\end{bmatrix}\). To check the result,

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}7&0&0\\0&2&2\\0&0&5\end{bmatrix}, \qquad \mathbf{P}\mathbf{B} = \begin{bmatrix}7&0&0\\0&2&2\\0&0&5\end{bmatrix}. $$

Thus \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\), and the transformed matrix has retained the one-by-one and two-by-two block partition.

Why the Assembly Works in Both Directions

The rule is useful not only for computing a new matrix but also for recognizing when blockwise similarity is enough. Here “similar” means that one matrix is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) for some invertible \(\mathbf{P}\). If each pair of corresponding blocks is similar, the individual change-of-basis matrices can be assembled into one block-diagonal matrix.

Proposition: Let \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\dots,\mathbf{A}_k)\) and \(\mathbf{B}=\operatorname{diag}(\mathbf{B}_1,\dots,\mathbf{B}_k)\), with matching block sizes. If, for every \(i\), there is an invertible \(\mathbf{P}_i\) such that \(\mathbf{A}_i\mathbf{P}_i=\mathbf{P}_i\mathbf{B}_i\), then \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\) for the block-diagonal matrix \(\mathbf{P}=\operatorname{diag}(\mathbf{P}_1,\dots,\mathbf{P}_k)\), and hence \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).

Proof. In block position \((i,i)\), the product \(\mathbf{A}\mathbf{P}\) has block \(\mathbf{A}_i\mathbf{P}_i\), while \(\mathbf{P}\mathbf{B}\) has block \(\mathbf{P}_i\mathbf{B}_i\). These are equal by hypothesis. In every off-diagonal position both products have a zero block, since both factors are block diagonal. Therefore \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\). Each \(\mathbf{P}_i\) is invertible, so the block-diagonal matrix \(\mathbf{P}\) is invertible by the theorem. Multiplying the equality on the left by \(\mathbf{P}^{-1}\) gives \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{B}\). \(\square\)

This proposition asserts a sufficient construction: matching blockwise changes produce a whole-matrix similarity. It does not say that every similarity between two block-diagonal matrices must use a block-diagonal change-of-basis matrix. A general change of basis may mix vectors from different summands, so its matrix need not preserve the displayed partition.

Common Pitfall: Reversing the Similarity Direction

A frequent error is to use \(\mathbf{P}\mathbf{A}\mathbf{P}^{-1}\) when the columns of \(\mathbf{P}\) are the new basis vectors written in old coordinates. For the first block in the earlier example, the correct calculation gave \(\mathbf{P}_1^{-1}\mathbf{A}_1\mathbf{P}_1=\begin{bmatrix}2&0\\0&3\end{bmatrix}\). Reversing the factors instead gives

$$ \mathbf{P}_1\mathbf{A}_1\mathbf{P}_1^{-1} = \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}2&1\\0&3\end{bmatrix} \begin{bmatrix}1&-1\\0&1\end{bmatrix} = \begin{bmatrix}2&2\\0&3\end{bmatrix}. $$

That is not the matrix in the new basis under this coordinate convention. A direct check exposes the mistake: for the correct new matrix \(\mathbf{B}_1\), the equation \(\mathbf{A}_1\mathbf{P}_1=\mathbf{P}_1\mathbf{B}_1\) holds, since both sides equal \(\begin{bmatrix}2&3\\0&3\end{bmatrix}\). Substituting the reversed-factor result for \(\mathbf{B}_1\) does not give that equality. Before multiplying, identify what the columns of \(\mathbf{P}\) mean; then check \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\).

A second limitation is just as important: a block-diagonal change of basis preserves zero off-diagonal blocks, but does not generally turn nonzero off-diagonal blocks into zero. For example, let \(\mathbf{A}=\begin{bmatrix}1&1\\0&2\end{bmatrix}\) be partitioned into two one-by-one blocks and take \(\mathbf{P}=\operatorname{diag}(2,3)\). Then

$$ \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \begin{bmatrix}\tfrac12&0\\0&\tfrac13\end{bmatrix} \begin{bmatrix}1&1\\0&2\end{bmatrix} \begin{bmatrix}2&0\\0&3\end{bmatrix} = \begin{bmatrix}1&\tfrac32\\0&2\end{bmatrix}. $$

The off-diagonal entry remains nonzero. Blockwise changes of basis change coordinates within the chosen pieces; they do not by themselves separate pieces that are coupled by off-diagonal blocks.

Using the Rule Efficiently

For a blockwise calculation, first fix the partition and order of the summands. Then identify the old matrix \(\mathbf{A}_i\) and the new-coordinate matrix \(\mathbf{P}_i\) for each block. Compute \(\mathbf{P}_i^{-1}\mathbf{A}_i\mathbf{P}_i\) separately, and assemble the answers in the original block positions. The block products are usually easier to check than one large multiplication.

For additional verification, check each local equation \(\mathbf{A}_i\mathbf{P}_i=\mathbf{P}_i\mathbf{B}_i\). If those equations hold and every \(\mathbf{P}_i\) is invertible, the assembled matrix is a valid change of basis. This approach applies whenever the operator preserves the summands and the new basis is obtained by changing basis within each summand, without reordering or mixing them.

Worked Example: Two Independent Basis Choices

Let \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\mathbf{A}_2)\), where \(\mathbf{A}_1=\begin{bmatrix}0&1\\1&0\end{bmatrix}\) and \(\mathbf{A}_2=\begin{bmatrix}4&0\\0&6\end{bmatrix}\). Choose \(\mathbf{P}_1=\begin{bmatrix}1&1\\1&-1\end{bmatrix}\) and \(\mathbf{P}_2=\begin{bmatrix}0&1\\1&0\end{bmatrix}\).

The first matrix is invertible, with \(\mathbf{P}_1^{-1}=\tfrac12\begin{bmatrix}1&1\\1&-1\end{bmatrix}\), since \(\mathbf{P}_1^2=2\mathbf{I}_2\). Also \(\mathbf{P}_2^{-1}=\mathbf{P}_2\), since \(\mathbf{P}_2^2=\mathbf{I}_2\). For the first block,

$$ \mathbf{A}_1\mathbf{P}_1 = \begin{bmatrix}1&-1\\1&1\end{bmatrix}, \qquad \mathbf{P}_1^{-1}\mathbf{A}_1\mathbf{P}_1 = \tfrac12 \begin{bmatrix}1&1\\1&-1\end{bmatrix} \begin{bmatrix}1&-1\\1&1\end{bmatrix} = \begin{bmatrix}1&0\\0&-1\end{bmatrix}. $$

For the second block,

$$ \mathbf{A}_2\mathbf{P}_2 = \begin{bmatrix}0&4\\6&0\end{bmatrix}, \qquad \mathbf{P}_2^{-1}\mathbf{A}_2\mathbf{P}_2 = \begin{bmatrix}0&1\\1&0\end{bmatrix} \begin{bmatrix}0&4\\6&0\end{bmatrix} = \begin{bmatrix}6&0\\0&4\end{bmatrix}. $$

Thus \(\mathbf{B}=\operatorname{diag}(1,-1,6,4)\). The local checks are \(\mathbf{P}_1\begin{bmatrix}1&0\\0&-1\end{bmatrix}=\begin{bmatrix}1&-1\\1&1\end{bmatrix}=\mathbf{A}_1\mathbf{P}_1\) and \(\mathbf{P}_2\begin{bmatrix}6&0\\0&4\end{bmatrix}=\begin{bmatrix}0&4\\6&0\end{bmatrix}=\mathbf{A}_2\mathbf{P}_2\). They verify the assembled similarity block by block.

Check Your Understanding

In each question, keep track of the block partition and the coordinate direction of the change-of-basis matrix.

  1. If \(\mathbf{A}=\operatorname{diag}(\mathbf{A}_1,\mathbf{A}_2)\) and \(\mathbf{P}=\operatorname{diag}(\mathbf{P}_1,\mathbf{P}_2)\), what are the diagonal blocks of \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\)?
  2. For \(\mathbf{A}_1=\begin{bmatrix}1&0\\0&4\end{bmatrix}\) and \(\mathbf{P}_1=\begin{bmatrix}1&1\\0&1\end{bmatrix}\), compute \(\mathbf{P}_1^{-1}\mathbf{A}_1\mathbf{P}_1\) and check \(\mathbf{A}_1\mathbf{P}_1=\mathbf{P}_1\mathbf{B}_1\).
  3. Why must each \(\mathbf{P}_i\) be invertible for the assembled matrix to be a change of basis?
  4. Suppose each corresponding pair of diagonal blocks of \(\mathbf{A}\) and \(\mathbf{B}\) is similar. Explain how to build a block-diagonal matrix \(\mathbf{P}\) satisfying \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{B}\).
  5. Can a block-diagonal change of basis remove a nonzero off-diagonal block? Use block multiplication to justify your answer.

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