1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-11-30 17:15:28 +01:00

nicer error handling

This commit is contained in:
kalmarek 2020-05-13 02:27:20 +02:00
parent a23f0ba464
commit ea407d2e98
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

25
PSL.jl
View File

@ -34,7 +34,6 @@ function load_discrete_repr(i, q=109; CC=AcbField(512))
return a,b return a,b
end end
function load_principal_repr(i, q=109; CC=AcbField(512)) function load_principal_repr(i, q=109; CC=AcbField(512))
ζ = root_of_unity(CC, (q-1)÷2) ζ = root_of_unity(CC, (q-1)÷2)
degree = q+1 degree = q+1
@ -48,18 +47,19 @@ function load_principal_repr(i, q=109; CC=AcbField(512))
return a,b return a,b
end end
function safe_eigvals(m::acb_mat)
CC = base_ring(m)
X = matrix(CC, rand(CC, size(m)))
return eigvals(X*m*inv(X))
end
for i in 0:27 for i in 0:27
try try
a,b = load_principal_repr(i) a,b = load_principal_repr(i)
adjacency = sum([[a^i for i in 1:4]; [b^i for i in 1:4]]) adjacency = sum([[a^i for i in 1:4]; [b^i for i in 1:4]])
# @time evc = eigvals(adjacency) @time evc = safe_eigvals(adjacency)
CC = base_ring(adjacency)
X = matrix(CC, rand(CC, size(adjacency)))
@time evc = eigvals(X*adjacency*inv(X))
ev = sort(real.(first.(evc)), lt=<, rev=true) ev = sort(real.(first.(evc)), lt=<, rev=true)
@info "Principal Series Representation $i" ev[1:4] @info "Principal Series Representation $i" ev[1:2]
catch ex catch ex
@error "Principal Series Representation $i failed" @error "Principal Series Representation $i failed"
ex isa InterruptException && throw(ex) ex isa InterruptException && throw(ex)
@ -70,14 +70,9 @@ for i in 1:27
try try
a,b = load_discrete_repr(i) a,b = load_discrete_repr(i)
adjacency = sum([[a^i for i in 1:4]; [b^i for i in 1:4]]) adjacency = sum([[a^i for i in 1:4]; [b^i for i in 1:4]])
# @time evc = eigvals(adjacency) @time evc = safe_eigvals(adjacency)
CC = base_ring(adjacency)
X = matrix(CC, rand(CC, size(adjacency)))
@time evc = eigvals(X*adjacency*inv(X))
ev = sort(real.(first.(evc)), lt=<, rev=true) ev = sort(real.(first.(evc)), lt=<, rev=true)
@info "Discrete Series Representation $i" ev[1:4] @info "Discrete Series Representation $i" ev[1:2]
catch ex catch ex
@error "Discrete Series Representation $i : failed" @error "Discrete Series Representation $i : failed"
ex isa InterruptException && rethrow(ex) ex isa InterruptException && rethrow(ex)