Skip to content

Commit

Permalink
Fix bug in ql_setup for hard step, all = 1, k = 0; use less roots for…
Browse files Browse the repository at this point in the history
… hard step, all = 0, k = 0
  • Loading branch information
j-kieffer committed Feb 11, 2025
1 parent 5dbcc32 commit 40469ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/acb_theta/ql_exact.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,13 @@ acb_theta_ql_perform_steps(acb_ptr th, acb_ptr th_init, acb_srcptr rts,
}
else
{
/* theta(z + t, tau)^2 = sum of theta(0, 2tau) theta(2z + 2t, 2tau) */
acb_theta_ql_step_1(th_next + 3 * j * n + n, th_init,
th_init + 3 * j * n + n,
rts + j * (3 * n * nb_steps) + k * (3 * n) + n, d0, d, g, prec);
if (k > 0)
{
/* theta(z + t, tau)^2 = sum of theta(0, 2tau) theta(2z + 2t, 2tau) */
acb_theta_ql_step_1(th_next + 3 * j * n + n, th_init,
th_init + 3 * j * n + n,
rts + j * (3 * n * nb_steps) + k * (3 * n) + n, d0, d, g, prec);
}
/* theta(z + 2t, tau)^2 = sum of theta(0, 2tau) theta(2z + 4t, 2tau) */
acb_theta_ql_step_1(th_next + 3 * j * n + 2 * n, th_init,
th_init + 3 * j * n + 2 * n,
Expand Down
9 changes: 8 additions & 1 deletion src/acb_theta/ql_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,14 @@ acb_theta_ql_setup_hard(acb_ptr rts, acb_ptr rts_all, acb_ptr t,
/* We just need roots for z + 2t */
th = rts_all + j * n * n;
acb_theta_sum(th, &aux[1], 1, ctx_tau, d, 1, 1, 1, prec);
res = !_acb_vec_contains_zero(rts, n * n);
res = !_acb_vec_contains_zero(th, n * n);
}
else if (k == 0)
{
/* We just need roots for z + 2t */
th = rts + j * (3 * n * nb_steps) + 2 * n;
acb_theta_sum(th, &aux[1], 1, ctx_tau, d, 1, 0, 1, prec);
res = !_acb_vec_contains_zero(th, n);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/acb_theta/test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test_struct tests[] =
//TEST_FUNCTION(acb_theta_ql_jet_fd),
TEST_FUNCTION(acb_theta_ql_local_bound),
TEST_FUNCTION(acb_theta_ql_lower_dim),
//TEST_FUNCTION(acb_theta_ql_setup),
TEST_FUNCTION(acb_theta_ql_setup),
TEST_FUNCTION(acb_theta_siegel_cocycle),
TEST_FUNCTION(acb_theta_siegel_is_reduced),
TEST_FUNCTION(acb_theta_siegel_kappa),
Expand Down
8 changes: 7 additions & 1 deletion src/acb_theta/test/t-ql_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ TEST_FUNCTION_START(acb_theta_ql_setup, state)
if (!res)
{
flint_printf("FAIL (ql_setup)\n");
flint_printf("prec = %wd, nb = %wd, nb_steps = %wd, all = %wd, tau, z, distances:\n",
prec, nb, nb_steps, all);
acb_mat_printd(tau, 5);
_acb_vec_printd(zs, nb * g, 5);
_arb_vec_printd(distances, nb * n, 5);
flint_abort();
}

Expand Down Expand Up @@ -108,7 +113,8 @@ TEST_FUNCTION_START(acb_theta_ql_setup, state)
flint_abort();
}
if (k >= easy_steps[j]
&& acb_contains_zero(&rts[j * (3 * n * nb_steps) + k * (3 * n) + n + a]))
&& acb_contains_zero(&rts[j * (3 * n * nb_steps) + k * (3 * n) + n + a])
&& k > 0)
{
flint_printf("FAIL (root 2)\n");
flint_printf("j = %wd, k = %wd, a = %wd\n", j, k, a);
Expand Down

0 comments on commit 40469ee

Please sign in to comment.