mirror of
https://github.com/kalmarek/SmallHyperbolic
synced 2024-11-23 23:40:28 +01:00
parse once again
This commit is contained in:
parent
3b8209ee5c
commit
e3469b737f
46
PSL.jl
46
PSL.jl
@ -3,36 +3,37 @@ using DelimitedFiles
|
|||||||
|
|
||||||
include("src/nemo_utils.jl")
|
include("src/nemo_utils.jl")
|
||||||
|
|
||||||
|
|
||||||
const PRECISION = 256
|
const PRECISION = 256
|
||||||
|
|
||||||
function parse_eval(arg, expr_str, var)
|
function parse_eval(expr_str, value, var_name)
|
||||||
ex = Meta.parse(expr_str)
|
ex = Meta.parse(expr_str)
|
||||||
svar = :($var)
|
svar = :($var_name)
|
||||||
return @eval begin
|
return @eval begin
|
||||||
let $svar = $arg
|
let $svar = $value
|
||||||
$ex
|
$ex
|
||||||
end
|
end
|
||||||
end
|
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))
|
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
|
degree = q - 1
|
||||||
|
|
||||||
ra = readdlm(
|
ra = read_eval(
|
||||||
"data/Discrete reps PSL(2, $q)/discrete_rep_$(i)_a.txt",
|
"data/Discrete reps PSL(2, $q)/discrete_rep_$(i)_a.txt",
|
||||||
',',
|
:Z, ζ)
|
||||||
String,
|
a = matrix(CC, [CC(s) for s in ra[1:degree, 1:degree]])
|
||||||
)
|
|
||||||
a = matrix(CC, [CC(parse_eval(ζ, s, :Z)) for s in ra[1:degree, 1:degree]])
|
|
||||||
|
|
||||||
rb = readdlm(
|
rb = read_eval(
|
||||||
"data/Discrete reps PSL(2, $q)/discrete_rep_$(i)_b.txt",
|
"data/Discrete reps PSL(2, $q)/discrete_rep_$(i)_b.txt",
|
||||||
',',
|
:Z, ζ)
|
||||||
String,
|
b = matrix(CC, [CC(s) for s in rb[1:degree, 1:degree]])
|
||||||
)
|
|
||||||
b = matrix(CC, [CC(parse_eval(ζ, s, :Z)) for s in rb[1:degree, 1:degree]])
|
|
||||||
|
|
||||||
return a, b
|
return a, b
|
||||||
end
|
end
|
||||||
@ -41,19 +42,14 @@ function load_principal_repr(i, q = 109; CC = AcbField(PRECISION))
|
|||||||
ζ = root_of_unity(CC, (q - 1) ÷ 2)
|
ζ = root_of_unity(CC, (q - 1) ÷ 2)
|
||||||
degree = q + 1
|
degree = q + 1
|
||||||
|
|
||||||
ra = readdlm(
|
ra = read_eval(
|
||||||
"data/Principal reps PSL(2, $q)/principal_rep_$(i)_a.txt",
|
"data/Principal reps PSL(2, $q)/principal_rep_$(i)_a.txt",
|
||||||
',',
|
:zz, ζ)
|
||||||
String,
|
a = matrix(CC, [CC(z) for z in ra[1:degree, 1:degree]])
|
||||||
)
|
|
||||||
a = matrix(CC, [CC(parse_eval(ζ, s, :zz)) for s in ra[1:degree, 1:degree]])
|
|
||||||
|
|
||||||
rb = readdlm(
|
rb = read_eval(
|
||||||
"data/Principal reps PSL(2, $q)/principal_rep_$(i)_b.txt",
|
"data/Principal reps PSL(2, $q)/principal_rep_$(i)_b.txt",
|
||||||
',',
|
:zz, ζ)
|
||||||
String,
|
|
||||||
)
|
|
||||||
b = matrix(CC, [CC(parse_eval(ζ, s, :zz)) for s in rb[1:degree, 1:degree]])
|
|
||||||
|
|
||||||
return a, b
|
return a, b
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user