Skip to content

Commit 6496359

Browse files
author
Xavier Caruso
committed
fix doctests
1 parent 38bd756 commit 6496359

File tree

3 files changed

+63
-8
lines changed

3 files changed

+63
-8
lines changed

src/sage/modules/ore_module.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,10 @@ def __classcall_private__(cls, ambient, gens, saturate, names):
18121812
- ``gens`` -- a list of generators (formatted as coordinates
18131813
vectors) of this submodule
18141814
1815+
- ``saturate`` -- a boolean; if ``True``, return the saturation
1816+
of this submodule in the ambient space (see :meth:`saturate`
1817+
for more details)
1818+
18151819
- ``names`` -- the name of the vectors of the basis of
18161820
the submodule, or ``None``
18171821
@@ -1856,7 +1860,9 @@ def __init__(self, ambient, submodule, names) -> None:
18561860
- ``ambient`` -- a Ore module, the ambient module where
18571861
this submodule sits
18581862
1859-
- ``basis`` -- the echelon basis of this submodule
1863+
- ``submodule`` -- an instance of the class
1864+
:class:`sage.modules.submodule_helper.SubmoduleHelper`
1865+
describing this submodule
18601866
18611867
- ``names`` -- the name of the vectors of the basis of
18621868
the submodule, or ``None``
@@ -2024,6 +2030,15 @@ def saturate(self, names=None, coerce=False):
20242030
of `M` consisting of vectors `x` such that `a x \in N` for a
20252031
nonzero scalar `a` in the base ring.
20262032
2033+
INPUT:
2034+
2035+
- ``names`` -- a string or a list of strings, the names
2036+
of the vectors in a basis of the saturation
2037+
2038+
- ``coerce`` (default: ``False``) -- a boolean; if
2039+
``True``, a coercion map from this Ore module to
2040+
its saturation is set
2041+
20272042
EXAMPLES::
20282043
20292044
sage: A.<t> = GF(3)[]
@@ -2304,6 +2319,9 @@ def __classcall_private__(cls, cover, gens, remove_torsion, names):
23042319
- ``gens`` -- a list of generators (formatted as coordinates
23052320
vectors) of the submodule by which we quotient out
23062321
2322+
- ``remove_torsion`` -- a boolean; if ``True``, quotient
2323+
out in addition by the torsion
2324+
23072325
- ``names`` -- the name of the vectors of the basis of
23082326
the quotient, or ``None``
23092327
@@ -2350,8 +2368,9 @@ def __init__(self, cover, submodule, names) -> None:
23502368
- ``cover`` -- a Ore module, the cover module of this
23512369
quotient
23522370
2353-
- ``basis`` -- the echelon basis of the submodule
2354-
defining the quotient
2371+
- ``submodule`` -- an instance of the class
2372+
:class:`sage.modules.submodule_helper.SubmoduleHelper`
2373+
describing this submodule
23552374
23562375
- ``names`` -- the name of the vectors of the basis of
23572376
the submodule, or ``None``

src/sage/modules/ore_module_morphism.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,12 @@ def inverse(self):
733733

734734
def kernel(self, names=None):
735735
r"""
736-
Return ``True`` if this morphism is injective.
736+
Return the kernel of this morphism.
737+
738+
INPUT:
739+
740+
- ``names`` (default: ``None``) -- the name of the vectors in a
741+
basis of the kernel
737742
738743
EXAMPLES::
739744
@@ -766,7 +771,16 @@ def kernel(self, names=None):
766771

767772
def image(self, saturate=False, names=None):
768773
r"""
769-
Return ``True`` if this morphism is injective.
774+
Return the image of this morphism.
775+
776+
INPUT:
777+
778+
- ``saturate`` (default: ``False``) -- a boolean; if ``True``,
779+
return the saturation (in the codomain) of the image (see
780+
:meth:`saturate` for more details)
781+
782+
- ``names`` (default: ``None``) -- the name of the vectors in a
783+
basis of the image
770784
771785
EXAMPLES::
772786
@@ -793,7 +807,16 @@ def image(self, saturate=False, names=None):
793807

794808
def cokernel(self, remove_torsion=False, names=None):
795809
r"""
796-
Return ``True`` if this morphism is injective.
810+
Return the cokernel of this morphism.
811+
812+
INPUT:
813+
814+
- ``remove_torsion`` (default: ``False``) -- a boolean;
815+
if ``True``, return the cokernel quotiented out by its
816+
torsion part
817+
818+
- ``names`` (default: ``None``) -- the name of the vectors in a
819+
basis of the cokernel
797820
798821
EXAMPLES::
799822
@@ -818,7 +841,12 @@ def cokernel(self, remove_torsion=False, names=None):
818841

819842
def coimage(self, names=None):
820843
r"""
821-
Return ``True`` if this morphism is injective.
844+
Return the coimage of this morphism.
845+
846+
INPUT:
847+
848+
- ``names`` (default: ``None``) -- the name of the vectors in a
849+
basis of the coimage
822850
823851
EXAMPLES::
824852

src/sage/modules/submodule_helper.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,16 @@ def __eq__(self, other):
130130
sage: SH2 = SubmoduleHelper(matrix(Fq, [[2, 6]]))
131131
sage: SH1 == SH2
132132
True
133+
134+
::
135+
136+
sage: SHZ = SubmoduleHelper(matrix(ZZ, [[1, 3]]))
137+
sage: SHZ == SH1
138+
False
133139
"""
134-
return self.basis == other.basis
140+
sb = self.basis
141+
ob = other.basis
142+
return sb.parent() is ob.parent() and sb == ob
135143

136144

137145
class SubmoduleHelper_field(SubmoduleHelper):

0 commit comments

Comments
 (0)