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:
parent
6b354d449b
commit
596744e5b8
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user