A third way to create a linear transformation in Sage is to provide a list of images for a basis, as motivated by
Theorem LTDB. The default is to use the standard basis as the inputs (
Definition SUV). We will, once again, create our running example.
Notice that there is no requirement that the list of images (in Sage or in
Theorem LTDB) is a basis. They do not even have to be different. They could all be the zero vector (try it).
If we want to use an alternate basis for the domain, it is possible, but there are two caveats. The first caveat is that we must be sure to provide a basis for the domain, Sage will give an error if the proposed basis is not linearly independent and we are responsible for providing the right number of vectors (which should be easy).
We have seen that vector spaces can have alternate bases, which print as a “user basis.” Here will provide the domain with an alternate basis. The relevant command will create a subspace, but for now, we need to provide a big enough set to create the entire domain. It is possible to use fewer linearly independent vectors, and create a proper subspace, but then we will not be able to use this proper subspace to build the linear transformation we want.
We can use this alternate version of U
to create a linear transformation from specified images. Superficially there is nothing real special about our choices for v1, v2, v3
.
Now we create the linear transformation. Here is the second caveat: the matrix of the linear transformation is no longer that provided by
Theorem MLTCV. It may be obvious where the matrix comes from, but a full understanding of its interpretation will have to wait until
Section MR.
We suggested our choices for v1, v2, v3
were “random.” Not so — the linear transformation S
just created is equal to the linear transformation T
above. If you have run all the input in this subsection, in order, then you should be able to compare the functions S
and T
. The next command should always produce True
.
Notice that T == S
may not do what you expect here. Instead, the linear transformation method .is_equal_function()
will perform a conclusive check of equality of two linear transformations as functions.
Can you reproduce this example? In other words, define some linear transformation, any way you like. Then give the domain an alternate basis and concoct the correct images to create a second linear transformation (by the method of this subsection) which is equal to the first.