1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-11-27 16:35:26 +01:00

parse once again

This commit is contained in:
kalmarek 2020-05-15 01:13:12 +02:00
parent 3b8209ee5c
commit e3469b737f
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

46
PSL.jl
View File

@ -3,36 +3,37 @@ using DelimitedFiles
include("src/nemo_utils.jl")
const PRECISION = 256
function parse_eval(arg, expr_str, var)
function parse_eval(expr_str, value, var_name)
ex = Meta.parse(expr_str)
svar = :($var)
svar = :($var_name)
return @eval begin
let $svar = $arg
let $svar = $value
$ex
end
end
end
function read_eval(fname, var_name, value)
a = readdlm(fname, ',', String)
a .= replace.(a, '/'=>"//")
return parse_eval.(a, value, var_name)
end
function load_discrete_repr(i, q = 109; CC = AcbField(PRECISION))
ζ = root_of_unity(CC, (q - 1) ÷ 2)
ζ = root_of_unity(CC, (q + 1) ÷ 2)
degree = q - 1
ra = readdlm(
ra = read_eval(
"data/Discrete reps PSL(2, $q)/discrete_rep_$(i)_a.txt",
',',
String,
)
a = matrix(CC, [CC(parse_eval(ζ, s, :Z)) for s in ra[1:degree, 1:degree]])
:Z, ζ)
a = matrix(CC, [CC(s) for s in ra[1:degree, 1:degree]])
rb = readdlm(
rb = read_eval(
"data/Discrete reps PSL(2, $q)/discrete_rep_$(i)_b.txt",
',',
String,
)
b = matrix(CC, [CC(parse_eval(ζ, s, :Z)) for s in rb[1:degree, 1:degree]])
:Z, ζ)
b = matrix(CC, [CC(s) for s in rb[1:degree, 1:degree]])
return a, b
end
@ -41,19 +42,14 @@ function load_principal_repr(i, q = 109; CC = AcbField(PRECISION))
ζ = root_of_unity(CC, (q - 1) ÷ 2)
degree = q + 1
ra = readdlm(
ra = read_eval(
"data/Principal reps PSL(2, $q)/principal_rep_$(i)_a.txt",
',',
String,
)
a = matrix(CC, [CC(parse_eval(ζ, s, :zz)) for s in ra[1:degree, 1:degree]])
:zz, ζ)
a = matrix(CC, [CC(z) for z in ra[1:degree, 1:degree]])
rb = readdlm(
rb = read_eval(
"data/Principal reps PSL(2, $q)/principal_rep_$(i)_b.txt",
',',
String,
)
b = matrix(CC, [CC(parse_eval(ζ, s, :zz)) for s in rb[1:degree, 1:degree]])
:zz, ζ)
return a, b
end