-
Notifications
You must be signed in to change notification settings - Fork 132
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
twisted modules #2807
twisted modules #2807
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2567,3 +2567,89 @@ function ideal_as_module(I::MPolyIdeal) | |
e1 = F[1] | ||
return sub(F, [x * e1 for x = gens(I)], :module) | ||
end | ||
|
||
|
||
|
||
########################################################################## | ||
##### Twists | ||
########################################################################## | ||
|
||
@doc raw""" | ||
twist(M::ModuleFP{T}, g::GrpAbFinGenElem) where {T<:MPolyDecRingElem} | ||
|
||
Return the twisted module `M(g)`. | ||
|
||
twist(M::ModuleFP{T}, W::Vector{<:IntegerUnion}) where {T<:MPolyDecRingElem} | ||
|
||
Given a module `M` over a $\mathbb Z^m$-graded polynomial ring and a vector `W` of $m$ integers, | ||
convert `W` into an element `g` of the grading group of the ring and proceed as above. | ||
|
||
twist(M::ModuleFP{T}, d::IntegerUnion) where {T<:MPolyDecRingElem} | ||
|
||
Given a module `M` over a $\mathbb Z$-graded polynomial ring and an integer `d`, | ||
convert `d` into an element `g` of the grading group of the ring and proceed as above. | ||
|
||
# Examples | ||
```jldoctest | ||
julia> R, (x, y) = graded_polynomial_ring(QQ, ["x", "y"]); | ||
|
||
julia> I = ideal(R, [zero(R)]) | ||
ideal(0) | ||
|
||
julia> M = quotient_ring_as_module(I) | ||
Graded submodule of R^1 | ||
1 -> e[1] | ||
represented as subquotient with no relations | ||
|
||
julia> degree(gen(M, 1)) | ||
[0] | ||
|
||
julia> N = twist(M, 2) | ||
Graded submodule of R^1 | ||
1 -> e[1] | ||
represented as subquotient with no relations | ||
|
||
julia> degree(gen(N, 1)) | ||
[-2] | ||
|
||
``` | ||
""" | ||
function twist(M::ModuleFP{T}, g::GrpAbFinGenElem) where {T<:MPolyDecRingElem} | ||
error("Not implemented for the given type") | ||
end | ||
|
||
function twist(M::SubquoModule{T}, g::GrpAbFinGenElem) where {T<:MPolyDecRingElem} | ||
R = base_ring(M) | ||
@req parent(g) == grading_group(R) "Group element not contained in grading group of base ring" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fieker Please clearify! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sideremark: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As confirmed by @fieker, it is as I thought: There is no difference between |
||
F = ambient_free_module(M) | ||
FN = twist(F, g) | ||
GN = free_module(R, ngens(M)) | ||
HN = free_module(R, length(relations(M))) | ||
a = hom(GN, F, ambient_representatives_generators(M)) | ||
b = hom(HN, F, relations(M)) | ||
A = matrix(a) | ||
B = matrix(b) | ||
N = subquotient(FN, A, B) | ||
return N | ||
end | ||
|
||
function twist(F::FreeMod{T}, g::GrpAbFinGenElem) where {T<:MPolyDecRingElem} | ||
R = base_ring(F) | ||
@req parent(g) == grading_group(R) "Group element not contained in grading group of base ring" | ||
W = [x-g for x in F.d] | ||
G = graded_free_module(R, rank(F)) | ||
G.d = W | ||
return G | ||
end | ||
|
||
function twist(M::ModuleFP{T}, W::Vector{<:IntegerUnion}) where {T<:MPolyDecRingElem} | ||
R = base_ring(M) | ||
@assert is_zm_graded(R) | ||
return twist(M, grading_group(R)(W)) | ||
end | ||
|
||
function twist(M::ModuleFP{T}, d::IntegerUnion) where {T<:MPolyDecRingElem} | ||
R = base_ring(M) | ||
@assert is_z_graded(R) | ||
return twist(M, grading_group(R)([d])) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not going to block this PR over this, but, normally we strive to indent code with (at least) two spaces.
(But of course we are already widely inconsistent about this, which is why I am not asking for it to be changed here and now, just wanted to point it out)