It is possible in Sage to add linear transformations (Definition LTA), multiply them by scalars (Definition LTSM) and compose (Definition LTC) them. Then Theorem SLTLT Theorem MLTLT, and Theorem CLTLT (respectively) tell us the results are again linear transformations. Here are some examples:
Perhaps the only surprise in all this is the necessity of writing scalar multiplication on the right of the linear transformation (rather on the left, as we do in the text). We will recycle the linear transformation T from above and redefine S to form an example of composition.
We use the star symbol (*) to indicate composition of linear transformations. Notice that the order of the two linear transformations we compose is important, and Sage's order agrees with the text. The order does not have to agree, and there are good arguments to have it reversed, so be careful if you read about composition elsewhere.
This is a good place to expand on Theorem VSLT, which says that with definitions of addition and scalar multiplication of linear transformations we then arrive at a vector space. A vector space full of linear transformations. Objects in Sage have “parents” — vectors have vector spaces for parents, fractions of integers have the rationals as parents. What is the parent of a linear transformation? Let us see, by investigating the parent of S just defined above.
“Morphism” is a general term for a function that “preserves structure” or “respects operations.” In Sage a collection of morphisms is referenced as a “homset” or a “homspace.” In this example, we have a homset that is the vector space of linear transformations that go from a dimension 2 vector space over the rationals to a dimension 3 vector space over the rationals. What can we do with it? A few things, but not everything you might imagine. It does have a basis, containing a few very simple linear transformations:
You can create a set of linear transformations with the Hom() function, simply by giving the domain and codomain.
An understanding of Sage's homsets is not critical to understanding the use of Sage during the remainder of this course. But such an understanding can be very useful in understanding some of Sage's more advanced and powerful features.