Section 13.1 Definition
Linear transformations are functions between vector spaces that preserve the vector space operations of addition and scalar multiplication.
Let \(V\) and \(W\) be vector spaces over a field \(F\text{.}\) A linear transformation \(T: V β W\) is a function which assigns to each vector \(v\) in \(V\) a unique vector \(w = T(v)\) in \(W\) such that
\begin{align*}
T(u+v) \amp = Tu+Tv\\
T(cv) \amp = cT(v)
\end{align*}
Subsection 13.1.1 Sage Calculation
Sage can create a linear transformation from a variety of possible inputs. First, letβs see how to create it from its symbolic expression.
We will use the method
linear_transformation() with inputs: domain \(V\text{,}\) codomain \(W\) and linear transformation \(t\text{,}\) where \(t(x_1, \ldots, x_n) = [T(x_1, \ldots, x_n)]\text{.}\)
Consider the linear transformation \(T: \mathbb{R}^3 \to \mathbb{R}^2\) given by
\begin{equation*}
T(x,y,z)=(x-3z,y-2z).
\end{equation*}
The output is the linear transformation (called vector space morphism in Sage). By default Sage shows the domain, codomain and a matrix associated to the linear transformation.
We can evaluate this linear transformation at any vector in the domain.
We will now present the relationship between linear transformations and matrices.
Given an \(m \times n\) matrix \(A\text{,}\) the function that maps a vector \(v\) in \(V\) to the vector \(Av\) in \(W\) is a linear transformation.
A second way to define a linear transformation is using the same method
linear_transformation but specifying the matrix \(A\) as input. In this case, we need to use the option side='right' to be consistent with Sageβs preference for row vectors.
We can check that these transformations are the same:
Conversely, any linear transformation \(T: V β W\) can be expressed as \(T(x) = Ax\) for some matrix \(A\text{.}\) This matrix is obtained by applying \(T\) to the vectors of the standard basis of \(V\) and writing the images \(T(e_1), \ldots, T(e_n)\) as the columns of \(A\text{.}\)
For our linear transformation \(T: \mathbb{R}^3 \to \mathbb{R}^2\) we can build this matrix manually by calculating first the images and building the matrix \(A\) by columns:
Alternatively, we can ask Sage to obtain the associated matrix directly by using the method
matrix() with the option side='right'.
Letβs check that the matrix that we calculated manually and the one calculated by Sage are the same:
Observe that the matrix associated to a linear transformation by default in Sage is the transpose of this matrix, since the default Sage option is
side='left'.
A third way to define a linear transformation is by inputing the images of the standard basis as a list in the
linear_transformation method.
Again, we can check that we obtain the same linear transformation:
