Skip to content

Commit

Permalink
Fix ambient_module(M::SubquoModule) (oscar-system#3448)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored and mjrodgers committed Feb 28, 2024
1 parent 1deefb6 commit 807eaac
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Modules/UngradedModules/SubquoModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1657,16 +1657,30 @@ If $M = (P + Q) / Q$ then return $F / Q$ where `F == ambient_free_module(M)`.
If $M$ is a submodule of a free module, then the (ambient) free module is returned.
If `task == :with_morphism`, return also the canonical inclusion.
# Examples
```jldoctest
julia> mat = matrix(QQ, [0 -1; 0 0]);
julia> U = image(mat)
Submodule with 1 generator
1 -> -e[2]
represented as subquotient with no relations.
julia> ambient_module(U)
Free module of rank 2 over Rational field
```
"""
function ambient_module(M::SubquoModule, task = :none)
F = ambient_free_module(M)
if !isdefined(M, :quo)
if task == :none
return F
else
return F, hom(M,F,[repres(v) for v in gens(M)])
end
end
F = ambient_free_module(M)
g = SubModuleOfFreeModule(F,basis(F))
SQ = SubquoModule(g, M.quo)
if task == :none
Expand Down

0 comments on commit 807eaac

Please sign in to comment.