Homspaces between free modules¶
EXAMPLES:
We create \(\mathrm{End}(\ZZ^2)\) and compute a basis.
sage: M = FreeModule(IntegerRing(), 2)
sage: E = End(M)
sage: B = E.basis()
sage: len(B)
4
sage: B[0]
Free module morphism defined by the matrix
[1 0]
[0 0]
Domain: Ambient free module of rank 2 over the principal ideal domain ...
Codomain: Ambient free module of rank 2 over the principal ideal domain ...
>>> from sage.all import *
>>> M = FreeModule(IntegerRing(), Integer(2))
>>> E = End(M)
>>> B = E.basis()
>>> len(B)
4
>>> B[Integer(0)]
Free module morphism defined by the matrix
[1 0]
[0 0]
Domain: Ambient free module of rank 2 over the principal ideal domain ...
Codomain: Ambient free module of rank 2 over the principal ideal domain ...
We create \(\mathrm{Hom}(\ZZ^3, \ZZ^2)\) and compute a basis.
sage: V3 = FreeModule(IntegerRing(), 3)
sage: V2 = FreeModule(IntegerRing(), 2)
sage: H = Hom(V3, V2)
sage: H
Set of Morphisms
from Ambient free module of rank 3 over the principal ideal domain Integer Ring
to Ambient free module of rank 2 over the principal ideal domain Integer Ring
in Category of finite dimensional modules with basis over
(euclidean domains and noetherian rings
and infinite enumerated sets and metric spaces)
sage: B = H.basis()
sage: len(B)
6
sage: B[0]
Free module morphism defined by the matrix
[1 0]
[0 0]
[0 0]...
[Python]
>>> from sage.all import *
>>> V3 = FreeModule(IntegerRing(), Integer(3))
>>> V2 = FreeModule(IntegerRing(), Integer(2))
>>> H = Hom(V3, V2)
>>> H
Set of Morphisms
from Ambient free module of rank 3 over the principal ideal domain Integer Ring
to Ambient free module of rank 2 over the principal ideal domain Integer Ring
in Category of finite dimensional modules with basis over
(euclidean domains and noetherian rings
and infinite enumerated sets and metric spaces)
>>> B = H.basis()
>>> len(B)
6
>>> B[Integer(0)]
Free module morphism defined by the matrix
[1 0]
[0 0]
[0 0]...
- class sage.modules.free_module_homspace.FreeModuleHomspace(X, Y, category=None, check=True, base=None)[source]¶
Bases:
HomsetWithBase- basis(side='left')[source]¶
Return a basis for this space of free module homomorphisms.
INPUT:
side– side of the vectors acted on by the matrix (default:'left')
OUTPUT: tuple
EXAMPLES:
sage: H = Hom(ZZ^2, ZZ^1) sage: H.basis() (Free module morphism defined by the matrix [1] [0] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ..., Free module morphism defined by the matrix [0] [1] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ...) sage: H.basis("right") (Free module morphism defined as left-multiplication by the matrix [1 0] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ..., Free module morphism defined as left-multiplication by the matrix [0 1] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ...)
>>> from sage.all import * >>> H = Hom(ZZ**Integer(2), ZZ**Integer(1)) >>> H.basis() (Free module morphism defined by the matrix [1] [0] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ..., Free module morphism defined by the matrix [0] [1] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ...) >>> H.basis("right") (Free module morphism defined as left-multiplication by the matrix [1 0] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ..., Free module morphism defined as left-multiplication by the matrix [0 1] Domain: Ambient free module of rank 2 over the principal ideal domain ... Codomain: Ambient free module of rank 1 over the principal ideal domain ...)
- identity(side='left')[source]¶
Return identity morphism in an endomorphism ring.
INPUT:
side– side of the vectors acted on by the matrix (default:'left')
EXAMPLES:
sage: V = FreeModule(ZZ,5) sage: H = V.Hom(V) sage: H.identity() Free module morphism defined by the matrix [1 0 0 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0] [0 0 0 0 1] Domain: Ambient free module of rank 5 over the principal ideal domain ... Codomain: Ambient free module of rank 5 over the principal ideal domain ...
>>> from sage.all import * >>> V = FreeModule(ZZ,Integer(5)) >>> H = V.Hom(V) >>> H.identity() Free module morphism defined by the matrix [1 0 0 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0] [0 0 0 0 1] Domain: Ambient free module of rank 5 over the principal ideal domain ... Codomain: Ambient free module of rank 5 over the principal ideal domain ...
- zero(side='left')[source]¶
INPUT:
side– side of the vectors acted on by the matrix (default:'left')
EXAMPLES:
sage: E = ZZ^2 sage: F = ZZ^3 sage: H = Hom(E, F) sage: f = H.zero() sage: f Free module morphism defined by the matrix [0 0 0] [0 0 0] Domain: Ambient free module of rank 2 over the principal ideal domain Integer Ring Codomain: Ambient free module of rank 3 over the principal ideal domain Integer Ring sage: f(E.an_element()) (0, 0, 0) sage: f(E.an_element()) == F.zero() True sage: H.zero("right") Free module morphism defined as left-multiplication by the matrix [0 0] [0 0] [0 0] Domain: Ambient free module of rank 2 over the principal ideal domain Integer Ring Codomain: Ambient free module of rank 3 over the principal ideal domain Integer Ring
>>> from sage.all import * >>> E = ZZ**Integer(2) >>> F = ZZ**Integer(3) >>> H = Hom(E, F) >>> f = H.zero() >>> f Free module morphism defined by the matrix [0 0 0] [0 0 0] Domain: Ambient free module of rank 2 over the principal ideal domain Integer Ring Codomain: Ambient free module of rank 3 over the principal ideal domain Integer Ring >>> f(E.an_element()) (0, 0, 0) >>> f(E.an_element()) == F.zero() True >>> H.zero("right") Free module morphism defined as left-multiplication by the matrix [0 0] [0 0] [0 0] Domain: Ambient free module of rank 2 over the principal ideal domain Integer Ring Codomain: Ambient free module of rank 3 over the principal ideal domain Integer Ring