From 11f54425622821e27b8e108a1e6c59fd30dd7d96 Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Thu, 29 Feb 2024 16:32:27 +0100 Subject: [PATCH] Add fields for fundamental invariants and presentation as affine algebra --- .../InvariantTheory/src/InvariantTheory.jl | 76 +++++++++++-------- .../src/TorusInvariantsFast.jl | 55 ++++++++------ 2 files changed, 76 insertions(+), 55 deletions(-) diff --git a/experimental/InvariantTheory/src/InvariantTheory.jl b/experimental/InvariantTheory/src/InvariantTheory.jl index 05870684c81a..aaa97b0ea37b 100644 --- a/experimental/InvariantTheory/src/InvariantTheory.jl +++ b/experimental/InvariantTheory/src/InvariantTheory.jl @@ -279,24 +279,29 @@ end ########################## #Invariant Rings of Reductive groups ########################## -@attributes mutable struct RedGroupInvarRing - field::Field - poly_ring::MPolyDecRing #graded +@attributes mutable struct RedGroupInvarRing{FldT, PolyRingElemT, PolyRingT} + field::FldT + poly_ring::PolyRingT # graded group::LinearlyReductiveGroup representation::RepresentationLinearlyReductiveGroup reynolds_operator::Function + fundamental::Vector{PolyRingElemT} + presentation::MPolyAnyMap{MPolyQuoRing{PolyRingElemT}, PolyRingT, Nothing, PolyRingElemT} + #Invariant ring of reductive group G (in representation R), no other input. function RedGroupInvarRing(R::RepresentationLinearlyReductiveGroup) #here G already contains information n and rep_mat - z = new() + G = group(R) + K = field(G) n = ncols(R.rep_mat) + poly_ring, _ = graded_polynomial_ring(K, "X" => 1:n) + z = new{typeof(K), elem_type(poly_ring), typeof(poly_ring)}() z.representation = R - z.group = R.group - G = z.group - z.field = G.field - z.poly_ring, _ = graded_polynomial_ring(G.field, "X" => 1:n) + z.group = G + z.field = K + z.poly_ring = poly_ring z.reynolds_operator = reynolds_v_slm return z end @@ -305,14 +310,15 @@ end function RedGroupInvarRing(R::RepresentationLinearlyReductiveGroup, ring::MPolyDecRing) n = ncols(R.rep_mat) n == ngens(ring) || error("The given polynomial ring is not compatible.") - z = new() + G = group(R) + K = field(G) + z = new{typeof(K), elem_type(ring), typeof(ring)}() if isdefined(R, :weights) #dosomething end z.representation = R - z.group = R.group - G = R.group - z.field = G.field + z.group = G + z.field = K z.poly_ring = ring z.reynolds_operator = reynolds_v_slm return z @@ -369,8 +375,6 @@ polynomial_ring(R::RedGroupInvarRing) = R.poly_ring group(R::RedGroupInvarRing) = R.group representation(R::RedGroupInvarRing) = R.representation - - @doc raw""" fundamental_invariants(RG::RedGroupInvarRing) @@ -390,11 +394,14 @@ julia> fundamental_invariants(RG) ``` """ -@attr function fundamental_invariants(z::RedGroupInvarRing) #unable to use abstract type - R = z.representation - I, M = proj_of_image_ideal(R.group, R.rep_mat) - null_cone_ideal(z) = ideal(generators(R.group, I, R.rep_mat)) - return inv_generators(null_cone_ideal(z), R.group, z.poly_ring, M, z.reynolds_operator) +function fundamental_invariants(z::RedGroupInvarRing) #unable to use abstract type + if !isdefined(z, :fundamental) + R = z.representation + I, M = proj_of_image_ideal(R.group, R.rep_mat) + null_cone_ideal(z) = ideal(generators(R.group, I, R.rep_mat)) + z.fundamental = inv_generators(null_cone_ideal(z), R.group, z.poly_ring, M, z.reynolds_operator) + end + return copy(z.fundamental) end function Base.show(io::IO, R::RedGroupInvarRing) @@ -646,18 +653,21 @@ julia> A, AtoS = affine_algebra(RG) (Quotient of multivariate polynomial ring by ideal (0), Hom: A -> S) ``` """ -@attr function affine_algebra(R::RedGroupInvarRing) - V = fundamental_invariants(R) - s = length(V) - 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) - Q, StoQ = quo(S,I) - QtoR = hom(Q,R_,V) - return Q, QtoR +function affine_algebra(R::RedGroupInvarRing) + if !isdefined(R, :presentation) + V = fundamental_invariants(R) + s = length(V) + 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) + Q, StoQ = quo(S,I) + QtoR = hom(Q,R_,V) + R.presentation = QtoR + end + return domain(R.presentation), R.presentation end diff --git a/experimental/InvariantTheory/src/TorusInvariantsFast.jl b/experimental/InvariantTheory/src/TorusInvariantsFast.jl index d70f56c9adb5..c04034b68800 100644 --- a/experimental/InvariantTheory/src/TorusInvariantsFast.jl +++ b/experimental/InvariantTheory/src/TorusInvariantsFast.jl @@ -161,13 +161,17 @@ end #Setting up invariant ring for fast torus algorithm. ##################### -@attributes mutable struct TorGroupInvarRing - field::Field - poly_ring::MPolyDecRing #graded +@attributes mutable struct TorGroupInvarRing{FldT, PolyRingElemT, PolyRingT} + field::FldT + poly_ring::PolyRingT #graded group::TorusGroup representation::RepresentationTorusGroup + fundamental::Vector{PolyRingElemT} + presentation::MPolyAnyMap{MPolyQuoRing{PolyRingElemT}, PolyRingT, Nothing, PolyRingElemT} + + #Invariant ring of reductive group G (in representation R), no other input. function TorGroupInvarRing(R::RepresentationTorusGroup) #here G already contains information n and rep_mat n = length(weights(R)) @@ -177,9 +181,10 @@ end #to compute invariant ring ring^G where G is the reductive group of R. function TorGroupInvarRing(R::RepresentationTorusGroup, ring_::MPolyDecRing) - z = new() + K = field(group(R)) + z = new{typeof(K), elem_type(ring_), typeof(ring_)}() n = length(weights(R)) - z.field = field(group(R)) + z.field = K z.poly_ring = ring_ z.representation = R z.group = group(R) @@ -264,9 +269,12 @@ julia> fundamental_invariants(RT) X[2]^2*X[3] ``` """ -@attr function fundamental_invariants(z::TorGroupInvarRing) - R = z.representation - return torus_invariants_fast(weights(R), polynomial_ring(z)) +function fundamental_invariants(z::TorGroupInvarRing) + if !isdefined(z, :fundamental) + R = z.representation + z.fundamental = torus_invariants_fast(weights(R), polynomial_ring(z)) + end + return copy(z.fundamental) end function Base.show(io::IO, R::TorGroupInvarRing) @@ -394,18 +402,21 @@ 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) ``` """ -@attr function affine_algebra(R::TorGroupInvarRing) - V = fundamental_invariants(R) - s = length(V) - 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) - Q, StoQ = quo(S,I) - QtoR = hom(Q,R_,V) - return Q, QtoR +function affine_algebra(R::TorGroupInvarRing) + if !isdefined(R, :presentation) + V = fundamental_invariants(R) + s = length(V) + 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) + Q, StoQ = quo(S,I) + QtoR = hom(Q,R_,V) + R.presentation = QtoR + end + return domain(R.presentation), R.presentation end