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

use the forward evaluation to test preserving of the relator

This commit is contained in:
Marek Kaluba 2021-07-20 11:02:12 +02:00
parent 6b354d449b
commit 596744e5b8
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -45,31 +45,8 @@ using Groups.KnuthBendix
R = prod(commutator(gens(F, i), gens(F, i+genus)) for i in 1:genus)
## TODO: how to evaluate automorphisms properly??!!!
for g in T
w = one(word(g))
dg = Groups.domain(g)
gens_idcs = first.(word.(dg))
img = evaluate(g)
A = alphabet(first(dg))
ltrs_map = Vector{eltype(dg)}(undef, length(KnuthBendix.letters(A)))
for i in 1:length(KnuthBendix.letters(A))
if i in gens_idcs
ltrs_map[i] = img[findfirst(==(i), gens_idcs)]
else
ltrs_map[i] = inv(img[findfirst(==(inv(A, i)), gens_idcs)])
end
end
for l in word(R)
append!(w, word(ltrs_map[l]))
end
@test F(w) == R
@test g(R) == R
end
end