simplify parametrisation of SLn and Spn

This commit is contained in:
Marek Kaluba 2023-03-15 18:25:55 +01:00
parent 116439d074
commit 40cd92e3c4
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 21 additions and 22 deletions

View File

@ -1,25 +1,26 @@
include("eltary_matrices.jl")
struct SpecialLinearGroup{N,T,R,A,S} <: AbstractMatrixGroup{N,T}
struct SpecialLinearGroup{N,T,R,S} <: AbstractMatrixGroup{N,T}
base_ring::R
alphabet::A
gens::S
alphabet::Alphabet{S}
gens::Vector{S}
function SpecialLinearGroup{N}(base_ring) where {N}
S = [ElementaryMatrix{N}(i, j, one(base_ring)) for i in 1:N for j in 1:N if i j]
S = [
ElementaryMatrix{N}(i, j, one(base_ring)) for i in 1:N for
j in 1:N if i j
]
alphabet = Alphabet(S)
return new{
N,
eltype(base_ring),
typeof(base_ring),
typeof(alphabet),
typeof(S)
}(base_ring, alphabet, S)
T = eltype(base_ring)
R = typeof(base_ring)
St = eltype(S)
return new{N,T,R,St}(base_ring, alphabet, S)
end
end
GroupsCore.ngens(SL::SpecialLinearGroup{N}) where {N} = N^2 - N
GroupsCore.ngens(SL::SpecialLinearGroup) = length(SL.gens)
function Base.show(io::IO, ::SpecialLinearGroup{N,T}) where {N,T}
return print(io, "SL{$N,$T}")

View File

@ -1,21 +1,19 @@
include("eltary_symplectic.jl")
struct SymplecticGroup{N,T,R,A,S} <: AbstractMatrixGroup{N,T}
struct SymplecticGroup{N,T,R,S} <: AbstractMatrixGroup{N,T}
base_ring::R
alphabet::A
gens::S
alphabet::Alphabet{S}
gens::Vector{S}
function SymplecticGroup{N}(base_ring) where {N}
S = symplectic_gens(N, eltype(base_ring))
alphabet = Alphabet(S)
return new{
N,
eltype(base_ring),
typeof(base_ring),
typeof(alphabet),
typeof(S)
}(base_ring, alphabet, S)
T = eltype(base_ring)
R = typeof(base_ring)
St = eltype(S)
return new{N,T,R,St}(base_ring, alphabet, S)
end
end