@@ -1570,6 +1570,41 @@ def submodule(self, gens, check=True):
1570
1570
"a submodule of self" % gens )
1571
1571
return V
1572
1572
1573
+ def quotient_module (self , sub , check = True ):
1574
+ r"""
1575
+ Return the quotient of ``self`` by the given subspace ``sub``.
1576
+
1577
+ INPUT:
1578
+
1579
+ - ``sub`` -- a submodule of ``self`` or something that can
1580
+ be turned into one via ``self.submodule(sub)``
1581
+ - ``check`` -- (default: ``True``) whether or not to check that
1582
+ ``sub`` is a submodule
1583
+
1584
+ EXAMPLES::
1585
+
1586
+ sage: S.<x,y,z> = PolynomialRing(QQ)
1587
+ sage: M = S**2
1588
+ sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
1589
+ sage: M.quotient(N)
1590
+ Quotient module by Submodule of Ambient free module of rank 2 over
1591
+ the integral domain Multivariate Polynomial Ring in x, y, z over Rational Field
1592
+ Generated by the rows of the matrix:
1593
+ [x - y z]
1594
+ [ y*z x*z]
1595
+ """
1596
+ if isinstance (sub , Module_free_ambient ) and self .base_ring () != sub .base_ring ():
1597
+ raise ValueError ("base rings must be the same" )
1598
+ if check and (not isinstance (sub , Module_free_ambient ) or not sub .is_submodule (self )):
1599
+ try :
1600
+ sub = self .submodule (sub )
1601
+ except (TypeError , ArithmeticError ):
1602
+ raise ArithmeticError ("sub must be a subspace of self" )
1603
+ from .quotient_module import QuotientModule_free_ambient
1604
+ return QuotientModule_free_ambient (self , sub )
1605
+
1606
+ quotient = quotient_module
1607
+
1573
1608
def __truediv__ (self , sub ):
1574
1609
"""
1575
1610
Return the quotient of ``self`` by the given submodule sub.
@@ -4120,15 +4155,12 @@ def quotient(self, sub, check=True, **kwds):
4120
4155
4121
4156
INPUT:
4122
4157
4123
- - ``sub`` - a submodule of self, or something that can
4124
- be turned into one via self.submodule(sub).
4125
-
4126
- - ``check`` - (default: True) whether or not to check
4127
- that sub is a submodule.
4128
-
4129
- - further named arguments, that are passed to the constructor
4130
- of the quotient space.
4131
-
4158
+ - ``sub`` -- a submodule of ``self``, or something that can
4159
+ be turned into one via ``self.submodule(sub)``
4160
+ - ``check`` -- (default: ``True``) whether or not to check
4161
+ that ``sub`` is a submodule
4162
+ - further named arguments, that are passed to the constructor
4163
+ of the quotient space
4132
4164
4133
4165
EXAMPLES::
4134
4166
@@ -4146,8 +4178,8 @@ def quotient(self, sub, check=True, **kwds):
4146
4178
if self .base_ring () == sage .rings .integer_ring .ZZ :
4147
4179
from .fg_pid .fgp_module import FGP_Module
4148
4180
return FGP_Module (self , sub , check = False , ** kwds )
4149
- else :
4150
- raise NotImplementedError ("quotients of modules over rings other than fields or ZZ is not fully implemented" )
4181
+
4182
+ raise NotImplementedError ("quotients of modules over rings other than fields or ZZ is not fully implemented" )
4151
4183
4152
4184
4153
4185
class FreeModule_generic_field (FreeModule_generic_pid ):
@@ -5001,13 +5033,10 @@ def quotient(self, sub, check=True):
5001
5033
5002
5034
INPUT:
5003
5035
5004
-
5005
- - ``sub`` - a submodule of self, or something that can
5006
- be turned into one via self.submodule(sub).
5007
-
5008
- - ``check`` - (default: True) whether or not to check
5009
- that sub is a submodule.
5010
-
5036
+ - ``sub`` -- a submodule of ``self``, or something that can
5037
+ be turned into one via ``self.submodule(sub)``
5038
+ - ``check`` -- (default: ``True``) whether or not to check
5039
+ that ``sub`` is a submodule
5011
5040
5012
5041
EXAMPLES::
5013
5042
@@ -6073,41 +6102,6 @@ def vector_space(self, base_field=None):
6073
6102
else :
6074
6103
return self .change_ring (base_field )
6075
6104
6076
- def quotient_module (self , sub , check = True ):
6077
- """
6078
- Return the quotient of this free module by the given subspace ``sub``.
6079
-
6080
- INPUT:
6081
-
6082
- - ``sub`` -- a submodule of this free module, or something that can
6083
- be turned into one via ``self.submodule(sub)``.
6084
-
6085
- - ``check`` -- (default: True) whether or not to check that ``sub`` is
6086
- a submodule
6087
-
6088
- EXAMPLES::
6089
-
6090
- sage: S.<x,y,z> = PolynomialRing(QQ)
6091
- sage: M = S**2
6092
- sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
6093
- sage: M.quotient(N)
6094
- Quotient module by Submodule of Ambient free module of rank 2 over the integral domain Multivariate Polynomial Ring in x, y, z over Rational Field
6095
- Generated by the rows of the matrix:
6096
- [x - y z]
6097
- [ y*z x*z]
6098
- """
6099
- if isinstance (sub , Module_free_ambient ) and self .base_ring () != sub .base_ring ():
6100
- raise ValueError ("base rings must be the same" )
6101
- if check and (not isinstance (sub , Module_free_ambient ) or not sub .is_submodule (self )):
6102
- try :
6103
- sub = self .submodule (sub )
6104
- except (TypeError , ArithmeticError ):
6105
- raise ArithmeticError ("sub must be a subspace of self" )
6106
- from .quotient_module import QuotientModule_free_ambient
6107
- return QuotientModule_free_ambient (self , sub )
6108
-
6109
- quotient = quotient_module
6110
-
6111
6105
6112
6106
###############################################################################
6113
6107
#
0 commit comments