2016-09-06 15:43:12 +02:00
|
|
|
/*
|
2016-03-23 12:53:08 +01:00
|
|
|
Copyright (C) 2016 Pascal Molin
|
|
|
|
|
2016-09-06 15:43:12 +02:00
|
|
|
This file is part of Arb.
|
|
|
|
|
|
|
|
Arb is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Lesser General Public License (LGPL) as published
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version. See <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-03-23 12:53:08 +01:00
|
|
|
|
|
|
|
#include "acb_dirichlet.h"
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2016-04-05 11:55:04 +02:00
|
|
|
slong prec = 64;
|
2016-03-23 12:53:08 +01:00
|
|
|
ulong q;
|
|
|
|
|
2016-03-29 14:04:08 +01:00
|
|
|
flint_printf("thetanull....");
|
2016-03-23 12:53:08 +01:00
|
|
|
fflush(stdout);
|
|
|
|
|
|
|
|
/* check the only theta functions
|
|
|
|
* theta(chi) = sum chi(k)* k^odd * exp(-Pi * k^2 / q)
|
|
|
|
* vanishing at 1 correspond to two specific
|
|
|
|
* characters of moduli 300 and 600 + conjugates
|
|
|
|
*/
|
|
|
|
|
2016-04-05 11:55:04 +02:00
|
|
|
for (q = 3; q < 1000; q ++)
|
2016-03-23 12:53:08 +01:00
|
|
|
{
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_group_t G;
|
|
|
|
dirichlet_char_t chi;
|
2016-03-23 12:53:08 +01:00
|
|
|
ulong * v, nv, k;
|
|
|
|
|
2016-09-02 16:09:18 +02:00
|
|
|
acb_t sum;
|
2016-03-23 12:53:08 +01:00
|
|
|
acb_ptr z;
|
|
|
|
|
|
|
|
arb_t eq;
|
|
|
|
arb_ptr t, kt, tt;
|
|
|
|
|
|
|
|
if (q % 4 == 2)
|
2016-04-05 11:55:04 +02:00
|
|
|
/* no primitive character mod q */
|
2016-03-23 12:53:08 +01:00
|
|
|
continue;
|
|
|
|
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_group_init(G, q);
|
|
|
|
dirichlet_char_init(chi, G);
|
2016-03-23 12:53:08 +01:00
|
|
|
|
|
|
|
z = _acb_vec_init(G->expo);
|
2016-10-06 12:39:42 +02:00
|
|
|
_acb_vec_nth_roots(z, G->expo, prec);
|
2016-03-23 12:53:08 +01:00
|
|
|
|
2016-04-12 15:07:04 +02:00
|
|
|
nv = acb_dirichlet_theta_length_d(q, 1, prec);
|
2016-03-23 12:53:08 +01:00
|
|
|
v = flint_malloc(nv * sizeof(ulong));
|
|
|
|
|
|
|
|
arb_init(eq);
|
|
|
|
arb_const_pi(eq, prec);
|
|
|
|
arb_div_ui(eq, eq, q, prec);
|
|
|
|
arb_neg(eq, eq);
|
|
|
|
arb_exp(eq, eq, prec);
|
|
|
|
|
|
|
|
t = _arb_vec_init(nv);
|
|
|
|
acb_dirichlet_arb_quadratic_powers(t, nv, eq, prec);
|
|
|
|
|
|
|
|
kt = _arb_vec_init(nv);
|
|
|
|
for (k = 1; k < nv; k++)
|
|
|
|
arb_mul_ui(kt + k, t + k, k, prec);
|
|
|
|
|
|
|
|
/* theta function on primitive characters */
|
|
|
|
acb_init(sum);
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_char_first_primitive(chi, G);
|
2016-03-23 12:53:08 +01:00
|
|
|
|
2016-08-04 15:35:33 +02:00
|
|
|
do {
|
2016-03-23 12:53:08 +01:00
|
|
|
ulong m;
|
|
|
|
acb_zero(sum);
|
|
|
|
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_ui_chi_vec(v, G, chi, nv);
|
2016-03-23 12:53:08 +01:00
|
|
|
|
2016-07-14 18:55:44 +02:00
|
|
|
m = G->expo / chi->order.n;
|
2016-10-06 14:19:39 +02:00
|
|
|
tt = dirichlet_char_parity(chi) ? kt : t;
|
2016-03-29 14:04:08 +01:00
|
|
|
|
2016-03-23 12:53:08 +01:00
|
|
|
for (k = 1; k < nv; k++)
|
2016-10-06 14:19:39 +02:00
|
|
|
if (v[k] != DIRICHLET_CHI_NULL)
|
2016-03-23 12:53:08 +01:00
|
|
|
acb_addmul_arb(sum, z + (v[k] * m), tt + k, prec);
|
|
|
|
|
2016-08-04 18:56:27 +02:00
|
|
|
if ((q == 300 && (chi->x->n == 71 || chi->x->n == 131))
|
|
|
|
|| (q == 600 && (chi->x->n == 11 || chi->x->n == 491)))
|
2016-03-23 12:53:08 +01:00
|
|
|
{
|
|
|
|
if (!acb_contains_zero(sum))
|
|
|
|
{
|
2016-06-17 18:23:48 +02:00
|
|
|
flint_printf("FAIL: Theta(chi_%wu(%wu))=", q, chi->x->n);
|
2016-03-23 12:53:08 +01:00
|
|
|
acb_printd(sum, 10);
|
|
|
|
flint_printf("\n");
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_char_print(G, chi);
|
2016-06-17 18:23:48 +02:00
|
|
|
flint_printf("\n");
|
2016-03-23 12:53:08 +01:00
|
|
|
abort();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (acb_contains_zero(sum))
|
|
|
|
{
|
2016-06-17 18:23:48 +02:00
|
|
|
flint_printf("FAIL: Theta(chi_%wu(%wu))=", q, chi->x->n);
|
2016-03-23 12:53:08 +01:00
|
|
|
acb_printd(sum, 10);
|
|
|
|
flint_printf("\n");
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_char_print(G, chi);
|
2016-06-17 18:23:48 +02:00
|
|
|
flint_printf("\n");
|
2016-03-23 12:53:08 +01:00
|
|
|
abort();
|
|
|
|
}
|
2016-08-04 18:56:27 +02:00
|
|
|
|
2016-10-06 14:19:39 +02:00
|
|
|
} while (dirichlet_char_next_primitive(chi, G) >= 0);
|
2016-03-23 12:53:08 +01:00
|
|
|
|
|
|
|
_acb_vec_clear(z, G->expo);
|
2016-09-09 22:20:10 +02:00
|
|
|
_arb_vec_clear(kt, nv);
|
2016-03-23 12:53:08 +01:00
|
|
|
_arb_vec_clear(t, nv);
|
|
|
|
acb_clear(sum);
|
|
|
|
arb_clear(eq);
|
2016-04-05 11:55:04 +02:00
|
|
|
flint_free(v);
|
2016-10-06 14:19:39 +02:00
|
|
|
dirichlet_group_clear(G);
|
|
|
|
dirichlet_char_clear(chi);
|
2016-03-23 12:53:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
flint_cleanup();
|
|
|
|
flint_printf("PASS\n");
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|