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

use KB.Settings to pass options to knuthbendix

This commit is contained in:
Marek Kaluba 2022-10-13 23:38:18 +02:00
parent 1345516521
commit c75ff00aa9
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
5 changed files with 9 additions and 9 deletions

View File

@ -74,7 +74,7 @@ relations(S::SurfaceGroup) = S.relations
function symplectic_twists(π₁Σ::SurfaceGroup) function symplectic_twists(π₁Σ::SurfaceGroup)
g = genus(π₁Σ) g = genus(π₁Σ)
saut = SpecialAutomorphismGroup(FreeGroup(2g), maxrules=100) saut = SpecialAutomorphismGroup(FreeGroup(2g), max_rules=1000)
Aij = [SymplecticMappingClass(saut, :A, i, j) for i in 1:g for j in 1:g if i≠j] Aij = [SymplecticMappingClass(saut, :A, i, j) for i in 1:g for j in 1:g if i≠j]

View File

@ -7,12 +7,12 @@ function SpecialAutomorphismGroup(F::FreeGroup; ordering = KnuthBendix.LenLex, k
A, rels = gersten_relations(n, commutative=false) A, rels = gersten_relations(n, commutative=false)
S = [A[i] for i in 1:2:length(A)] S = [A[i] for i in 1:2:length(A)]
maxrules = 1000*n max_rules = 1000 * n
rws = Logging.with_logger(Logging.NullLogger()) do
rws = KnuthBendix.RewritingSystem(rels, ordering(A)) rws = KnuthBendix.RewritingSystem(rels, ordering(A))
Logging.with_logger(Logging.NullLogger()) do
# the rws is not confluent, let's suppress warning about it # the rws is not confluent, let's suppress warning about it
KnuthBendix.knuthbendix!(rws; maxrules=maxrules, kwargs...) KnuthBendix.knuthbendix(rws, KnuthBendix.Settings(; max_rules=max_rules, kwargs...))
end end
return AutomorphismGroup(F, S, rws, ntuple(i -> gens(F, i), n)) return AutomorphismGroup(F, S, rws, ntuple(i -> gens(F, i), n))
end end

View File

@ -229,7 +229,7 @@ function FPGroup(
word_rels = [word(lhs) => word(rhs) for (lhs, rhs) in [relations(G); rels]] word_rels = [word(lhs) => word(rhs) for (lhs, rhs) in [relations(G); rels]]
rws = KnuthBendix.RewritingSystem(word_rels, ordering) rws = KnuthBendix.RewritingSystem(word_rels, ordering)
KnuthBendix.knuthbendix!(rws; kwargs...) rws = KnuthBendix.knuthbendix(rws, KnuthBendix.Settings(; kwargs...))
return FPGroup(G.gens, rels, rws) return FPGroup(G.gens, rels, rws)
end end

View File

@ -79,7 +79,7 @@
@test inv(l)(deepcopy(D)) == (a, d^-1*b,c, d) @test inv(l)(deepcopy(D)) == (a, d^-1*b,c, d)
end end
A = SpecialAutomorphismGroup(F4, maxrules=1000) A = SpecialAutomorphismGroup(F4, max_rules=1000)
@testset "AutomorphismGroup constructors" begin @testset "AutomorphismGroup constructors" begin
@test A isa Groups.AbstractFPGroup @test A isa Groups.AbstractFPGroup

View File

@ -40,7 +40,7 @@
end end
# quotient of G # quotient of G
H = FPGroup(G, [aG^2=>cG, bG*cG=>aG], maxrules=200) H = FPGroup(G, [aG^2 => cG, bG * cG => aG], max_rules=200)
h = H(word(g)) h = H(word(g))
@ -48,7 +48,7 @@
@test_throws AssertionError h == g @test_throws AssertionError h == g
@test_throws MethodError h*g @test_throws MethodError h*g
H = FPGroup(G, [aG^2=>cG, bG*cG=>aG], maxrules=200) H = FPGroup(G, [aG^2 => cG, bG * cG => aG], max_rules=200)
@test_throws AssertionError one(H) == one(H) @test_throws AssertionError one(H) == one(H)
Groups.normalform!(h) Groups.normalform!(h)