-
Notifications
You must be signed in to change notification settings - Fork 126
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
Injective and irreducible resolutions of Q-graded modules #4100
base: master
Are you sure you want to change the base?
Conversation
A = Nothing | ||
b = Nothing |
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.
A = Nothing | |
b = Nothing |
|
||
Given a homogeneous prime ideal, return the corresponding face F | ||
|
||
INPUT: prime ideal p_F |
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.
prime ideal in what kind of ring?
#get generators of k[F] = k[Q]/P_F | ||
Q_F,_ = quo(R_Q,P_F) | ||
G_F = gens(Q_F) | ||
L_F = (P_F,[]) |
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.
Hmm, I am confused. You never access L_F[1]
. Could you perhaps do this
L_F = (P_F,[]) | |
L_F = [] |
and then below replace L_F[2]
by just L_F
?
In addition []
is a Vector{Any}
which isn't great for type stability.
function get_all_ass_primes(I) | ||
R_Q = base_ring(I) | ||
I_m = ideal(R_Q,gens(R_Q)) #maximal ideal | ||
F_m = get_face_to_prime(I_m)[1] |
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.
Why does get_all_ass_primes
return multiple values if you only use the first? Perhaps it should also return a FaceQ
as its name suggests?
# some composite types | ||
######################### | ||
|
||
struct FaceQ # face of semigroup |
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.
What is a "face of semigroup" ? And what does the Q
stand for here?
else | ||
R_poly = base_ring(R_N) | ||
end | ||
T = typeof(zero(R_N)) |
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.
This really should be
T = typeof(zero(R_N)) | |
T = elem_type(R_N) |
also elsewhere in similar situations
if is_zero(J) | ||
return I | ||
else |
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.
More idiomatic:
if is_zero(J) | |
return I | |
else | |
is_zero(J) && return I |
G = [] | ||
for g in gens(I) | ||
push!(G,monomial_basis(S,degree(g))[1]) | ||
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.
More idiomatic and also more type stable (i.e., the vector this produces not always a Vector{Any}
) is to use a list comprehension:
G = [] | |
for g in gens(I) | |
push!(G,monomial_basis(S,degree(g))[1]) | |
end | |
G = [monomial_basis(S,degree(g))[1] for g in gens(I)] |
V = Vector{T}() | ||
for g in gens(I) | ||
push!(V,g*f) | ||
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.
V = Vector{T}() | |
for g in gens(I) | |
push!(V,g*f) | |
end | |
V = [g*f for g in gens(I)] |
#alternative to quotient_ring_as_module(I), which gives wrong result when base_ring(I) = quotient ring | ||
#INPUT: ideal I | ||
#OUTPUT: quotient S/I as SubquoModule (S = base_ring(I)) | ||
function quotient_by_ideal(I::Ideal) |
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.
The name of this function and the comment leave me really confused. This is not something that should be reachable as Oscar.quotient_by_ideal
. Might be acceptable if hidden in a submodule.
Last night I was a bit terse in what I wrote here, so I'd like to clarify that overall I think this looks like a very valuable pull request, thank you for starting on it! My comments are all on a relatively low-level technical level, and I think most of them are trivial to address, but also not urgent, i.e. it is fine to only address them gradually. Also feel free to ask resp. push back if something is unclear or seems unreasonable to you. As an example: the name Anyway, thanks again for making this PR in the first place and I look forward to seeing how it evolves. |
##Let W = k{Q\(a + F - Q)} and let H be a hyperplane containing F as a subset. | ||
##Calculates generators of k{(a + H_+^°)\cap Q}. | ||
##INPUT: semigroup Q_P as a polyhedron | ||
# zonotope G_Q of Q_P as in Lemma 3.10 |
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.
Excellent: I really appreciate these references to specific lemmas and theorems in the code, that will surely be a great asset to people in the future!
One tiny request, though: it is not immediately clear to me to which book or article these reference -- presumably https://arxiv.org/abs/math/0309256 from the PR description? If so, it would be great if e.g. at the top of this file, or in the README (or both places) this link could appear to remove any ambiguity (also, once this PR is merged, someone might read the code w/o knowing which PR it came from, so they wouldn't about that arXiv link at all.
(long term we'd put this paper into our bib file, too, but no need to do that now unless you really want to for some reason.)
Dear Anna and Thomas,
thanks a lot for this PR which is very welcome! I agree that OSCAR should have column operations and saturation also for modules and not only for ideals. This is on my todo list and I will do it asap. Let us keep in touch on this and your PR and feel free to suggest other features to be added to OSCAR.
Best wishes,
Wolfram
… Am 16.09.2024 um 19:07 schrieb Thomas Kahle ***@***.***>:
This is a draft pull request as recommended here <https://docs.oscar-system.org/stable/DeveloperDocumentation/new_developers/>.
Anna Hofer @annahofer00 <https://github.com/annahofer00> has been working on an implementation of the algorithms of Helm/Miller <https://arxiv.org/abs/math/0309256> and here we are now trying to put this into OSCAR. At the moment this code can compute some irreducible resolutions, but polyhedral pre-computation is done by hand. This needs to be automated.
The code also relies on the computation of certain colon-modules that is not yet available in OSCAR but maybe it should be.
Specifically, if I is an ideal in a ring R and M an R-Module then we need 0 :_M I = {m \in M : mI = 0}. As a module this is isomorphic to Hom(R/I, M) but one has to be careful with degree information (in the graded case). I think it would be good to implement a general purpose "module quotient" function like this one in Macaualy2 <https://www.macaulay2.com/doc/Macaulay2/share/doc/Macaulay2/Saturation/html/_quotient_lp__Module_cm__Module_rp.html>, which has the very practical operator : for this purpose. Many of these colons also have a saturation, where this is repeated to stabilization.
Any comments are welcome of course. We'll keep adding to this branch for now.
You can view, comment on, or merge this pull request online at:
#4100 <#4100>
Commit Summary
1abd83b <1abd83b> Starting to add injective resolutions to experimental
848b11c <848b11c> Added examples and some docs
723a444 <723a444> Merge branch 'oscar-system:master' into tk/injective_resolutions
File Changes (12 files <https://github.com/oscar-system/Oscar.jl/pull/4100/files>)
A experimental/InjectiveResolutions/README.md <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-f5dfd250e56e0265055485ded0f946d1bdbf5af60b9769078b18b4e8f7f7d858> (10)
A experimental/InjectiveResolutions/docs/doc.main <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-166ef4aefe31471a4af6a797c8aa690d2973152c34986edbba4c0190f5e34fc1> (6)
A experimental/InjectiveResolutions/src/InjectiveResolutions.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-3dfbaed4e7c48f10607c2560ff65d41fdd9fb7aa431f101cea7681fb894188db> (573)
A experimental/InjectiveResolutions/src/examples/polynomialRing/poly_ring_1.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-7fce5077c6f3483d538c0cc7401e2e4af4163b4a85a1c001f7f930c5afb7332e> (66)
A experimental/InjectiveResolutions/src/examples/polynomialRing/poly_ring_1_shifted.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-e23d309617897d26017a7e1afc0027eacf2ed31bee1f24e1e77aa0e079cfb0a0> (80)
A experimental/InjectiveResolutions/src/examples/semigroupRing/semi_group_1.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-9704fd88fdcb17849c47bcd413863ccf53441db8eb9d9576cf370c9c80accf62> (75)
A experimental/InjectiveResolutions/src/examples/semigroupRing/semi_group_1_shifted.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-30025847252fbb475146349c5a9b372dda56bb6026c8e994aa115be43d58ab69> (127)
A experimental/InjectiveResolutions/src/examples/semigroupRing/semi_group_3.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-175d9ed6d055955ffd2402beb651ee235da77803e2d4ec02722811c76c461784> (80)
A experimental/InjectiveResolutions/src/examples/semigroupRing/semi_group_3_shifted.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-cd262b47314bddec9483415f5b23c8a85800257a7c3f96060ebba59cb2e39723> (103)
A experimental/InjectiveResolutions/src/examples/semigroupRing/semi_group_4.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-0810f8b83031ce16cf1bf4c3244896564461468a7ec52e88cebe9c9bfc79c55c> (83)
A experimental/InjectiveResolutions/src/examples/semigroupRing/semi_group_5.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-273739c9be770df876566d5825b3d19090ac218ccf0997e2b1fb2c4ba697d099> (111)
A experimental/InjectiveResolutions/test/runtests.jl <https://github.com/oscar-system/Oscar.jl/pull/4100/files#diff-71317320e2c28f256fe9b4da2cbeb454edd6c9d6113668630dfd9f3a28163543> (3)
Patch Links:
https://github.com/oscar-system/Oscar.jl/pull/4100.patch <https://github.com/oscar-system/Oscar.jl/pull/4100.patch>
https://github.com/oscar-system/Oscar.jl/pull/4100.diff <https://github.com/oscar-system/Oscar.jl/pull/4100.diff>
—
Reply to this email directly, view it on GitHub <#4100>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AASSXEQD2QYD7FHNHS5XHUTZW4F45AVCNFSM6AAAAABOJXMNFCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUZDSMBQGIYTANI>.
You are receiving this because you are subscribed to this thread.
|
Thanks everyone for the comments so far. I understand that there are many issues with the code as it stands now. We have a limited understanding of both stylistic conventions and inner workings of OSCAR. I think the detailed analysis, naming conventions, etc. can be deferred a little. Let me ask on a more strategic level: Most of the time, we will work with modules over affine semigroup rings. Such a ring can be presented a quotient of a polynomial ring modulo a toric ideal and comes with different polyhedral and algebraic data attached to it. For example, it is graded by a finitely generated subsemigroup of ZZ^d (we always refer to this as 'Q'). This monoid lives inside a polyhedral cone, and the faces of that cone correspond 1:1 to Q-graded prime ideals. The data structures of our injective modules and local cohomlogy are often polyhedral in nature, which is why we are really hopeful that OSCAR is the right system to do this in. Does it make sense to abstract such monoid algebras (some people say affine semigroup rings) in OSCAR before getting started? At the moment, such a ring would be represented in OSCAR as a normal quotient ring. We will have R a polynomial ring, I a toric ideal and then our base_ring for most of what we do will be S = R/I (together with its multigrading, which is very important). In fact, the same question arises for the grading. Mathematically it is by a monoid Q, but we will (have to) use equivalence classes of vectors in ZZ^d instead, i.e. work in a presentation. Now If J is an ideal of S and we construct the quotient S/J, then this is automatically turned into R/(I+J). I understand that this is what is needed internally, but for what I'm modeling, S/J is an S-module. That's the structure we want, e.g. compute the injective resolution of S/J as an S-module. Everything will be Q-graded S-modules from here on. So, for example, Is this pull request the correct place to discuss such questions? Another basic question: In this case, there is this one paper where we take all our notation from. Is it fair to assume (in the docs and comments) that people have read that paper? |
@micjoswig or other commutative algebra people, do you think you can say something about this? |
Will do next Monday. |
Answer after discussing with @micjoswig and @flenzen:
Yes, because we have affine algebras, we suggest something like Eventually this should tie in with our standard graded rings and modules. Once you reach this stage, please talk to @HechtiDerLachs .
That should take care of this issue.
We just looked at the documentation of
Yes. You can also ask questions in the slack.
Yes, please add an bib entry as described in our reference docs if necessary, and use this to references notation. Please note that the Miller Sturmfels book is already citable as MS05. Textbook references are preferred if viable. |
Sorry for the delay. |
Thanks everybody. We will get to work as soon as possible and proceed as suggested here. |
I had a quick glance at the examples in the PR here, but could not find an instance where this is used yet (maybe I looked at the wrong place). But from what you are saying, I think it is about the following situation (correct me if I am wrong):
Is this correct? (I could not reproduce the "automatically turned into R/(I + J)" part.) (Another difference would be that |
May be I misunderstand the discussion here, but should we not extend the function function quotient_ring_as_module(I::Union{MPolyIdeal, MPolyQuoIdeal}) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4100 +/- ##
==========================================
- Coverage 84.59% 84.22% -0.38%
==========================================
Files 631 632 +1
Lines 84906 85289 +383
==========================================
+ Hits 71830 71832 +2
- Misses 13076 13457 +381
|
Thanks everyone! I just started working on this project again. I have introduced a type MonoidAlgebra as a struct with different fields for the auxiliary data. Is this the right way to go? The rest of the code I am still working on and I don’t need any comments on it at the moment. |
It looks good to me. I assume that you need this auxiliary data like Also I wonder whether there is documentation on our ring interface, maybe @thofma can help me out. |
In case you need it, there is a (I think) nice example for what a ring should implement here: https://nemocas.github.io/AbstractAlgebra.jl/stable/ring_interface/#Minimal-example-of-ring-implementation. Also feel free to drop me a message on slack if there are some specific questions. |
This is a draft pull request as recommended here.
Anna Hofer @annahofer00 has been working on an implementation of the algorithms of Helm/Miller and here we are now trying to put this into OSCAR. At the moment this code can compute some irreducible resolutions, but polyhedral pre-computation is done by hand. This needs to be automated.
The code also relies on the computation of certain colon-modules that is not yet available in OSCAR but maybe it should be.
Specifically, if I is an ideal in a ring R and M an R-Module then we need 0 :_M I = {m \in M : mI = 0}. As a module this is isomorphic to Hom(R/I, M) but one has to be careful with degree information (in the graded case). I think it would be good to implement a general purpose "module quotient" function like this one in Macaualy2, which has the very practical operator
:
for this purpose. Many of these colons also have a saturation, where this is repeated to stabilization.Any comments are welcome of course. We'll keep adding to this branch for now.