Skip to content

Commit

Permalink
adding the trace of the trivial Hecke operator when computing primes
Browse files Browse the repository at this point in the history
  • Loading branch information
assaferan committed Jun 23, 2023
1 parent 6e284ae commit 8686eab
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Tests/MagmaFormula.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ procedure testPariVSMagma(N,k : New := false, OnlyPrimes := false, Prec := 1000)
r := r[start..fin];
traces_AL := [StringToInteger(x) : x in Split(r, ",")];
trace_func := New select TraceFormulaGamma0ALNew else TraceFormulaGamma0AL;
val_list := OnlyPrimes select PrimesUpTo(Prec) else [0..Prec];
val_list := OnlyPrimes select [1] cat PrimesUpTo(Prec) else [0..Prec];
traces_magma := [trace_func(n, N, k) : n in val_list];
assert traces_magma eq traces_AL[1..#val_list];
return;
Expand Down
5 changes: 1 addition & 4 deletions Tests/ModSym.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
procedure testPariVSMS(N,k,n : New := false)
is_prime := IsPrime(n);
if (is_prime) then
n_idx := #PrimesUpTo(n);
n_idx := #PrimesUpTo(n) + 1;
else
if (New) then
printf("Error! Only supports newsubspace for prime Hecke operators!\n");
Expand All @@ -25,9 +25,6 @@ procedure testPariVSMS(N,k,n : New := false)
fin := Index(r, "]") - 1;
r := r[start..fin];
traces_AL := [StringToInteger(x) : x in Split(r, ",")];
// C := CuspidalSubspace(ModularSymbols(N,k,1));
// al := AtkinLehner(C,N);
// T := HeckeOperator(C,n);
assert traces_AL[n_idx] eq get_trace(N,k,n : New := New); // Trace(al*T);
return;
end procedure;
Expand Down
18 changes: 14 additions & 4 deletions src/traceAL_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,19 +637,24 @@ GEN traceALprimes(long N, long k, long prec, int newspace)
{
GEN p_list = primes0(mkvec2(mkintn(1,1), nextprime(mkintn(1,prec))));
long num_primes = lg(p_list);
GEN res = cgetg(num_primes-1, t_VEC);
// adding also the trace for T_1 = 1
// GEN res = cgetg(num_primes-1, t_VEC);
GEN res = cgetg(num_primes, t_VEC);
long p;

GEN (*trace_func)(long, long, long);
trace_func = (newspace ? &traceALNew : &traceAL);

// printf("In traceALprimes. num_primes = %ld. newspace = %d. \n", num_primes, newspace);
// printf("trace_func = %x.\n", (unsigned int)trace_func);

gel(res, 1) = (newspace ? traceALNewTrivial(N,k) : traceAL(N,1,k));

for (long idx = 1; idx < num_primes - 1; idx++)
{
p = gtos(gel(p_list, idx));
gel(res, idx) = (*trace_func)(N, p, k);
// gel(res, idx) = (*trace_func)(N, p, k);
gel(res, idx+1) = (*trace_func)(N, p, k);
}
return res;
}
Expand All @@ -658,15 +663,20 @@ GEN trace_primes(long N, long k, long prec, int newspace)
{
GEN p_list = primes0(mkvec2(mkintn(1,1), nextprime(mkintn(1,prec))));
long num_primes = lg(p_list);
GEN res = cgetg(num_primes-1, t_VEC);
// adding trace of the identity (dimension of the space)
// GEN res = cgetg(num_primes-1, t_VEC);
GEN res = cgetg(num_primes, t_VEC);
long p;
GEN NK = mkvec2(mkintn(1,N),mkintn(1,k));
GEN f = mftraceform(NK,newspace ? 0 : 1);

gel(res, 1) = mfcoef(f, 1);

for (long idx = 1; idx < num_primes - 1; idx++)
{
p = gtos(gel(p_list, idx));
gel(res, idx) = mfcoef(f, p);
// gel(res, idx) = mfcoef(f, p);
gel(res, idx+1) = mfcoef(f, p);
}
return res;
}
Expand Down

0 comments on commit 8686eab

Please sign in to comment.