We can also create a linear transformation from a matrix, as in Theorem MBLT, with one caveat. For a matrix \(A\text{,}\) the default is to create the function \(T(\mathbf{v})=\mathbf{v}A\text{.}\) The keywords option side='right' will indicate that we want to put the vector on the right of the matrix.
Notice that we do not have to specify the domain or codomain, these are inferred from the size and type of the matrix. S is not new, it is exactly the linear transformation T above.
︡5ddf6e07-4de0-4086-aecf-af5e8406a10f︡
︠66d46336-a749-4851-ae3d-dec3d58db2fc︠
S == T
︡262fa82d-fd53-46d8-a7bc-48a1c7645274︡
︠e9a194ac-2997-4d05-a570-1c9cd534a861︠
%auto
%html(hide=True)
Again, notice how S prints — the matrix representation is the transpose of what we like to use. This does not change the linear transformation as a function, it just changes how we think about it (we like linear combinations of columns, Sage likes linear combinations of rows).
︡c5b765b0-1eab-467b-abd2-bff5bdbe1578︡
︠73e3b487-5a5f-45b6-a073-33328e03d194︠
A, S
︡a18853dd-a280-42db-a9e3-d1604fe43b6d︡
︠00e893b7-16aa-46c7-a265-537c3cb20ee6︠
%auto
%html(hide=True)
︡7a941f85-899c-4b7b-a341-9a16e33780d5︡
︠c4f58150-6da0-4957-a58c-716984ccb5d8︠
R == T
︡a9dae5b3-6200-42a5-a90e-670c181d5d22︡
︠6db37a92-e04f-4069-a60a-562533e51334︠
%auto
%html(hide=True)
We can give the domain an alternate basis and create a different linear transformation, despite seemingly having the same construction. First we build the domain with a different user basis.
Even though the matrix representation prints the same, this is not the same function, we will need ideas from Chapter R before we can understand the difference.
The following is wrong. (In other words, there is a bug in Sage.)
︡7c2df322-800b-4da6-a493-6960e6d5c3c2︡
︠44e62da4-0250-4e2b-a575-9ef0fd6c32f0︠
P = R + L
P
︡4343a605-b180-4273-adda-269168fc42f4︡
︠247772d8-8990-49b7-ad94-7ba1d19ceefd︠
%auto
%html(hide=True)
As we can see…
︡212a99c7-240c-45a8-ac71-0fdb0ad97b76︡
︠898a3240-9759-43a3-ab6b-d7aa3a504dbc︠
Q = L + R
Q.is_equal_function(P)
︡446dfaf4-a9b0-42fb-a6b2-189c3d79eb79︡
︠8cee9d99-242d-445d-afb8-1d1b9581e6c6︠
%auto
%html(hide=True)
The problem is that Sage is simply adding the matrices representing the linear transformations, without checking that they are defined using domains with the same basis. We will understand the subtlety better in Chapter R.