I noticed that when iterating over a finite group, not all elements are visited, and group elements can be visited twice.
Strangely, it looks fine when I only iterate and print:
using Groups
Z3 = FPGroup(FreeGroup(1), [only(gens(F))^3 => one(F)])
for g in Z3
println(g)
end
gives
But: As soon as I 'do' something with the gs, elements repeat:
julia> for g in Z3
push!(v, g)
end
julia> v
3-element Vector{FPGroupElement}:
(id)
f1
f1
The inverse of f1 is not present in v.
Similar problems occur when creating a dictionary:
julia> d = Dict()
Dict{Any, Any}()
julia> ig = 0
0
julia> for g in Z3
ig += 1
d[g]=ig
end
julia> display(d)
Dict{Any, Any} with 3 entries:
f1 => 2
(id) => 1
f1 => 3
Am I doing something wrong? I'm also wondering why the dictionary can have two keys f1.
I noticed that when iterating over a finite group, not all elements are visited, and group elements can be visited twice.
Strangely, it looks fine when I only iterate and print:
gives
But: As soon as I 'do' something with the
gs, elements repeat:The inverse of
f1is not present inv.Similar problems occur when creating a dictionary:
Am I doing something wrong? I'm also wondering why the dictionary can have two keys
f1.