mirror of
https://github.com/kalmarek/SmallHyperbolic
synced 2025-02-17 10:30:54 +01:00
commit
ed5ba406b9
13
README.md
13
README.md
@ -5,7 +5,18 @@ The repository contains code for running experiments for
|
|||||||
[Marek Kaluba](https://kalmar.faculty.wmi.amu.edu.pl/) and
|
[Marek Kaluba](https://kalmar.faculty.wmi.amu.edu.pl/) and
|
||||||
[Stefan Witzel](https://www.math.uni-bielefeld.de/~switzel/).
|
[Stefan Witzel](https://www.math.uni-bielefeld.de/~switzel/).
|
||||||
|
|
||||||
There are three disjoint computations covered in this repository.
|
# Introduction
|
||||||
|
If you arrived here after reading the article looking for groups and
|
||||||
|
1. you don't understand any of this, you probably want to visit [this page](https://kalmarek.github.io/SmallHyperbolic/) instead;
|
||||||
|
2. you want just the machine-readable data, then the `json` file is available [here](https://github.com/kalmarek/SmallHyperbolic/blob/master/data/triangle_groups.json) (the file was generated by calling `julia ./scripts/create_json/create_json.jl`);
|
||||||
|
3. you want to re-run some of the computations that lead to the results, then continue reading.
|
||||||
|
|
||||||
|
# Computations
|
||||||
|
|
||||||
|
There are three disjoint computations covered in this repository:
|
||||||
|
1. certified eigenvalue computations for _PSL₂(p)_,
|
||||||
|
2. sum of squares computations in an attempt to prove property (T) by estimating spectral gap of the group Laplacian,
|
||||||
|
3. generation of magma files used to compute e.g. witnesses for non-hyperbolicity, rank of abelianization, etc.
|
||||||
|
|
||||||
## Eigenvalues computations for _PSL₂(p)_
|
## Eigenvalues computations for _PSL₂(p)_
|
||||||
|
|
||||||
|
@ -71,7 +71,8 @@ function adjacency(ϱ, a, b; prec=256)
|
|||||||
A = AcbMatrix(ϱ(a), prec = prec)
|
A = AcbMatrix(ϱ(a), prec = prec)
|
||||||
B = AcbMatrix(ϱ(b), prec = prec)
|
B = AcbMatrix(ϱ(b), prec = prec)
|
||||||
res = sum(A^i for i = 1:order_a-1) + sum(B^i for i = 1:order_b-1)
|
res = sum(A^i for i = 1:order_a-1) + sum(B^i for i = 1:order_b-1)
|
||||||
return Arblib.scalar_div!(res, res, k)
|
#return Arblib.scalar_div!(res, res, k)
|
||||||
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
function parse_our_args()
|
function parse_our_args()
|
||||||
@ -113,7 +114,8 @@ end
|
|||||||
parsed_args = parse_our_args()
|
parsed_args = parse_our_args()
|
||||||
|
|
||||||
const p = let p = parsed_args["p"]
|
const p = let p = parsed_args["p"]
|
||||||
isprime(p) || @error "You need to provide a prime, ex: `julia adj_psl2_eigvals.jl -p 31`"
|
isprime(p) ||
|
||||||
|
@error "You need to provide a prime, ex: `julia adj_psl2_eigvals.jl -p 31`"
|
||||||
p
|
p
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
using Pkg
|
|
||||||
Pkg.activate(@__DIR__)
|
|
||||||
using DelimitedFiles
|
|
||||||
using JSON
|
|
||||||
|
|
||||||
include(joinpath(@__DIR__, "parse_presentations.jl"))
|
|
||||||
include(joinpath(@__DIR__, "smallhyperbolicgrp.jl"))
|
|
||||||
|
|
||||||
all_grps_presentations =
|
|
||||||
let tables = [
|
|
||||||
joinpath(@__DIR__, f) for f in readdir(@__DIR__) if
|
|
||||||
isfile(joinpath(@__DIR__, f)) && endswith(f, ".txt")
|
|
||||||
]
|
|
||||||
mapreduce(parse_grouppresentations_abstract, union, tables) |> Dict
|
|
||||||
end
|
|
||||||
|
|
||||||
tr_grps =
|
|
||||||
let csvs = [
|
|
||||||
joinpath(@__DIR__, f) for f in readdir(@__DIR__) if
|
|
||||||
isfile(joinpath(@__DIR__, f)) && endswith(f, ".csv")
|
|
||||||
]
|
|
||||||
|
|
||||||
trGrps = mapreduce(union, csvs) do file
|
|
||||||
m = match(r".*_(\d)_(\d)_(\d).csv", basename(file))
|
|
||||||
@assert !isnothing(m)
|
|
||||||
type = parse.(Int, tuple(m[1], m[2], m[3]))
|
|
||||||
|
|
||||||
data = readdlm(file, '&')
|
|
||||||
labels = Symbol.(replace.(strip.(data[1, :]), ' ' => '_', '-' => '_'))
|
|
||||||
groups = data[2:end, :]
|
|
||||||
grps = map(enumerate(eachrow(groups))) do (i, props)
|
|
||||||
nt = (; (Symbol(l) => v for (l, v) in zip(labels, props))...)
|
|
||||||
@debug i, grp_name(nt)
|
|
||||||
P = all_grps_presentations[grp_name(nt)]
|
|
||||||
grp = TriangleGrp(type, P.generators, P.relations, nt)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
open(joinpath(@__DIR__, "triangle_groups.json"), "w") do io
|
|
||||||
f(args...) = show_json(args...; indent = 4)
|
|
||||||
s = sprint(f, TriangleGrpSerialization(), tr_grps)
|
|
||||||
# JSON.print(io, , 4)
|
|
||||||
print(io, s)
|
|
||||||
end
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# encoding: utf-8
|
|
||||||
"""Use instead of `python3 -m http.server` when you need CORS"""
|
|
||||||
|
|
||||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
|
||||||
|
|
||||||
class CORSRequestHandler(SimpleHTTPRequestHandler):
|
|
||||||
def end_headers(self):
|
|
||||||
self.send_header('Access-Control-Allow-Origin', '*')
|
|
||||||
self.send_header('Access-Control-Allow-Methods', 'GET')
|
|
||||||
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
|
|
||||||
return super(CORSRequestHandler, self).end_headers()
|
|
||||||
|
|
||||||
|
|
||||||
httpd = HTTPServer(('localhost', 8003), CORSRequestHandler)
|
|
||||||
httpd.serve_forever()
|
|
46
scripts/create_json/create_json.jl
Normal file
46
scripts/create_json/create_json.jl
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using Pkg
|
||||||
|
Pkg.activate(@__DIR__)
|
||||||
|
using DelimitedFiles
|
||||||
|
using JSON
|
||||||
|
|
||||||
|
include(joinpath(@__DIR__, "parse_presentations.jl"))
|
||||||
|
include(joinpath(@__DIR__, "smallhyperbolicgrp.jl"))
|
||||||
|
|
||||||
|
const DATA_DIR = joinpath(@__DIR__, "..", "..", "data")
|
||||||
|
|
||||||
|
function _files_with_extension(dir::AbstractString, ext::AbstractString)
|
||||||
|
return [
|
||||||
|
joinpath(dir, f) for
|
||||||
|
f in readdir(dir) if isfile(joinpath(dir, f)) && endswith(f, '.' * ext)
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
all_grps_presentations = let tables = _files_with_extension(DATA_DIR, "txt")
|
||||||
|
mapreduce(parse_grouppresentations_abstract, union, tables) |> Dict
|
||||||
|
end
|
||||||
|
|
||||||
|
grps = let csvs = _files_with_extension(DATA_DIR, "csv")
|
||||||
|
|
||||||
|
trGrps = mapreduce(union, csvs) do file
|
||||||
|
m = match(r".*_(\d)_(\d)_(\d).csv", basename(file))
|
||||||
|
@assert !isnothing(m)
|
||||||
|
type = parse.(Int, tuple(m[1], m[2], m[3]))
|
||||||
|
|
||||||
|
data = readdlm(file, '&')
|
||||||
|
labels = Symbol.(replace.(strip.(data[1, :]), ' ' => '_', '-' => '_'))
|
||||||
|
groups = data[2:end, :]
|
||||||
|
grps = map(enumerate(eachrow(groups))) do (i, props)
|
||||||
|
nt = (; (Symbol(l) => v for (l, v) in zip(labels, props))...)
|
||||||
|
# @debug i, grp_name(nt)
|
||||||
|
P = all_grps_presentations[grp_name(nt)]
|
||||||
|
grp = TriangleGrp(type, P.generators, P.relations, nt)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
open(joinpath(DATA_DIR, "triangle_groups.json"), "w") do io
|
||||||
|
f(args...) = show_json(args...; indent = 4)
|
||||||
|
s = sprint(f, TriangleGrpSerialization(), grps)
|
||||||
|
# JSON.print(io, , 4)
|
||||||
|
print(io, s)
|
||||||
|
end
|
@ -1,4 +1,4 @@
|
|||||||
include("../src/groupparse.jl")
|
include(joinpath(@__DIR__, "..", "..", "src", "groupparse.jl"))
|
||||||
|
|
||||||
function parse_grouppresentations_abstract(filename::AbstractString)
|
function parse_grouppresentations_abstract(filename::AbstractString)
|
||||||
lines = strip.(readlines(filename))
|
lines = strip.(readlines(filename))
|
Loading…
Reference in New Issue
Block a user