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
1 changed files with 2 additions and 25 deletions

View File

@ -44,32 +44,9 @@ using Groups.KnuthBendix
F = Groups.object(G)
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