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

add prune_with_map_projection #751

Merged
merged 5 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
18 changes: 17 additions & 1 deletion src/module/module.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export jet, minimal_generating_set, ModuleClass, rank, smodule, slimgb,
eliminate, modulo, lift, division, divrem, prune_with_map
eliminate, modulo, lift, division, divrem, prune_with_map,
prune_with_map_projection

###############################################################################
#
Expand Down Expand Up @@ -407,6 +408,21 @@ function prune_with_map(I::smodule{spoly{T}}) where T <: Nemo.FieldElem
return smodule{spoly{T}}(R, r),smatrix{spoly{T}}(R,TT_ptr)
end

@doc raw"""
prune_with_map_projection(id::smodule{spoly{T}}) where T <: Nemo.FieldElem

Returns the module R minimally embedded in a free module such that the
hannes14 marked this conversation as resolved.
Show resolved Hide resolved
corresponding factor modules are isomorphic,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this docstring: There is one argument id; it is not stated how it related to R. And then the next line, is that transformation matrix meant to be another return value?

How about this (assuming I guessed the meaning right, which I probably didn't):

Suggested change
Returns the module R minimally embedded in a free module such that the
corresponding factor modules are isomorphic,
Return a module `R`, a transformation matrix `M` and a projection map `p`
satisfying the following properties: `R` is minimally embedded in a free
module `parent(R)` such that the quotient `parent(R)/R` is isomorphic to `id`,
with `M` describing this isomorphism, and `p` mapping `gen(id, i)` to
`gen(id, p(i))`

I am still rather confused by the usage of gen(i) (what is i? An index ranging over 1 .. ngens(id) maybe?!?), and why p[i] -- is p a vector, or a function, or what?

the transformation matrix of id to R and a projection p
which maps gen(i) to gen(p[i]).
"""
function prune_with_map_projection(I::smodule{spoly{T}}) where T <: Nemo.FieldElem
R = base_ring(I)
a = Vector{Int32}()
r, TT_ptr = GC.@preserve I R libSingular.id_prune_map_v(I.ptr, a, R.ptr)
return smodule{spoly{T}}(R, r),smatrix{spoly{T}}(R,TT_ptr),a
end

@doc raw"""
nres(id::smodule{spoly{T}}, max_length::Int) where T <: Nemo.FieldElem

Expand Down
5 changes: 5 additions & 0 deletions test/module/smodule-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,9 @@ end
@test G[1] == vector(R, z)
@test T[3,1] == R(1)

G,T,p = prune_with_map_projection(M)
@test p[1] == 1
@test p[2] == 1
@test p[3] == 2

end
Loading