Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow submodule construction of a free module over a ring #37354

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/sage/modules/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# ****************************************************************************

from sage.modules.free_module import (
FreeModule_ambient_domain,
FreeModule_ambient,
Module_free_ambient,
basis_seq,
)
Expand Down Expand Up @@ -98,8 +98,19 @@ def __init__(self, ambient, gens, check=True, already_echelonized=False):
sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
sage: N.is_submodule(M)
True

::

sage: R.<x,y> = QQ[]
sage: S = R.quotient([x*y])
sage: M = FreeModule(S, 2)
sage: M.zero_submodule()
Submodule of Ambient free module of rank 2 over Quotient of Multivariate Polynomial Ring in x, y
over Rational Field by the ideal (x*y)
Generated by the rows of the matrix:
[]
"""
if not isinstance(ambient, (FreeModule_ambient_domain, QuotientModule_free_ambient)):
if not isinstance(ambient, (FreeModule_ambient, QuotientModule_free_ambient)):
raise TypeError("ambient (=%s) must be ambient or a quotient" % ambient)
R = ambient.base_ring()
degree = ambient.degree()
Expand Down
Loading