Skip to content

Commit

Permalink
Make char_dot_acb static in jet_notransform
Browse files Browse the repository at this point in the history
  • Loading branch information
j-kieffer committed Feb 10, 2025
1 parent 8dabcb4 commit dbb569f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 48 deletions.
1 change: 0 additions & 1 deletion src/acb_theta.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ void acb_theta_char_get_acb(acb_ptr v, ulong a, slong g);

slong acb_theta_char_dot(ulong a, ulong b, slong g);
slong acb_theta_char_dot_slong(ulong a, const slong * n, slong g);
void acb_theta_char_dot_acb(acb_t x, ulong a, acb_srcptr z, slong g, slong prec);

FLINT_FORCE_INLINE int
acb_theta_char_is_even(ulong ab, slong g)
Expand Down
31 changes: 0 additions & 31 deletions src/acb_theta/char_dot_acb.c

This file was deleted.

18 changes: 18 additions & 0 deletions src/acb_theta/jet_notransform.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ acb_theta_jet_notransform_00(acb_ptr th, acb_srcptr zs, slong nb,
theta_ab(z, tau) = exp(pi i a^T tau a/4) exp(2 pi i a^T (z + b/2))
theta_00(z + tau a/2 + b/2, tau) */

static void
acb_theta_char_dot_acb(acb_t x, ulong a, acb_srcptr z, slong g, slong prec)
{
slong * v;
slong j;

v = flint_malloc(g * sizeof(slong));

for (j = 0; j < g; j++)
{
v[g - 1 - j] = (a >> j) % 2;
}
acb_dot_si(x, NULL, 0, z, 1, v, 1, g, prec);
acb_mul_2exp_si(x, x, -1);

flint_free(v);
}

static void
acb_theta_jet_notransform_one(acb_ptr th, acb_srcptr zs, slong nb,
const acb_mat_t tau, slong ord, ulong ab, slong prec)
Expand Down
25 changes: 9 additions & 16 deletions src/acb_theta/test/t-char_dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEST_FUNCTION_START(acb_theta_char_dot, state)
acb_ptr v, w;
fmpz_t m;
slong x1, x2;
acb_t x3, x4;
acb_t x4;
slong j;
int res;

Expand All @@ -36,7 +36,6 @@ TEST_FUNCTION_START(acb_theta_char_dot, state)
w = _acb_vec_init(g);
a = n_randint(state, 1 << g);
b = n_randint(state, 1 << g);
acb_init(x3);
acb_init(x4);
fmpz_init(m);

Expand All @@ -46,26 +45,21 @@ TEST_FUNCTION_START(acb_theta_char_dot, state)
n[g - 1 - j] = (b >> j) % 2;
}
x2 = acb_theta_char_dot_slong(a, n, g);
acb_theta_char_get_acb(v, b, g);
acb_theta_char_dot_acb(x3, a, v, g, prec);
acb_theta_char_get_acb(w, a, g);
acb_dot(x4, NULL, 0, v, 1, w, 1, g, prec);

if (x1 != x2
|| !acb_overlaps(x3, x4))
if (x1 != x2)
{
flint_printf("FAIL\n");
flint_printf("x1 = %wd, x2 = %wd, x3, x4:\n", x1, x2);
acb_printd(x3, 10);
flint_printf("\n");
acb_printd(x4, 10);
flint_printf("\n");
flint_printf("x1 = %wd, x2 = %wd\n", x1, x2);
flint_abort();
}

acb_mul_2exp_si(x3, x3, 2);
res = acb_get_unique_fmpz(m, x3);
acb_theta_char_get_acb(v, b, g);
acb_theta_char_get_acb(w, a, g);
acb_dot(x4, NULL, 0, v, 1, w, 1, g, prec);
acb_mul_2exp_si(x4, x4, 2);
res = acb_get_unique_fmpz(m, x4);
fmpz_sub_si(m, m, x1);

if (!res || !fmpz_divisible_si(m, 4))
{
flint_printf("FAIL (mod 4)\n");
Expand All @@ -75,7 +69,6 @@ TEST_FUNCTION_START(acb_theta_char_dot, state)
flint_free(n);
_acb_vec_clear(v, g);
_acb_vec_clear(w, g);
acb_clear(x3);
acb_clear(x4);
fmpz_clear(m);
}
Expand Down

0 comments on commit dbb569f

Please sign in to comment.