Change of Basis¶
If we choose a basis in a vector space, then each vector is uniquely characterised by its coordinates, and each linear operator \(\,\) - \(\,\) by its matrix in this basis. However, in different bases one vector has different coordinates, and one linear operator \(\,\) - \(\,\) different matrices.
In this section we introduce formulae which describe a change of vector coordinates and matrices of linear operators under the change of basis.
Change-of-Basis Matrix¶
Let \(\ \mathcal{B}\,=\,(v_1,\,v_2,\,\dots,\,v_n)\ \) and \(\ \,\mathcal{B'}\,=\,(v_1',\,v_2',\,\dots,\,v_n')\ \) be two bases of a vector space \(\,V\ \) over a field \(\,K.\)
Lemma.
A linear transformation \(\ T:\,V\rightarrow V\ \) given by
is an automorphism of the vector space \(\,V.\ \\\) We call it an \(\,\) automorphism of transition \(\,\) from basis \(\ \mathcal{B}\ \) to basis \(\ \mathcal{B'}.\)
Proof. \(\, \\\) A linear transformation \(\,T\ \) is uniquely defined if we fix images of vectors from basis \(\ \mathcal{B}\ \) (cf. Corollary to Theorem 5.).
For a vector \(\displaystyle\ \,v=\sum_{i\,=\,1}^n\ a_i\,v_i\,\in\,V\ \,\) we have
Hence, a vector with coordinates \(\ \,\,a_1,\,a_2,\,\dots,\,a_n\,\ \,\) in basis \(\ \mathcal{B}\ \,\) is mapped to a vector with the same coordinates in basis \(\ \mathcal{B}'.\ \) Recall that in a vector space with a chosen basis the vector coordiates are determined uniquely. Therefore the transformation \(\ T\ \) is a bijective endomorphism, or in other words, an automorphism.
Definition.
Let \(\ \boldsymbol{S}\ =\ [\,s_{ij}\,]_{n\times n}\,.\ \) Definition of matrix of a linear operator implies the relations
which give us a practical method to construct transition matrix:
Corollary 1. \(\\\)
The \(j\)-th column of transition matrix \(\ \boldsymbol{S}\ \) from basis \(\ \mathcal{B}\ \) to \(\ \mathcal{B}'\ \) of vector space \(\,V\,\) is a column of coordinates \(\,\) (in basis \(\ \mathcal{B}\)) \(\,\) of the \(j\)-th vector from basis \(\ \mathcal{B}',\ \ j=1,2,\dots,n:\)
A crucial property of transition matrices states
Corollary 2.
Transition matrix is nondegenerate: \(\ \ \det\,\boldsymbol{S}\neq 0\,.\)
Proof. \(\,\) The mapping \(\,I_{\mathcal{B}},\ \) being an isomorphism of the space \(\,V\ \) onto the space \(\,K^n,\ \) preserves linear independence of vectors. Linear independence of vectors \(\ v_1',\,v_2',\,\dots,\,v_n'\ \) from the basis \(\ \mathcal{B'}\ \) implies then linear independence of columns of the matrix \(\ \boldsymbol{S},\ \,\) which further implies nonvanishing of its determinant.
Example.
Consider 3-dimensional vector space \(\,V\ \) with bases \(\ \mathcal{B}=(v_1,\,v_2,\,v_3)\ \) and \(\ \mathcal{B'}=(v_1',\,v_2',\,v_3'),\ \,\) where \(\ \ v_1'=\,v_1,\) \(\ \ v_2'=\,v_1+\,v_2,\) \(\ \ v_3'=\,v_1+\,v_2+\,v_3\,.\)
Relations between vectors from the two bases may be written as
Change-of-Basis Transformation Formulae¶
From now on, the bases \(\ \mathcal{B}\,=\,(v_1,\,v_2,\,\dots,\,v_n)\ \) and \(\ \,\mathcal{B'}\,=\,(v_1',\,v_2',\,\dots,\,v_n')\ \) will be called the old and the new basis respectively. The relations (1) between their vectors may be writtes as:
This system of \(\,n\ \) equalities is equivalent to a matrix equation
Rule 0. \(\,\) Transformation of basis vectors.
A column consisting of vectors from the new basis is equal to a product of transposed transition matrix and a column consisting of vectors from the old basis.
It is worth to notice that (contrary to matrix equations we have seen so far) the elements of columns on both sides are not scalars (numbers), but vectors. However, the matrix in this equation is a standard numerical matrix.
To find out the transformation of vector coordinates under a change of basis, we write a vector \(\,v\in V\ \) with respect to the old and the new basis:
By uniqueness of representation of a vector in basis \(\, \mathcal{B},\)
If we write it in a matrix form, we obtain
Rule 1. \(\,\) Transformation of vector coordinates.
We discuss now transformation of a matrix of a linear operator.
Let \(\,F\in\text{End}(V),\quad M_{\mathcal{B}}(F)=\boldsymbol{F}=[\,f_{ij}\,]_{n\times n}\,,\quad M_{\mathcal{B}'}(F)=\boldsymbol{F}'=[\,f_{ij}'\,]_{n\times n}\,.\)
Starting from definition of a matrix of the opeartor \(\,F\ \) in basis \(\,\mathcal{B},\,\) we obtain (\(j=1,2,\dots,n\)):
The last equation states that \(\,\boldsymbol{F}\,\) is a matrix \(\,\) (in basis \(\,\mathcal{B}\,\)) \(\,\) of the operator \(\ \,T^{-1}\circ\,F\,\circ\,T\) :
In this way, the matrix \(\,\boldsymbol{F}'\ \) of the linear operator \(\,F\ \) in basis \(\,\mathcal{B}'\ \) is given by
Rule 2. \(\,\) Transformation of a matrix of a linear operator.
Under a change of basis described by the transition matrix \(\,\boldsymbol{S},\ \) a matrix of the linear operator \(\,F\ \) changes according to the formula:
Remark.
From comparison of the formulae (3) and (4), we see that under a change of basis the vector coordinates change differently than the basis vectors, \(\,\) unless
A matrix \(\,\boldsymbol{S}\in M_n(K)\ \) satisfying the condition (6) is called an \(\,\) orthogonal matrix.
An example of an orthogonal matrix may be a matrix \(\,\boldsymbol{S}\,\) representating rotation of the basis \(\,\mathcal{B}=(\vec{e}_1,\,\vec{e}_2,\,\vec{e}_3)\ \) of 3-dimensional space of geometric vectors, where \(\,(\vec{e}_1,\,\vec{e}_2,\,\vec{e}_3)\ \) is a triple of mutually perpendicular unit vectors with right-handed coordinates. Matrices of permutation are also orthogonal.
Exercise.
Justify that transition matrix \(\ \boldsymbol{S}\ \) from basis \(\,\mathcal{B}\ \) to \(\,\mathcal{B}'\ \) may be equivalently defined as a matrix of a transition automorphism \(\,T\ \) in the new basis \(\,\mathcal{B}':\)
\[\boldsymbol{S}\ :\,=\ M_{\mathcal{B}}(T)\ =\ M_{\mathcal{B}'}(T)\,.\]Complete discussion leading to a formula (5) by proving that for \(\,T\in\text{Aut}(V),\ \) we have
\[M_{\mathcal{B}}(T^{-1})\ \ =\ \ [\,M_{\mathcal{B}}(T)\,]^{-1}\,.\]
Examples¶
Example 0.
In the space \(\,R^4\,\) find a transition matrix :
- from the canonical basis \(\ \mathcal{E}\,=\, (\boldsymbol{e}_1,\,\boldsymbol{e}_2,\,\boldsymbol{e}_3,\,\boldsymbol{e}_4)\ =\ \left(\ \left[\begin{array}{c} 1 \\ 0 \\ 0 \\ 0 \end{array}\right]\,, \left[\begin{array}{c} 0 \\ 1 \\ 0 \\ 0 \end{array}\right]\,, \left[\begin{array}{c} 0 \\ 0 \\ 1 \\ 0 \end{array}\right]\,, \left[\begin{array}{c} 0 \\ 0 \\ 0 \\ 1 \end{array}\right] \ \right)\)to \(\ \mathcal{F}\,=\, (\boldsymbol{f}_1,\,\boldsymbol{f}_2,\,\boldsymbol{f}_3,\,\boldsymbol{f}_4)\ =\ \left(\ \left[\begin{array}{r} 1 \\ 2 \\ -1 \\ 0 \end{array}\right]\,, \left[\begin{array}{r} 1 \\ -1 \\ 1 \\ 1 \end{array}\right]\,, \left[\begin{array}{r} -1 \\ 2 \\ 1 \\ 1 \end{array}\right]\,, \left[\begin{array}{r} -1 \\ -1 \\ 0 \\ 1 \end{array}\right] \ \right)\,.\)
- from basis \(\,\mathcal{F}\,=\, (\boldsymbol{f}_1,\,\boldsymbol{f}_2,\,\boldsymbol{f}_3,\,\boldsymbol{f}_4)\)to \(\,\mathcal{G}\,=\, (\boldsymbol{g}_1,\,\boldsymbol{g}_2,\,\boldsymbol{g}_3,\,\boldsymbol{g}_4)\,=\, \left(\ \left[\begin{array}{r} 2 \\ 1 \\ 0 \\ 1 \end{array}\right], \left[\begin{array}{r} 0 \\ 1 \\ 2 \\ 2 \end{array}\right], \left[\begin{array}{r} -2 \\ 1 \\ 1 \\ 2 \end{array}\right], \left[\begin{array}{r} 1 \\ 3 \\ 1 \\ 2 \end{array}\right] \ \right).\)
Solution.
We start with a matrix \(\,\boldsymbol{F}\ \) whose columns consist of vectors from a basis \(\,\mathcal{F}:\)
The columns of transition matrix from the basis \(\,\mathcal{E}\,\) to \(\,\mathcal{F}\,\) consist of coordinates of the vectors from basis \(\ \mathcal{F}\ \,\) in basis \(\ \mathcal{E}:\)
Now recall that in the space \(\,R^4\ \) every vector is actually a column of its coordinates in the canonical basis:
Hence, the transition matrix we are looking for is simply given by
Corollary (generalisation).
In the space \(\,K^n\,\) transition matrix from the canonical basis \(\ \mathcal{E}\ \) to a basis \(\,\mathcal{B}\ \) is equal to a matrix \(\,\boldsymbol{B}\ \) whose columns are vectors from the basis \(\,\mathcal{B}\ \) (taken in the same order).
To describe a transition \(\ \mathcal{F}\rightarrow\mathcal{G}\ \) it will be useful to have, apart from a matrix \(\,\boldsymbol{F},\ \) also the matrix
By definition (see formula (1)), the \(\,j\)-th column of the transition matrix \(\,\boldsymbol{S}_{\mathcal{F}\rightarrow\mathcal{G}}\equiv\boldsymbol{S}= [\,s_{ij}\,]_{4\times 4}(R)\ \) from basis \(\ \mathcal{F}\ \) to \(\ \mathcal{G}\ \) is equal to a column of coordinates (in basis \(\ \mathcal{F}\ \)) of the \(\,j\)-th vector from the basis \(\ \mathcal{G}:\)
The relation (8) may be interpreted by the column rule of matrix multiplication: the \(\,j\)-th column of the matrix \(\,\boldsymbol{G}\ \) is a linear combination of columns of matrix \(\,\boldsymbol{F}\ \) with coordinates from the \(\,j\)-th column of the matrix \(\,\boldsymbol{S},\ \ j=1,2,3,4.\ \) This means that
The matrix \(\,\boldsymbol{F},\ \) composed of linearly independent columns \(\ \boldsymbol{f}_1\,,\,\boldsymbol{f}_2\,,\,\boldsymbol{f}_3\,,\,\boldsymbol{f}_4\,,\ \) is nondegenerate: \(\ \det\,\boldsymbol{F}\neq 0,\ \,\) and thus invertible. Hence, the transition matrix
Variant of a solution.
Let \(\ T\in\text{Aut}(R^4)\ \) be an automorphism of transition from basis \(\ \mathcal{F}\ \) to \(\ \mathcal{G}.\ \) Then a transition matrix we are looking for is a matrix of the automorphism \(\,T\,\) in basis \(\,\mathcal{F}:\ \boldsymbol{S}_{\mathcal{F}\rightarrow\mathcal{G}}\equiv\boldsymbol{S}= M_{\mathcal{F}}(T).\ \) Moreover,
where \(\ \,\boldsymbol{T}:\,=M_{\mathcal{E}}(T)\ \,\) is a matrix of automorphism \(\,T\ \) in the canonical basis. By the column rule of matrix multiplication, we state that vector equalities
imply an equality of matrices
Hence, \(\ \,\boldsymbol{T}\equiv M_{\mathcal{E}}(T)\ =\ \boldsymbol{G}\boldsymbol{F}^{-1}.\ \,\) The necessary matrix \(\,\boldsymbol{S}\equiv M_{\mathcal{F}}(T)\ \) may be calculated from the formula
However, as we showed earlier (equation (7)): \(\ \,\boldsymbol{S}_{\mathcal{E}\rightarrow\mathcal{F}}=\boldsymbol{F},\ \,\) and thus
To check correctness of the solution (9), let us consider a particular case when the basis \(\ \mathcal{F}\ \,\) is the canonical basis: \(\ \mathcal{F}=\mathcal{E}.\ \,\) Then \(\ \boldsymbol{F}=\boldsymbol{I}_4,\ \ \) and so we get a formula \(\ \boldsymbol{S}_{\mathcal{E}\rightarrow\mathcal{G}}\ =\ \boldsymbol{G}\ \) which is consistent (under different notation) with a previous result (7).
Now, turning to calculations, we have to find product of matrices
Computer calculations are the following:
sage: F = matrix(QQ,[[ 1, 1,-1,-1],
[ 2,-1, 2,-1],
[-1, 1, 1, 0],
[ 0, 1, 1, 1]])
sage: G = matrix(QQ,[[ 2, 0,-2, 1],
[ 1, 1, 1, 3],
[ 0, 2, 1, 1],
[ 1, 2, 2, 2]])
sage: F.I*G
[1 0 0 1]
[1 1 0 1]
[0 1 1 1]
[0 0 1 0]
Example 1.
In 4-dimensional space \(\,V(R)\ \) with basis \(\,\mathcal{B}=(v_1,\,v_2,\,v_3,\,v_4),\ \) the vector \(\,v\ \) has coordinates \(\ 2,\ -3,\ 0,\ 4.\ \) What are its coordinates in basis \(\,\mathcal{B}'=(v_1',\,v_2',\,v_3',\,v_4'),\ \) where
Solution. \(\,\) The starting point is the Rule 1. which describes transformation of vector coordinates:
The transition matrix \(\,\boldsymbol{S}\ \) may be determined from a relation between vectors from the old and the new basis:
Namely, by Corollary 1. stated after definition of transition matrix (equation (2)) :
For our vector \(v\): \(\quad I_{\mathcal{B}}(v)\ =\ \left[\begin{array}{r} 2 \\ -3 \\ 0 \\ 4 \end{array}\right]\, .\quad\) If we denote \(\quad I_{\mathcal{B}'}(v)\ =\ \left[\begin{array}{r} a_1' \\ a_2' \\ a_3' \\ a_4' \end{array}\right] ,\quad\) then
Further calculations may be done in two ways. \(\\\)
Method 1. \(\,\) By direct calculation of an inverse of the matrix \(\,\boldsymbol{S}.\)
Matrix \(\,\boldsymbol{S}^{-1}\ \) may be calculated by hand from the formula
where \(\,S_{ij}\,\) is an algebraic complement of the element \(\,s_{ij}\,\) of the matrix \(\,\boldsymbol{S},\ \\\) or by a computer, using functions provided by Sage. \(\\\)
In the second case, after computation of the matrix \(\,\boldsymbol{S}^{-1}\ \) we can perform matrix multipliction on the right hand side of the equation (10) straight away. The result is a column of coordinates of the vector \(\,v\,\) in basis \(\,\mathcal{B}'.\)
sage: S = matrix(QQ,[[-1, 2, 1, 0],
[ 0, 0, 1, 1],
[ 0,-1,-1,-1],
[ 0, 0,-2, 1]])
# Inverse of the matrix S:
sage: S_1 = S.I
# Column of coordinates of the vector v in basis B:
sage: I_B = vector(QQ,[2,-3,0,4]).column()
sage: table([[S_1,'*',I_B,'=',S_1*I_B]])
For clear presentation of vectors and numerical elements of the matrix, the calculations have been done in a field \(\,Q\,\) of rational numbers.
Answer. \(\,\) The coordinates of the vector \(\,v\ \) in basis \(\,\mathcal{B}'\ \) are: \(\textstyle\quad\frac{5}{3}\,,\ \ \ 3\,,\ \ -\ \frac{7}{3}\,,\ \ -\ \frac{2}{3}\,. \\\)
Method 2. \(\,\) Instead of direct computation of the matrix \(\,\boldsymbol{S}^{-1},\ \) we may invert the relations
After simple elementary calculations we obtain the formulae
which allow us to write down a matrix of the automorphism \(\,T^{-1}\ \) in basis \(\,\mathcal{B}':\)
We are rather interested in matrix \(\ \boldsymbol{S}^{-1}=[\,M_{\mathcal{B}}(T)\,]^{-1},\ \,\) but according to the Rule 2.:
The equation (12) gives us then the matrix \(\ \boldsymbol{S}^{-1},\ \) which further leads to the result (11).
Variant of a solution. \(\,\)
The relation (4) between coordinates of a vector in the new and the old basis, written in a form
gives Cramer system of equations
which may be solved by hand or by computer, using functions provided by Sage:
sage: S = matrix(QQ,[[-1, 2, 1, 0],
[ 0, 0, 1, 1],
[ 0,-1,-1,-1],
[ 0, 0,-2, 1]])
sage: I_B = vector(QQ,[2,-3,0,4]) # vector of constants
sage: S \ I_B
(5/3, 3, -7/3, -2/3)
\(\;\)
Example 2.
In basis \(\,\mathcal{B}=(v_1,\,v_2,\,v_3)\ \) of the vector space \(\,V(R)\ \) an operator \(\,F\in\text{End}(V)\ \) has a matrix
Find a matrix \(\,\boldsymbol{F}'\ \) of this operator in basis \(\,\mathcal{B}'=(v_1',\,v_2',\,v_3'):\,=(v_3,\,v_2,\,v_1).\)
Solution.
Method 1. (direct) \(\,\)
By definition of matrices \(\,\boldsymbol{F}=[\,f_{ij}\,]_{3\times 3}\ \) and \(\,\boldsymbol{F}'=[\,f_{ij}'\,]_{3\times 3}\ \) of the operator \(\,F\ \) in bases \(\,\mathcal{B}\ \) and \(\,\mathcal{B}':\)
and by relations \(\, v_1'=v_3,\, v_2'=v_2,\, v_3'=v_1,\)
The second system of equations provides:
Method 2. (standard)
We use the Rule 2. describing transformation of a matrix of a linear operator (formula (5)):
where \(\,\boldsymbol{S}\ \) is a transition matrix from basis \(\,\mathcal{B}=(v_1,\,v_2,\,v_3)\ \) to \(\,\mathcal{B}'=(v_3,\,v_2,\,v_1).\)
Relations between vectors from the new and the old basis
Instead of direct computation of the matrix \(\,\boldsymbol{S}^{-1}\ \) note that the transition automorphism \(\,T,\ \) which maps vectors from basis \(\,\mathcal{B}\ \) to the corresponding vectors from the basis \(\,\mathcal{B}':\ \ Tv_i=v_i',\ \ i=1,2,3,\ \ \) satisfies a condition \(\,T^2=I,\ \) where \(\,I\ \) is an identity mapping:
By multiplicativity of matrix representation of linear operators, it follows taht the analogous property has transition matrix: \(\ \boldsymbol{S}^2\ =\ \boldsymbol{I}_3,\ \,\) and thus \(\ \boldsymbol{S}^{-1}=\,\boldsymbol{S}.\)
We substitute these matrices to the formula (13). \(\\\)
sage: F = matrix(QQ,[[3, -2, -1],
[2, 1, -3],
[1, 3, 2]])
sage: S = matrix(QQ,[[0, 0, 1],
[0, 1, 0],
[1, 0, 0]])
sage: F_1 = S*F*S
sage: table([[S, '*', F, '*', S, '=', F_1]])
\(\\\)