Skip to content

Commit

Permalink
Merge pull request #646 from joschmitt/invariant_theory
Browse files Browse the repository at this point in the history
Grade the polynomial ring in an invariant ring
  • Loading branch information
fieker committed Sep 3, 2021
2 parents 83da04a + 1ffdfd9 commit 27693ca
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions experimental/InvariantTheory/invariant_rings.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export invariant_ring, primary_invariants, secondary_invariants, irreducible_secondary_invariants
export coefficient_ring, polynomial_ring, action, group
export ismodular
export reynolds_operator, invariant_basis, molien_series
export reynolds_operator, molien_series

###############################################

Expand All @@ -28,7 +28,7 @@ mutable struct InvRing{FldT, GrpT, PolyElemT, PolyRingT, ActionT, SingularAction

function InvRing(K::FldT, G::GrpT, action::Vector{ActionT}) where {FldT <: Field, GrpT <: AbstractAlgebra.Group, ActionT}
n = degree(G)
R, = PolynomialRing(K, "x" => 1:n, cached = false)
R, = grade(PolynomialRing(K, "x" => 1:n, cached = false)[1], ones(Int, n))
R_sing = singular_ring(R)
action_singular = identity.([change_base_ring(R_sing, g) for g in action])
PolyRingT = typeof(R)
Expand Down Expand Up @@ -192,10 +192,13 @@ with generators
AbstractAlgebra.Generic.MatSpaceElem{nf_elem}[[0 0 1; 1 0 0; 0 1 0], [1 0 0; 0 a 0; 0 0 -a-1]]
julia> R = polynomial_ring(IR)
Multivariate Polynomial Ring in x[1], x[2], x[3] over Cyclotomic field of order 3
Multivariate Polynomial Ring in x[1], x[2], x[3] over Cyclotomic field of order 3 graded by
x[1] -> [1]
x[2] -> [1]
x[3] -> [1]
julia> x=gens(R)
3-element Vector{AbstractAlgebra.Generic.MPoly{nf_elem}}:
julia> x = gens(R)
3-element Vector{MPolyElem_dec{nf_elem, AbstractAlgebra.Generic.MPoly{nf_elem}}}:
x[1]
x[2]
x[3]
Expand All @@ -222,10 +225,13 @@ with generators
gfp_mat[[0 1 0; 2 0 0; 0 0 2]]
julia> R = polynomial_ring(IR)
Multivariate Polynomial Ring in x[1], x[2], x[3] over Galois field with characteristic 3
Multivariate Polynomial Ring in x[1], x[2], x[3] over Galois field with characteristic 3 graded by
x[1] -> [1]
x[2] -> [1]
x[3] -> [1]
julia> x=gens(R)
3-element Vector{gfp_mpoly}:
julia> x = gens(R)
3-element Vector{MPolyElem_dec{gfp_elem, gfp_mpoly}}:
x[1]
x[2]
x[3]
Expand Down Expand Up @@ -254,6 +260,11 @@ function reynolds_operator(IR::InvRing{FldT, GrpT, T}, f::T) where {FldT, GrpT,
return polynomial_ring(IR)(gens(fReySing)[1])
end

function reynolds_operator(IR::InvRing, f::MPolyElem)
@assert parent(f) === polynomial_ring(IR).R
return reynolds_operator(IR, polynomial_ring(IR)(f))
end

function basis_via_reynolds(IR::InvRing, d::Int)
@assert d >= 0 "Dimension must be non-negative"
@assert !ismodular(IR)
Expand Down Expand Up @@ -300,7 +311,7 @@ end
Given an invariant ring `IR` and an integer `d`, return a basis for the invariants in degree `d`.
# Examples
```jldoctest
```
julia> K, a = CyclotomicField(3, "a")
(Cyclotomic field of order 3, a)
Expand All @@ -324,13 +335,13 @@ with generators
AbstractAlgebra.Generic.MatSpaceElem{nf_elem}[[0 0 1; 1 0 0; 0 1 0], [1 0 0; 0 a 0; 0 0 -a-1]]
julia> basis(IR, 6)
4-element Vector{AbstractAlgebra.Generic.MPoly{nf_elem}}:
4-element Vector{MPolyElem_dec{nf_elem, AbstractAlgebra.Generic.MPoly{nf_elem}}}:
x[1]^2*x[2]^2*x[3]^2
x[1]^3*x[2]^3 + x[1]^3*x[3]^3 + x[2]^3*x[3]^3
x[1]^4*x[2]*x[3] + x[1]*x[2]^4*x[3] + x[1]*x[2]*x[3]^4
x[1]^6 + x[2]^6 + x[3]^6
```
```jldoctest
```
julia> M = matrix(GF(3), [0 1 0; -1 0 0; 0 0 -1])
[0 1 0]
[2 0 0]
Expand All @@ -346,12 +357,12 @@ with generators
gfp_mat[[0 1 0; 2 0 0; 0 0 2]]
julia> basis(IR, 2)
2-element Vector{gfp_mpoly}:
2-element Vector{MPolyElem_dec{gfp_elem, gfp_mpoly}}:
x[3]^2
x[1]^2 + x[2]^2
julia> basis(IR, 3)
2-element Vector{gfp_mpoly}:
2-element Vector{MPolyElem_dec{gfp_elem, gfp_mpoly}}:
x[1]*x[2]*x[3]
x[1]^2*x[3] + 2*x[2]^2*x[3]
```
Expand Down Expand Up @@ -405,7 +416,7 @@ julia> G = MatrixGroup(3, K, [M1, M2]);
julia> IR = invariant_ring(G);
julia> primary_invariants(IR)
3-element Vector{AbstractAlgebra.Generic.MPoly{nf_elem}}:
3-element Vector{MPolyElem_dec{nf_elem, AbstractAlgebra.Generic.MPoly{nf_elem}}}:
x[1]*x[2]*x[3]
x[1]^3 + x[2]^3 + x[3]^3
x[1]^3*x[2]^3 + x[1]^3*x[3]^3 + x[2]^3*x[3]^3
Expand Down Expand Up @@ -469,7 +480,7 @@ julia> G = MatrixGroup(3, K, [M1, M2]);
julia> IR = invariant_ring(G);
julia> secondary_invariants(IR)
2-element Vector{AbstractAlgebra.Generic.MPoly{nf_elem}}:
2-element Vector{MPolyElem_dec{nf_elem, AbstractAlgebra.Generic.MPoly{nf_elem}}}:
1
x[1]^6*x[3]^3 + x[1]^3*x[2]^6 + x[2]^3*x[3]^6
```
Expand All @@ -492,15 +503,15 @@ Otherwise, compute and cache a system of secondary invariants first.
NOTE: A secondary invariant is *irreducible* if it cannot be written as a polynomial expession in the primary invariants and the other secondary invariants. The multiplicative unit 1 is not irreducible: It is considered to be the empty power product.
# Examples
```jldoctest
```
julia> M = matrix(QQ, [0 -1 0 0 0; 1 -1 0 0 0; 0 0 0 0 1; 0 0 1 0 0; 0 0 0 1 0]);
julia> G = MatrixGroup(5, QQ, [M]);
julia> IR = invariant_ring(G);
julia> secondary_invariants(IR)
12-element Vector{fmpq_mpoly}:
12-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
1
x[1]*x[3] - x[1]*x[5] - x[2]*x[3] + x[2]*x[4]
x[1]^2 - x[1]*x[2] + x[2]^2
Expand All @@ -515,7 +526,7 @@ julia> secondary_invariants(IR)
x[1]^5*x[3] - x[1]^5*x[5] - 3*x[1]^4*x[2]*x[3] + x[1]^4*x[2]*x[4] + 2*x[1]^4*x[2]*x[5] + 5*x[1]^3*x[2]^2*x[3] - 2*x[1]^3*x[2]^2*x[4] - 3*x[1]^3*x[2]^2*x[5] - 5*x[1]^2*x[2]^3*x[3] + 3*x[1]^2*x[2]^3*x[4] + 2*x[1]^2*x[2]^3*x[5] + 3*x[1]*x[2]^4*x[3] - 2*x[1]*x[2]^4*x[4] - x[1]*x[2]^4*x[5] - x[2]^5*x[3] + x[2]^5*x[4]
julia> irreducible_secondary_invariants(IR)
8-element Vector{fmpq_mpoly}:
8-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
x[1]*x[3] - x[1]*x[5] - x[2]*x[3] + x[2]*x[4]
x[1]^2 - x[1]*x[2] + x[2]^2
x[3]^2*x[5] + x[3]*x[4]^2 + x[4]*x[5]^2
Expand Down

0 comments on commit 27693ca

Please sign in to comment.