-
Notifications
You must be signed in to change notification settings - Fork 133
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
Grading + caching for affine algebra of torus invariants #3469
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -159,15 +159,13 @@ end | |||||
#Setting up invariant ring for fast torus algorithm. | ||||||
##################### | ||||||
|
||||||
mutable struct TorGrpInvRing | ||||||
@attributes mutable struct TorGrpInvRing | ||||||
field::Field | ||||||
poly_ring::MPolyDecRing #graded | ||||||
|
||||||
group::TorusGroup | ||||||
representation::RepresentationTorusGroup | ||||||
|
||||||
fundamental::Vector{MPolyDecRingElem} | ||||||
|
||||||
#Invariant ring of reductive group G (in representation R), no other input. | ||||||
function TorGrpInvRing(R::RepresentationTorusGroup) #here G already contains information n and rep_mat | ||||||
n = length(weights(R)) | ||||||
|
@@ -264,14 +262,9 @@ julia> fundamental_invariants(RT) | |||||
X[2]^2*X[3] | ||||||
``` | ||||||
""" | ||||||
function fundamental_invariants(z::TorGrpInvRing) | ||||||
if isdefined(z, :fundamental) | ||||||
return z.fundamental | ||||||
else | ||||||
R = z.representation | ||||||
z.fundamental = torus_invariants_fast(weights(R), polynomial_ring(z)) | ||||||
return z.fundamental | ||||||
end | ||||||
@attr function fundamental_invariants(z::TorGrpInvRing) | ||||||
R = z.representation | ||||||
return torus_invariants_fast(weights(R), polynomial_ring(z)) | ||||||
end | ||||||
|
||||||
function Base.show(io::IO, R::TorGrpInvRing) | ||||||
|
@@ -399,10 +392,14 @@ julia> affine_algebra(RT) | |||||
(Quotient of multivariate polynomial ring by ideal (-t[1]*t[3] + t[2]^2), Hom: quotient of multivariate polynomial ring -> graded multivariate polynomial ring) | ||||||
``` | ||||||
""" | ||||||
function affine_algebra(R::TorGrpInvRing) | ||||||
@attr function affine_algebra(R::TorGrpInvRing) | ||||||
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.
Suggested change
Here as well |
||||||
V = fundamental_invariants(R) | ||||||
s = length(V) | ||||||
S,t = polynomial_ring(field(group(representation(R))), "t"=>1:s) | ||||||
weights_ = zeros(Int, s) | ||||||
for i in 1:s | ||||||
weights_[i] = total_degree(V[i]) | ||||||
end | ||||||
S,_ = graded_polynomial_ring(field(group(representation(R))), "t"=>1:s; weights = weights_) | ||||||
R_ = polynomial_ring(R) | ||||||
StoR = hom(S,R_,V) | ||||||
I = kernel(StoR) | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please add the return type here to make the attribute lookup type stable
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 don't know what type to use here other than Vector{MPolyRingElem} or Vector{MPolyDecRingElem} - which are not concrete types.
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.
Faced the same issue with the other file - InvariantTheory.jl
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.
That's true. In most other places, we would add the field type as a type parameter to the invariant ring, which would then allow something smarter here.
But I think this is out of scope for this PR.
@fingolfin can you keep this in mind for some future refactoring?
This comment was marked as outdated.
Sorry, something went wrong.
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.
Sorry, I typed to slow. We can keep this here as is and I look into it in #3442.
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.
@lgoettgens sure, I actually had pointed out the same issue on a prior PR. We'll get there eventually ;-)