-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from kalmarek/enh/mcg
Add broader support for automorphism groups
- Loading branch information
Showing
16 changed files
with
914 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
name = "Groups" | ||
uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557" | ||
authors = ["Marek Kaluba <[email protected]>"] | ||
version = "0.6.0" | ||
version = "0.7.0" | ||
|
||
[deps] | ||
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" | ||
GroupsCore = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120" | ||
KnuthBendix = "c2604015-7b3d-4a30-8a26-9074551ec60a" | ||
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
ThreadsX = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d" | ||
|
||
[compat] | ||
AbstractAlgebra = "0.15, 0.16" | ||
GroupsCore = "^0.3" | ||
KnuthBendix = "^0.2.1" | ||
AbstractAlgebra = "0.22" | ||
GroupsCore = "0.4" | ||
KnuthBendix = "0.3" | ||
OrderedCollections = "1" | ||
ThreadsX = "^0.1.0" | ||
julia = "1.3, 1.4, 1.5, 1.6" | ||
PermutationGroups = "0.3" | ||
ThreadsX = "0.1" | ||
julia = "1.3" | ||
|
||
[extras] | ||
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
PermutationGroups = "8bc5a954-2dfc-11e9-10e6-cd969bffa420" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test", "BenchmarkTools", "AbstractAlgebra"] | ||
test = ["Test", "BenchmarkTools", "AbstractAlgebra", "PermutationGroups"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
struct SurfaceGroup{T, S, R} <: AbstractFPGroup | ||
genus::Int | ||
boundaries::Int | ||
gens::Vector{T} | ||
relations::Vector{<:Pair{S,S}} | ||
rws::R | ||
end | ||
|
||
include("symplectic_twists.jl") | ||
|
||
genus(S::SurfaceGroup) = S.genus | ||
|
||
function Base.show(io::IO, S::SurfaceGroup) | ||
print(io, "π₁ of the orientable surface of genus $(genus(S))") | ||
if S.boundaries > 0 | ||
print(io, " with $(S.boundaries) boundary components") | ||
end | ||
end | ||
|
||
function SurfaceGroup(genus::Integer, boundaries::Integer) | ||
@assert genus > 1 | ||
|
||
# The (confluent) rewriting systems comes from | ||
# S. Hermiller, Rewriting systems for Coxeter groups | ||
# Journal of Pure and Applied Algebra | ||
# Volume 92, Issue 2, 7 March 1994, Pages 137-148 | ||
# https://doi.org/10.1016/0022-4049(94)90019-1 | ||
# Note: the notation is "inverted": | ||
# a_g of the article becomes A_g here. | ||
|
||
ltrs = String[] | ||
for i in 1:genus | ||
subscript = join('₀'+d for d in reverse(digits(i))) | ||
append!(ltrs, ["A" * subscript, "a" * subscript, "B" * subscript, "b" * subscript]) | ||
end | ||
Al = Alphabet(reverse!(ltrs)) | ||
|
||
for i in 1:genus | ||
subscript = join('₀'+d for d in reverse(digits(i))) | ||
KnuthBendix.set_inversion!(Al, "a" * subscript, "A" * subscript) | ||
KnuthBendix.set_inversion!(Al, "b" * subscript, "B" * subscript) | ||
end | ||
|
||
if boundaries == 0 | ||
word = Int[] | ||
|
||
for i in reverse(1:genus) | ||
x = 4 * i | ||
append!(word, [x, x-2, x-1, x-3]) | ||
end | ||
comms = Word(word) | ||
word_rels = [ comms => one(comms) ] | ||
|
||
rws = KnuthBendix.RewritingSystem(word_rels, KnuthBendix.RecursivePathOrder(Al)) | ||
KnuthBendix.knuthbendix!(rws) | ||
elseif boundaries == 1 | ||
S = typeof(one(Word(Int[]))) | ||
word_rels = Pair{S, S}[] | ||
rws = RewritingSystem(word_rels, KnuthBendix.LenLex(Al)) | ||
else | ||
throw("Not Implemented") | ||
end | ||
|
||
F = FreeGroup(alphabet(rws)) | ||
rels = [F(lhs)=>F(rhs) for (lhs,rhs) in word_rels] | ||
|
||
return SurfaceGroup(genus, boundaries, KnuthBendix.letters(Al)[2:2:end], rels, rws) | ||
end | ||
|
||
rewriting(S::SurfaceGroup) = S.rws | ||
KnuthBendix.alphabet(S::SurfaceGroup) = alphabet(rewriting(S)) | ||
relations(S::SurfaceGroup) = S.relations | ||
|
||
function symplectic_twists(π₁Σ::SurfaceGroup) | ||
g = genus(π₁Σ) | ||
|
||
saut = SpecialAutomorphismGroup(FreeGroup(2g), maxrules=100) | ||
|
||
Aij = [SymplecticMappingClass(saut, :A, i, j) for i in 1:g for j in 1:g if i≠j] | ||
|
||
Bij = [SymplecticMappingClass(saut, :B, i, j) for i in 1:g for j in 1:g if i≠j] | ||
|
||
mBij = [SymplecticMappingClass(saut, :B, i, j, minus=true) for i in 1:g for j in 1:g if i≠j] | ||
|
||
Bii = [SymplecticMappingClass(saut, :B, i, i) for i in 1:g] | ||
|
||
mBii = [SymplecticMappingClass(saut, :B, i, i, minus=true) for i in 1:g] | ||
|
||
return [Aij; Bij; mBij; Bii; mBii] | ||
end | ||
|
||
KnuthBendix.alphabet(G::AutomorphismGroup{<:SurfaceGroup}) = rewriting(G) | ||
|
||
function AutomorphismGroup(π₁Σ::SurfaceGroup; kwargs...) | ||
S = vcat(symplectic_twists(π₁Σ)...) | ||
A = Alphabet(S) | ||
|
||
# this is to fix the definitions of symplectic twists: | ||
# with i->gens(π₁Σ, i) the corresponding automorphisms return | ||
# reversed words | ||
domain = ntuple(i->inv(gens(π₁Σ, i)), 2genus(π₁Σ)) | ||
return AutomorphismGroup(π₁Σ, S, A, domain) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
80f7f6e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
80f7f6e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/45684
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: