1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-25 02:05:30 +01:00

letters(A::Alphabet) are no more

This commit is contained in:
Marek Kaluba 2022-10-13 23:21:42 +02:00
parent 2e544d623f
commit 30d58445df
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
5 changed files with 12 additions and 16 deletions

View File

@ -64,7 +64,7 @@ function SurfaceGroup(genus::Integer, boundaries::Integer)
F = FreeGroup(alphabet(rws))
rels = [F(lhs)=>F(rhs) for (lhs,rhs) in word_rels]
return SurfaceGroup(genus, boundaries, KnuthBendix.letters(Al)[2:2:end], rels, rws)
return SurfaceGroup(genus, boundaries, [Al[i] for i in 2:2:length(Al)], rels, rws)
end
rewriting(S::SurfaceGroup) = S.rws

View File

@ -4,8 +4,8 @@ include("gersten_relations.jl")
function SpecialAutomorphismGroup(F::FreeGroup; ordering = KnuthBendix.LenLex, kwargs...)
n = length(alphabet(F)) ÷ 2
A, rels = gersten_relations(n, commutative = false)
S = KnuthBendix.letters(A)[1:2(n^2-n)]
A, rels = gersten_relations(n, commutative=false)
S = [A[i] for i in 1:2:length(A)]
maxrules = 1000*n

View File

@ -144,7 +144,7 @@ end
function Base.getindex(lm::LettersMap, i::Integer)
# here i is an index of an alphabet
@boundscheck 1 i length(KnuthBendix.letters(lm.A))
@boundscheck 1 i length(lm.A)
if !haskey(lm.indices_map, i)
img = if haskey(lm.indices_map, inv(lm.A, i))

View File

@ -153,8 +153,7 @@ struct FreeGroup{T,O} <: AbstractFPGroup
function FreeGroup(gens, ordering::KnuthBendix.WordOrdering)
@assert length(gens) == length(unique(gens))
L = KnuthBendix.letters(alphabet(ordering))
@assert all(l -> l in L, gens)
@assert all(l -> l in alphabet(ordering), gens)
return new{eltype(gens),typeof(ordering)}(gens, ordering)
end
end
@ -163,12 +162,11 @@ FreeGroup(gens, A::Alphabet) = FreeGroup(gens, KnuthBendix.LenLex(A))
function FreeGroup(A::Alphabet)
@boundscheck @assert all(
KnuthBendix.hasinverse(l, A) for l in KnuthBendix.letters(A)
KnuthBendix.hasinverse(l, A) for l in A
)
ltrs = KnuthBendix.letters(A)
gens = Vector{eltype(ltrs)}()
invs = Vector{eltype(ltrs)}()
for l in ltrs
gens = Vector{eltype(A)}()
invs = Vector{eltype(A)}()
for l in A
l invs && continue
push!(gens, l)
push!(invs, inv(A, l))

View File

@ -9,10 +9,10 @@
pauts = let p = perm"(1,3,5)(2,4,6)"
[Groups.PermRightAut(p^i) for i in 0:2]
end
T = eltype(KnuthBendix.letters(alphabet(autπ₁Σ)))
T = eltype(alphabet(autπ₁Σ))
S = eltype(pauts)
A = Alphabet(Union{T,S}[KnuthBendix.letters(alphabet(autπ₁Σ)); pauts])
A = Alphabet(Union{T,S}[alphabet(autπ₁Σ)...; pauts])
autG = AutomorphismGroup(
π₁Σ,
@ -27,9 +27,7 @@
Al = alphabet(autπ₁Σ)
S = [gens(autπ₁Σ); inv.(gens(autπ₁Σ))]
sautFn = let ltrs = KnuthBendix.letters(Al)
parent(first(ltrs).autFn_word)
end
sautFn = parent(Al[1].autFn_word)
τ = Groups.rotation_element(sautFn)