Skip to content

Commit 26f46ff

Browse files
a few additions
1 parent fffec5f commit 26f46ff

4 files changed

Lines changed: 51 additions & 0 deletions

File tree

src/acb.pyx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ cdef class acb(flint_scalar):
188188
other = any_as_acb(other)
189189
return bool(acb_overlaps((<acb>self).val, (<acb>other).val))
190190

191+
def contains_integer(self):
192+
return bool(acb_contains_int(self.val))
193+
191194
def mid(self):
192195
"""
193196
Returns an exact *acb* representing the midpoint of *self*:
@@ -630,6 +633,16 @@ cdef class acb(flint_scalar):
630633
acb_hurwitz_zeta((<acb>u).val, (<acb>s).val, (<acb>a).val, getprec())
631634
return u
632635

636+
def dirichlet_l(s, chi):
637+
cdef dirichlet_char cchar
638+
if isinstance(chi, dirichlet_char):
639+
cchar = chi
640+
else:
641+
cchar = dirichlet_char(chi[0], chi[1])
642+
u = acb.__new__(acb)
643+
acb_dirichlet_l((<acb>u).val, (<acb>s).val, cchar.G.val, cchar.val, getprec())
644+
return u
645+
633646
@staticmethod
634647
def pi():
635648
"""

src/acb_series.pyx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,20 @@ cdef class acb_series(flint_series):
447447
(<acb_series>u).prec = cap
448448
return u
449449

450+
def dirichlet_l(s, chi, bint deflate=0):
451+
cdef long cap
452+
cdef dirichlet_char cchar
453+
if isinstance(chi, dirichlet_char):
454+
cchar = chi
455+
else:
456+
cchar = dirichlet_char(chi[0], chi[1])
457+
cap = getcap()
458+
cap = min(cap, (<acb_series>s).prec)
459+
u = acb_series.__new__(acb_series)
460+
acb_dirichlet_l_series((<acb_series>u).val, (<acb_series>s).val, cchar.G.val, cchar.val, deflate, cap, getprec())
461+
(<acb_series>u).prec = cap
462+
return u
463+
450464
@classmethod
451465
def polylog(cls, s, z):
452466
cdef long cap
@@ -640,6 +654,22 @@ cdef class acb_series(flint_series):
640654
(<acb_series>z).prec = cap
641655
return u, v, w, z
642656

657+
def modular_theta(self, tau):
658+
cdef long cap
659+
tau = acb(tau)
660+
cap = getcap()
661+
cap = min(cap, (<acb_series>self).prec)
662+
t1 = acb_series.__new__(acb_series)
663+
t2 = acb_series.__new__(acb_series)
664+
t3 = acb_series.__new__(acb_series)
665+
t4 = acb_series.__new__(acb_series)
666+
acb_modular_theta_series((<acb_series>t1).val, (<acb_series>t2).val, (<acb_series>t3).val, (<acb_series>t4).val, (<acb_series>self).val, (<acb>tau).val, cap, getprec())
667+
(<acb_series>t1).prec = cap
668+
(<acb_series>t2).prec = cap
669+
(<acb_series>t3).prec = cap
670+
(<acb_series>t4).prec = cap
671+
return t1, t2, t3, t4
672+
643673
def coulomb(self, l, eta):
644674
cdef long cap
645675
l = acb(l)

src/arb.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ cdef class arb(flint_scalar):
476476
other = any_as_arb(other)
477477
return bool(arb_overlaps((<arb>self).val, (<arb>other).val))
478478

479+
def contains_integer(self):
480+
return bool(arb_contains_int(self.val))
481+
479482
def __pos__(self):
480483
res = arb.__new__(arb)
481484
arb_set_round((<arb>res).val, (<arb>self).val, getprec())

src/flint.pxd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ cdef extern from "arb.h":
903903
int arb_contains_nonpositive(const arb_t x)
904904
int arb_contains_positive(const arb_t x)
905905
int arb_contains_nonnegative(const arb_t x)
906+
int arb_contains_int(const arb_t x)
906907
void arb_get_mag_lower(mag_t z, const arb_t x)
907908
void arb_get_mag_lower_nonnegative(mag_t z, const arb_t x)
908909
void arb_get_mag(mag_t z, const arb_t x)
@@ -1168,6 +1169,7 @@ cdef extern from "acb.h":
11681169
int acb_contains_fmpz(const acb_t x, const fmpz_t y)
11691170
int acb_contains(const acb_t x, const acb_t y)
11701171
int acb_get_unique_fmpz(fmpz_t z, const acb_t x)
1172+
int acb_contains_int(const acb_t x)
11711173
void acb_set_ui(acb_t z, ulong c)
11721174
void acb_set_si(acb_t z, long c)
11731175
void acb_set_fmpz(acb_t z, const fmpz_t c)
@@ -1910,6 +1912,7 @@ cdef extern from "acb_mat.h":
19101912
cdef extern from "acb_modular.h":
19111913
void acb_modular_theta(acb_t theta1, acb_t theta2, acb_t theta3, acb_t theta4, const acb_t z, const acb_t tau, long prec)
19121914
void acb_modular_theta_jet(acb_ptr theta1, acb_ptr theta2, acb_ptr theta3, acb_ptr theta4, const acb_t z, const acb_t tau, long len, long prec)
1915+
void acb_modular_theta_series(acb_poly_t theta1, acb_poly_t theta2, acb_poly_t theta3, acb_poly_t theta4, const acb_poly_t z, const acb_t tau, long len, long prec)
19131916
void acb_modular_eta(acb_t r, const acb_t tau, long prec)
19141917
void acb_modular_j(acb_t r, const acb_t tau, long prec)
19151918
void acb_modular_lambda(acb_t r, const acb_t tau, long prec)
@@ -2130,6 +2133,7 @@ cdef extern from "acb_dirichlet.h":
21302133

21312134
void acb_dirichlet_l(acb_t res, const acb_t s, const dirichlet_group_t G, const dirichlet_char_t chi, long prec)
21322135
void acb_dirichlet_hardy_z(acb_ptr res, const acb_t t, const dirichlet_group_t G, const dirichlet_char_t chi, long len, long prec)
2136+
void acb_dirichlet_l_series(acb_poly_t res, const acb_poly_t s, const dirichlet_group_t G, const dirichlet_char_t chi, int deflate, long len, long prec)
21332137

21342138
void acb_dirichlet_stieltjes(acb_t res, const fmpz_t n, const acb_t a, long prec);
21352139

@@ -2138,6 +2142,7 @@ cdef extern from "acb_dirichlet.h":
21382142
void acb_dirichlet_zeta_nzeros(arb_t res, const arb_t t, long prec)
21392143
void acb_dirichlet_backlund_s(arb_t res, const arb_t t, long prec)
21402144
void acb_dirichlet_zeta_zero(acb_t res, const fmpz_t n, long prec)
2145+
void acb_dirichlet_zeta_zeros(acb_ptr res, const fmpz_t n, long len, long prec)
21412146

21422147
cdef extern from "acb_elliptic.h":
21432148
void acb_elliptic_rf(acb_t res, const acb_t x, const acb_t y, const acb_t z, int flags, long prec)

0 commit comments

Comments
 (0)