Section 13.3 Change of Basis
Let \(B = \{v_1, \ldots, v_n\}\) be a basis for \(V\) and \(C = \{w_1, \ldots, w_m\}\) a basis for \(W\text{.}\) The matrix associated to \(T: V \to W\) relative to the bases \(B\) and \(C\text{,}\) denoted \([T]_{B \to C}\text{,}\) is the matrix whose columns are the coordinates of the images of the vectors of \(B\) relative to the basis \(C\text{.}\)
For each \(k=1,\ldots,n\text{,}\) we can write \(T(v_k)\) as a unique linear combination of the vectors in \(C\text{:}\)
\begin{equation*}
T(v_k) = a_{1k}w_1 + \cdots + a_{mk}w_m,
\end{equation*}
where \(a_{jk} \in F\) for \(j=1,\ldots,m\text{.}\) These scalars \(a_{jk}\) form the \(m \times n\) matrix \([T]_{B \to C}\text{.}\)
Given the basis
\begin{equation*}
B = \{(5,1,0),\,(0,2,-1),\,(0,0,3)\}
\end{equation*}
of \(\mathbb{R}^3\) and the basis
\begin{equation*}
C = \{(2,3),\,(1,-1)\}
\end{equation*}
of \(\mathbb{R}^2\) we compute this matrix manually with the aid of Sage. Recall the linear transformation \(T(x,y,z) = (x-3z,\,y-2z)\) introduced previously.
Next, we express each image as a coordinate vector relative to \(C\text{.}\) This amounts to solving the linear system \(P_W \mathbf{x} = T(v_k)\) for each \(k\text{,}\) where \(P_W\) is the matrix whose columns are \(w_1\) and \(w_2\text{.}\)
These coordinate vectors become the columns of \([T]_{B \to C}\text{.}\)
\begin{equation*}
[T]_{B \to C} =
\begin{pmatrix}
\frac{6}{5} \amp \frac{7}{5} \amp -3 \\
\frac{13}{5} \amp \frac{1}{5} \amp -3
\end{pmatrix}.
\end{equation*}
We can also ask Sage to compute this matrix directly, by defining the linear transformation using the images of the basis \(B\) and the custom bases as domain and codomain.
The output displays the linear transformation with the given bases as domain and codomain. The matrix shown by Sage is the transpose of \([T]_{B \to C}\text{.}\) To obtain \([T]_{B \to C}\) explicitly, we use the method
matrix('right'):
Note that the operator
== applied to linear transformations in Sage checks whether the associated internal matrices are identical, not whether the underlying functions agree on all inputs. When transformations are defined with respect to different bases, this check may return False even for the same function. To compare transformations reliably, use the method .is_equal_function().
The change of basis formula provides an alternative way to compute \([T]_{B \to C}\text{.}\) If \([T]\) denotes the matrix of \(T\) in the standard bases, then
\begin{equation*}
P_W^{-1}\, [T]\, P_V = [T]_{B \to C},
\end{equation*}
where \(P_W\) has the vectors of \(C\) as columns and \(P_V\) has the vectors of \(B\) as columns. We first compute the matrix \([T]\) in the standard bases:
The matrix \(P_W\text{:}\)
The matrix \(P_V\text{:}\)
The matrix \([T]_{B \to C}\) is then given by the following product:
Finally, we verify that this coincides with the matrix obtained previously:
