passagemath-flint 10.5.43__cp312-cp312-musllinux_1_2_aarch64.whl → 10.6.1rc1__cp312-cp312-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {passagemath_flint-10.5.43.dist-info → passagemath_flint-10.6.1rc1.dist-info}/METADATA +5 -6
- {passagemath_flint-10.5.43.dist-info → passagemath_flint-10.6.1rc1.dist-info}/RECORD +100 -100
- passagemath_flint.libs/{libflint-7dd7ad94.so.19.0.0 → libflint-4ce13791.so.20.0.1} +0 -0
- sage/combinat/posets/hasse_cython_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/data_structures/bounded_integer_sequences.cpython-312-aarch64-linux-musl.so +0 -0
- sage/data_structures/bounded_integer_sequences.pyx +22 -20
- sage/graphs/chrompoly.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/chrompoly.pyx +4 -3
- sage/graphs/matchpoly.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/arb/arith.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/arith.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/arith_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/flint.pxd +2 -2
- sage/libs/flint/flint_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/flint_wrap.h +4 -0
- sage/libs/flint/fmpq_poly_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/fmpz_factor_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/fmpz_poly.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/fmpz_poly_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/nmod_poly_linkage.pxi +5 -4
- sage/libs/flint/qsieve.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/qsieve_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/types.pxd +2 -2
- sage/libs/flint/ulong_extras.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/flint/ulong_extras_sage.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/change_ring.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_complex_ball_dense.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_cyclo_dense.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_cyclo_dense.pyx +3 -3
- sage/matrix/matrix_integer_dense.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_integer_dense.pyx +50 -33
- sage/matrix/matrix_integer_sparse.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_integer_sparse.pyx +1 -1
- sage/matrix/matrix_rational_dense.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_rational_dense.pyx +64 -28
- sage/matrix/matrix_rational_sparse.cpython-312-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_rational_sparse.pyx +3 -3
- sage/matrix/misc_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/modular/modform/eis_series_cython.cpython-312-aarch64-linux-musl.so +0 -0
- sage/modular/modsym/apply.cpython-312-aarch64-linux-musl.so +0 -0
- sage/modular/modsym/heilbronn.cpython-312-aarch64-linux-musl.so +0 -0
- sage/modular/pollack_stevens/dist.cpython-312-aarch64-linux-musl.so +0 -0
- sage/modular/pollack_stevens/dist.pyx +2 -2
- sage/quivers/algebra.py +2 -1
- sage/quivers/algebra_elements.cpython-312-aarch64-linux-musl.so +0 -0
- sage/quivers/algebra_elements.pyx +5 -5
- sage/quivers/ar_quiver.py +21 -21
- sage/quivers/homspace.py +2 -1
- sage/quivers/morphism.py +31 -29
- sage/quivers/path_semigroup.py +14 -11
- sage/quivers/paths.cpython-312-aarch64-linux-musl.so +0 -0
- sage/quivers/paths.pyx +2 -2
- sage/quivers/representation.py +22 -24
- sage/rings/complex_arb.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/complex_arb.pyx +37 -36
- sage/rings/complex_interval.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/convert/mpfi.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/factorint_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/fraction_field_FpT.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/fraction_field_FpT.pyx +29 -0
- sage/rings/number_field/S_unit_solver.py +1 -1
- sage/rings/number_field/galois_group.py +1 -1
- sage/rings/number_field/morphism.py +3 -4
- sage/rings/number_field/number_field.py +97 -75
- sage/rings/number_field/number_field_element.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_element.pyx +72 -0
- sage/rings/number_field/number_field_element_quadratic.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_element_quadratic.pyx +35 -17
- sage/rings/number_field/number_field_morphisms.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_morphisms.pyx +2 -2
- sage/rings/number_field/number_field_rel.py +1 -1
- sage/rings/number_field/order.py +44 -47
- sage/rings/number_field/order_ideal.py +2 -5
- sage/rings/polynomial/evaluation_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/hilbert.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/hilbert.pyx +3 -6
- sage/rings/polynomial/polynomial_complex_arb.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_integer_dense_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_integer_dense_flint.pyx +3 -5
- sage/rings/polynomial/polynomial_number_field.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_rational_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_rational_flint.pxd +3 -3
- sage/rings/polynomial/polynomial_rational_flint.pyx +24 -11
- sage/rings/polynomial/polynomial_zmod_flint.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_zmod_flint.pyx +3 -4
- sage/rings/polynomial/real_roots.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/real_roots.pyx +1 -1
- sage/rings/polynomial/refine_root.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/weil/weil_polynomials.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/weil/weil_polynomials.pyx +1 -1
- sage/rings/qqbar.py +1 -1
- sage/rings/real_arb.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/real_arb.pyx +21 -10
- sage/rings/real_interval_absolute.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/real_mpfi.cpython-312-aarch64-linux-musl.so +0 -0
- sage/rings/real_mpfi.pyx +14 -11
- sage/schemes/elliptic_curves/descent_two_isogeny.cpython-312-aarch64-linux-musl.so +0 -0
- sage/schemes/elliptic_curves/descent_two_isogeny.pyx +11 -0
- {passagemath_flint-10.5.43.dist-info → passagemath_flint-10.6.1rc1.dist-info}/WHEEL +0 -0
- {passagemath_flint-10.5.43.dist-info → passagemath_flint-10.6.1rc1.dist-info}/top_level.txt +0 -0
@@ -238,12 +238,12 @@ cdef class EmbeddedNumberFieldMorphism(NumberFieldEmbedding):
|
|
238
238
|
"""
|
239
239
|
if ambient_field is None:
|
240
240
|
if K.coerce_embedding() is None:
|
241
|
-
raise TypeError("No embedding available for %s"%K)
|
241
|
+
raise TypeError("No embedding available for %s" % K)
|
242
242
|
Kemb = K
|
243
243
|
while Kemb.coerce_embedding() is not None:
|
244
244
|
Kemb = Kemb.coerce_embedding().codomain()
|
245
245
|
if L.coerce_embedding() is None:
|
246
|
-
raise TypeError("No embedding available for %s"%L)
|
246
|
+
raise TypeError("No embedding available for %s" % L)
|
247
247
|
Lemb = L
|
248
248
|
while Lemb.coerce_embedding() is not None:
|
249
249
|
Lemb = Lemb.coerce_embedding().codomain()
|
@@ -40,7 +40,7 @@ We do some arithmetic in a tower of relative number fields::
|
|
40
40
|
sage: a.parent()
|
41
41
|
Number Field in sqrt2 with defining polynomial x^2 - 2 over its base field
|
42
42
|
|
43
|
-
.. WARNING
|
43
|
+
.. WARNING::
|
44
44
|
|
45
45
|
Doing arithmetic in towers of relative fields that depends on canonical
|
46
46
|
coercions is currently VERY SLOW. It is much better to explicitly coerce
|
sage/rings/number_field/order.py
CHANGED
@@ -79,6 +79,7 @@ AUTHORS:
|
|
79
79
|
# ****************************************************************************
|
80
80
|
|
81
81
|
from sage.categories.integral_domains import IntegralDomains
|
82
|
+
from sage.categories.noetherian_rings import NoetherianRings
|
82
83
|
from sage.misc.cachefunc import cached_method
|
83
84
|
from sage.structure.parent import Parent
|
84
85
|
from sage.structure.sequence import Sequence
|
@@ -458,6 +459,16 @@ class Order(Parent, sage.rings.abc.Order):
|
|
458
459
|
Traceback (most recent call last):
|
459
460
|
...
|
460
461
|
ValueError: the rank of the span of gens is wrong
|
462
|
+
|
463
|
+
Orders are always Noetherian::
|
464
|
+
|
465
|
+
sage: x = polygen(ZZ, 'x')
|
466
|
+
sage: L.<alpha> = NumberField(x**4 - x**2 + 7)
|
467
|
+
sage: O = L.maximal_order() ; O.is_noetherian()
|
468
|
+
True
|
469
|
+
sage: E.<w> = NumberField(x^2 - x + 2)
|
470
|
+
sage: OE = E.ring_of_integers(); OE.is_noetherian()
|
471
|
+
True
|
461
472
|
"""
|
462
473
|
|
463
474
|
def __init__(self, K):
|
@@ -480,8 +491,9 @@ class Order(Parent, sage.rings.abc.Order):
|
|
480
491
|
0.0535229072603327 + 1.20934552493846*I
|
481
492
|
"""
|
482
493
|
self._K = K
|
494
|
+
cat = IntegralDomains() & NoetherianRings()
|
483
495
|
Parent.__init__(self, base=ZZ, names=K.variable_names(),
|
484
|
-
normalize=False, category=
|
496
|
+
normalize=False, category=cat)
|
485
497
|
self._populate_coercion_lists_(embedding=self.number_field())
|
486
498
|
if self.absolute_degree() == 2:
|
487
499
|
self.is_maximal() # cache
|
@@ -616,22 +628,6 @@ class Order(Parent, sage.rings.abc.Order):
|
|
616
628
|
"""
|
617
629
|
return False
|
618
630
|
|
619
|
-
def is_noetherian(self):
|
620
|
-
r"""
|
621
|
-
Return ``True`` (because orders are always Noetherian).
|
622
|
-
|
623
|
-
EXAMPLES::
|
624
|
-
|
625
|
-
sage: x = polygen(ZZ, 'x')
|
626
|
-
sage: L.<alpha> = NumberField(x**4 - x**2 + 7)
|
627
|
-
sage: O = L.maximal_order() ; O.is_noetherian()
|
628
|
-
True
|
629
|
-
sage: E.<w> = NumberField(x^2 - x + 2)
|
630
|
-
sage: OE = E.ring_of_integers(); OE.is_noetherian()
|
631
|
-
True
|
632
|
-
"""
|
633
|
-
return True
|
634
|
-
|
635
631
|
def is_integrally_closed(self) -> bool:
|
636
632
|
r"""
|
637
633
|
Return whether this ring is integrally closed.
|
@@ -823,7 +819,7 @@ class Order(Parent, sage.rings.abc.Order):
|
|
823
819
|
from sage.matrix.constructor import Matrix
|
824
820
|
self.__basis_matrix_inverse = Matrix([to_V(b) for b in self.basis()]).inverse()
|
825
821
|
M = self.__basis_matrix_inverse
|
826
|
-
return to_V(K(x))*M
|
822
|
+
return to_V(K(x)) * M
|
827
823
|
|
828
824
|
def free_module(self):
|
829
825
|
r"""
|
@@ -1376,7 +1372,8 @@ class Order(Parent, sage.rings.abc.Order):
|
|
1376
1372
|
sage: A.random_element().parent() is A
|
1377
1373
|
True
|
1378
1374
|
"""
|
1379
|
-
return sum([ZZ.random_element(*args, **kwds)*
|
1375
|
+
return sum([ZZ.random_element(*args, **kwds) * a
|
1376
|
+
for a in self.basis()])
|
1380
1377
|
|
1381
1378
|
def absolute_degree(self):
|
1382
1379
|
r"""
|
@@ -1494,41 +1491,41 @@ class Order(Parent, sage.rings.abc.Order):
|
|
1494
1491
|
elements.append(self(a))
|
1495
1492
|
return elements
|
1496
1493
|
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1494
|
+
# def absolute_polynomial(self):
|
1495
|
+
# """
|
1496
|
+
# Return the absolute polynomial of this order, which is just the absolute polynomial of the number field.
|
1500
1497
|
|
1501
|
-
|
1498
|
+
# EXAMPLES::
|
1502
1499
|
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1500
|
+
# sage: K.<a, b> = NumberField([x^2 + 1, x^3 + x + 1]); OK = K.maximal_order()
|
1501
|
+
# Traceback (most recent call last):
|
1502
|
+
# ...
|
1503
|
+
# NotImplementedError
|
1507
1504
|
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1505
|
+
# #sage: OK.absolute_polynomial()
|
1506
|
+
# #x^6 + 5*x^4 - 2*x^3 + 4*x^2 + 4*x + 1
|
1507
|
+
# """
|
1508
|
+
# return self.number_field().absolute_polynomial()
|
1512
1509
|
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1510
|
+
# def polynomial(self):
|
1511
|
+
# """
|
1512
|
+
# Return the polynomial defining the number field that contains self.
|
1513
|
+
# """
|
1514
|
+
# return self.number_field().polynomial()
|
1518
1515
|
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1516
|
+
# def polynomial_ntl(self):
|
1517
|
+
# """
|
1518
|
+
# Return defining polynomial of the parent number field as a
|
1519
|
+
# pair, an ntl polynomial and a denominator.
|
1523
1520
|
|
1524
|
-
|
1521
|
+
# This is used mainly to implement some internal arithmetic.
|
1525
1522
|
|
1526
|
-
|
1523
|
+
# EXAMPLES::
|
1527
1524
|
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1525
|
+
# sage: NumberField(x^2 + 1,'a').maximal_order().polynomial_ntl()
|
1526
|
+
# ([1 0 1], 1)
|
1527
|
+
# """
|
1528
|
+
# return self.number_field().polynomial_ntl()
|
1532
1529
|
|
1533
1530
|
|
1534
1531
|
class Order_absolute(Order):
|
@@ -1605,7 +1602,7 @@ class Order_absolute(Order):
|
|
1605
1602
|
3*a^2 + 2*a + 1
|
1606
1603
|
"""
|
1607
1604
|
if isinstance(x, (tuple, list)):
|
1608
|
-
x = sum(xi*gi for xi, gi in zip(x, self.gens()))
|
1605
|
+
x = sum(xi * gi for xi, gi in zip(x, self.gens()))
|
1609
1606
|
if not isinstance(x, Element) or x.parent() is not self._K:
|
1610
1607
|
x = self._K(x)
|
1611
1608
|
V, _, embedding = self._K.vector_space()
|
@@ -65,15 +65,13 @@ from sage.structure.richcmp import richcmp
|
|
65
65
|
from sage.structure.sequence import Sequence
|
66
66
|
from sage.rings.integer_ring import ZZ
|
67
67
|
from sage.rings.rational_field import QQ
|
68
|
-
from sage.arith.misc import gcd
|
69
|
-
from sage.matrix.constructor import matrix
|
70
68
|
from sage.modules.free_module_element import vector
|
71
69
|
from sage.rings.polynomial.polynomial_ring import polygens
|
72
70
|
from sage.rings.ideal import Ideal_generic
|
73
71
|
|
74
72
|
import sage.rings.number_field.order
|
75
73
|
|
76
|
-
#TODO I*u works when u lies in I.ring().number_field(), but u*I doesn't
|
74
|
+
# TODO I*u works when u lies in I.ring().number_field(), but u*I doesn't
|
77
75
|
|
78
76
|
|
79
77
|
def NumberFieldOrderIdeal(O, *args, **kwds):
|
@@ -779,9 +777,8 @@ def _random_for_testing():
|
|
779
777
|
from sage.rings.number_field.number_field import QuadraticField
|
780
778
|
from sage.arith.misc import primes
|
781
779
|
from sage.rings.finite_rings.integer_mod_ring import Zmod
|
782
|
-
from sage.misc.misc_c import prod
|
783
780
|
while True:
|
784
|
-
d = ZZ(choice((-1
|
781
|
+
d = ZZ(choice((-1, +1)) * randrange(1, 10**5))
|
785
782
|
if not d.is_square():
|
786
783
|
break
|
787
784
|
K,t = QuadraticField(d).objgen()
|
Binary file
|
Binary file
|
@@ -132,7 +132,6 @@ cdef list quotient_by_var(list L, size_t index):
|
|
132
132
|
Return the quotient of the ideal represented by ``L`` and the
|
133
133
|
variable number ``index``.
|
134
134
|
"""
|
135
|
-
cdef ETuple m_j
|
136
135
|
cdef list result = L[:len(L)] # creates a copy
|
137
136
|
cdef size_t i
|
138
137
|
for i in range(len(L)):
|
@@ -167,7 +166,6 @@ cdef bint HilbertBaseCase(Polynomial_integer_dense_flint fhs, Node D, tuple w) n
|
|
167
166
|
Otherwiese, ``False`` is returned.
|
168
167
|
"""
|
169
168
|
cdef size_t i, j, exp
|
170
|
-
cdef int e
|
171
169
|
# First, the easiest cases:
|
172
170
|
if not D.Id: # The zero ideal
|
173
171
|
fmpz_poly_set_coeff_si(fhs._poly, 0, 1) # = PR(1)
|
@@ -228,7 +226,6 @@ cdef bint HilbertBaseCase(Polynomial_integer_dense_flint fhs, Node D, tuple w) n
|
|
228
226
|
|
229
227
|
easy = True
|
230
228
|
cdef ETuple m2
|
231
|
-
cdef list v
|
232
229
|
for j in range(i+1, len(D.Id)):
|
233
230
|
if (<ETuple>PyList_GET_ITEM(D.Id,j))._nonzero > 1:
|
234
231
|
# i.e., another generator contains more than a single var
|
@@ -297,7 +294,7 @@ cdef make_children(Node D, tuple w):
|
|
297
294
|
if ``D.Right`` is not ``None``.
|
298
295
|
"""
|
299
296
|
cdef size_t j, m
|
300
|
-
cdef int i
|
297
|
+
cdef int i
|
301
298
|
# Determine the variable that appears most often in the monomials.
|
302
299
|
# If "most often" means "only once", then instead we choose a variable that is
|
303
300
|
# guaranteed to appear in a composed monomial.
|
@@ -491,9 +488,9 @@ def first_hilbert_series(I, grading=None, return_grading=False):
|
|
491
488
|
br = S('basering')
|
492
489
|
if S.eval('isQuotientRing(basering)')=='1':
|
493
490
|
L = S('ringlist(basering)')
|
494
|
-
R = S('ring(list(%s[1..3],ideal(0)))'%L.name())
|
491
|
+
R = S('ring(list(%s[1..3],ideal(0)))' % L.name())
|
495
492
|
R.set_ring()
|
496
|
-
I = S('fetch(%s,%s)+ideal(%s)'%(br.name(),I.name(),br.name()))
|
493
|
+
I = S('fetch(%s,%s)+ideal(%s)' % (br.name(), I.name(), br.name()))
|
497
494
|
|
498
495
|
I = [ETuple([int(x) for x in S.eval('string(leadexp({}[{}]))'.format(I.name(), i)).split(',')])
|
499
496
|
for i in range(1,int(S.eval('size({})'.format(I.name())))+1)]
|
Binary file
|
Binary file
|
@@ -408,7 +408,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
|
|
408
408
|
cdef RealBall arb_a, arb_z
|
409
409
|
cdef ComplexBall acb_a, acb_z
|
410
410
|
|
411
|
-
cdef unsigned long limbs
|
412
411
|
cdef fmpz_t a_fmpz
|
413
412
|
cdef fmpz_t z_fmpz
|
414
413
|
|
@@ -1648,16 +1647,15 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
|
|
1648
1647
|
sage: f = -30*x; f.factor()
|
1649
1648
|
(-1) * 2 * 3 * 5 * x
|
1650
1649
|
"""
|
1651
|
-
cdef int i
|
1652
1650
|
cdef long deg = fmpz_poly_degree(self._poly)
|
1653
1651
|
# it appears that pari has a window from about degrees 30 and 300
|
1654
1652
|
# in which it beats NTL.
|
1655
1653
|
c = self.content()
|
1656
|
-
g = self//c
|
1654
|
+
g = self // c
|
1657
1655
|
if deg < 30 or deg > 300:
|
1658
|
-
return c.factor()*g._factor_ntl()
|
1656
|
+
return c.factor() * g._factor_ntl()
|
1659
1657
|
else:
|
1660
|
-
return c.factor()*g._factor_pari()
|
1658
|
+
return c.factor() * g._factor_pari()
|
1661
1659
|
|
1662
1660
|
def factor_mod(self, p):
|
1663
1661
|
"""
|
Binary file
|
Binary file
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-flint
|
2
|
-
|
2
|
+
# ############################################################################
|
3
3
|
# Copyright (C) 2010 Sebastian Pancratz <sfp@pancratz.org> #
|
4
4
|
# #
|
5
5
|
# Distributed under the terms of the GNU General Public License (GPL) #
|
6
6
|
# #
|
7
|
-
#
|
8
|
-
|
7
|
+
# https://www.gnu.org/licenses/ #
|
8
|
+
# ############################################################################
|
9
9
|
|
10
10
|
from sage.libs.flint.types cimport fmpq_poly_t
|
11
11
|
|
@@ -25,6 +25,7 @@ AUTHOR:
|
|
25
25
|
|
26
26
|
from cysignals.signals cimport sig_on, sig_str, sig_off
|
27
27
|
|
28
|
+
from libc.limits cimport LONG_MIN
|
28
29
|
from cpython.long cimport PyLong_AsLong
|
29
30
|
from sage.arith.long cimport pyobject_to_long
|
30
31
|
|
@@ -784,7 +785,7 @@ cdef class Polynomial_rational_flint(Polynomial):
|
|
784
785
|
# Shifting #
|
785
786
|
###########################################################################
|
786
787
|
|
787
|
-
def __lshift__(self, n):
|
788
|
+
def __lshift__(self, long n):
|
788
789
|
"""
|
789
790
|
Notationally multiply ``self`` by `t^n`.
|
790
791
|
|
@@ -797,27 +798,34 @@ cdef class Polynomial_rational_flint(Polynomial):
|
|
797
798
|
TESTS::
|
798
799
|
|
799
800
|
sage: R.<t> = QQ[]
|
801
|
+
sage: t << (-1)
|
802
|
+
1
|
803
|
+
sage: t << (-10)
|
804
|
+
0
|
800
805
|
sage: f = R.random_element(1000)
|
801
806
|
sage: (f << 23) >> 23 == f # indirect doctest
|
802
807
|
True
|
803
808
|
"""
|
804
|
-
|
809
|
+
if n < 0:
|
810
|
+
assert n != LONG_MIN
|
811
|
+
return self >> (-n)
|
812
|
+
|
805
813
|
cdef Polynomial_rational_flint f = <Polynomial_rational_flint> self
|
806
814
|
cdef Polynomial_rational_flint res
|
807
815
|
cdef bint do_sig
|
808
816
|
|
809
|
-
if
|
817
|
+
if n == 0 or fmpq_poly_is_zero(f._poly):
|
810
818
|
return self
|
811
819
|
else:
|
812
820
|
res = f._new()
|
813
821
|
do_sig = fmpq_poly_length(f._poly) > 5000 or n > 5000
|
814
822
|
|
815
823
|
if do_sig: sig_str("FLINT exception")
|
816
|
-
fmpq_poly_shift_left(res._poly, f._poly,
|
824
|
+
fmpq_poly_shift_left(res._poly, f._poly, n)
|
817
825
|
if do_sig: sig_off()
|
818
826
|
return res
|
819
827
|
|
820
|
-
def __rshift__(self, n):
|
828
|
+
def __rshift__(self, long n):
|
821
829
|
"""
|
822
830
|
Notationally return the quotient of Euclidean division of ``self``
|
823
831
|
by `t^n`.
|
@@ -828,20 +836,25 @@ cdef class Polynomial_rational_flint(Polynomial):
|
|
828
836
|
sage: f = 1 + t + t^2/2 + t^3/3 + t^4/4
|
829
837
|
sage: f >> 2
|
830
838
|
1/4*t^2 + 1/3*t + 1/2
|
839
|
+
sage: f >> (-2)
|
840
|
+
1/4*t^6 + 1/3*t^5 + 1/2*t^4 + t^3 + t^2
|
831
841
|
"""
|
832
|
-
|
842
|
+
if n < 0:
|
843
|
+
assert n != LONG_MIN
|
844
|
+
return self << (-n)
|
845
|
+
|
833
846
|
cdef Polynomial_rational_flint f = <Polynomial_rational_flint> self
|
834
847
|
cdef Polynomial_rational_flint res
|
835
848
|
cdef bint do_sig
|
836
849
|
|
837
|
-
if
|
850
|
+
if n == 0 or fmpq_poly_is_zero(f._poly):
|
838
851
|
return self
|
839
852
|
else:
|
840
853
|
res = f._new()
|
841
854
|
do_sig = _do_sig(f._poly)
|
842
855
|
|
843
856
|
if do_sig: sig_str("FLINT exception")
|
844
|
-
fmpq_poly_shift_right(res._poly, f._poly,
|
857
|
+
fmpq_poly_shift_right(res._poly, f._poly, n)
|
845
858
|
if do_sig: sig_off()
|
846
859
|
return res
|
847
860
|
|
@@ -2218,9 +2231,9 @@ cdef class Polynomial_rational_flint(Polynomial):
|
|
2218
2231
|
from sage.groups.perm_gps.permgroup_named import TransitiveGroup
|
2219
2232
|
kash.eval('X := PolynomialRing(RationalField()).1')
|
2220
2233
|
s = self._repr(name='X')
|
2221
|
-
G = kash('Galois(%s)'%s)
|
2222
|
-
d = int(kash.eval('%s.ext1'%G.name()))
|
2223
|
-
n = int(kash.eval('%s.ext2'%G.name()))
|
2234
|
+
G = kash('Galois(%s)' % s)
|
2235
|
+
d = int(kash.eval('%s.ext1' % G.name()))
|
2236
|
+
n = int(kash.eval('%s.ext2' % G.name()))
|
2224
2237
|
return TransitiveGroup(d, n)
|
2225
2238
|
except RuntimeError as msg:
|
2226
2239
|
raise NotImplementedError(str(msg) + "\nSorry, " +
|
Binary file
|
@@ -191,7 +191,6 @@ cdef class Polynomial_zmod_flint(Polynomial_template):
|
|
191
191
|
"""
|
192
192
|
cdef list l_in = x
|
193
193
|
cdef unsigned long length = len(l_in)
|
194
|
-
cdef unsigned long modulus = nmod_poly_modulus(&self.x)
|
195
194
|
cdef int i
|
196
195
|
if length == 0:
|
197
196
|
nmod_poly_zero(&self.x)
|
@@ -409,9 +408,9 @@ cdef class Polynomial_zmod_flint(Polynomial_template):
|
|
409
408
|
n = int(n)
|
410
409
|
value = self.base_ring()(value)
|
411
410
|
if n >= 0:
|
412
|
-
nmod_poly_set_coeff_ui(&self.x, n, int(value)%nmod_poly_modulus(&self.x))
|
411
|
+
nmod_poly_set_coeff_ui(&self.x, n, int(value) % nmod_poly_modulus(&self.x))
|
413
412
|
else:
|
414
|
-
raise IndexError("
|
413
|
+
raise IndexError("polynomial coefficient index must be nonnegative")
|
415
414
|
|
416
415
|
cpdef Polynomial _mul_trunc_(self, Polynomial right, long n):
|
417
416
|
"""
|
@@ -645,7 +644,7 @@ cdef class Polynomial_zmod_flint(Polynomial_template):
|
|
645
644
|
cdef Polynomial_zmod_flint s0 = self._new()
|
646
645
|
cdef Polynomial_zmod_flint t0 = P.one()
|
647
646
|
cdef Polynomial_zmod_flint s1 = m
|
648
|
-
cdef Polynomial_zmod_flint t1 = self%m
|
647
|
+
cdef Polynomial_zmod_flint t1 = self % m
|
649
648
|
|
650
649
|
cdef Polynomial_zmod_flint q
|
651
650
|
cdef Polynomial_zmod_flint r0
|
Binary file
|
Binary file
|
Binary file
|
@@ -299,7 +299,7 @@ class WeilPolynomials_iter():
|
|
299
299
|
k = Integer(k)
|
300
300
|
if len(modlist) == 0 and k != 0:
|
301
301
|
raise ValueError("Leading coefficient must be specified exactly")
|
302
|
-
if
|
302
|
+
if modlist and ((k != 0 and modlist[-1] % k != 0) or (k == 0 and modlist[-1] != 0)):
|
303
303
|
raise ValueError("Invalid moduli")
|
304
304
|
coefflist.append(j)
|
305
305
|
modlist.append(k)
|
sage/rings/qqbar.py
CHANGED
@@ -8665,7 +8665,7 @@ class ANBinaryExpr(ANDescr):
|
|
8665
8665
|
sage: n = sqrt(AA(2)) + one
|
8666
8666
|
sage: one == 1 # needs sage.symbolic
|
8667
8667
|
True
|
8668
|
-
sage: sage_input(n)
|
8668
|
+
sage: sage_input(n) # needs sage.symbolic
|
8669
8669
|
R.<x> = AA[]
|
8670
8670
|
QQbar.polynomial_root(AA.common_polynomial(x^2 - 2), RIF(RR(1.4142135623730949), RR(1.4142135623730951))) + 1
|
8671
8671
|
sage: from sage.rings.qqbar import *
|
Binary file
|
sage/rings/real_arb.pyx
CHANGED
@@ -581,7 +581,7 @@ class RealBallField(UniqueRepresentation, sage.rings.abc.RealBallField):
|
|
581
581
|
|
582
582
|
return super()._repr_option(key)
|
583
583
|
|
584
|
-
def gens(self):
|
584
|
+
def gens(self) -> tuple:
|
585
585
|
r"""
|
586
586
|
EXAMPLES::
|
587
587
|
|
@@ -3111,6 +3111,17 @@ cdef class RealBall(RingElement):
|
|
3111
3111
|
raise TypeError("unsupported operand type(s) for >>: '{}' and '{}'"
|
3112
3112
|
.format(type(val).__name__, type(shift).__name__))
|
3113
3113
|
|
3114
|
+
def conjugate(self):
|
3115
|
+
r"""
|
3116
|
+
Return the conjugate of this ball.
|
3117
|
+
|
3118
|
+
EXAMPLES::
|
3119
|
+
|
3120
|
+
sage: RBF(1).conjugate()
|
3121
|
+
1.000000000000000
|
3122
|
+
"""
|
3123
|
+
return self
|
3124
|
+
|
3114
3125
|
# Elementary functions
|
3115
3126
|
|
3116
3127
|
def log(self, base=None):
|
@@ -3536,12 +3547,12 @@ cdef class RealBall(RingElement):
|
|
3536
3547
|
|
3537
3548
|
EXAMPLES::
|
3538
3549
|
|
3539
|
-
sage: RBF(1).Ei() # abs tol 5e-
|
3550
|
+
sage: RBF(1).Ei() # abs tol 5e-15
|
3540
3551
|
[1.89511781635594 +/- 4.94e-15]
|
3541
3552
|
|
3542
3553
|
TESTS::
|
3543
3554
|
|
3544
|
-
sage: RBF(Ei(1)) # abs tol 5e-
|
3555
|
+
sage: RBF(Ei(1)) # abs tol 5e-15 # needs sage.symbolic
|
3545
3556
|
[1.89511781635594 +/- 4.94e-15]
|
3546
3557
|
"""
|
3547
3558
|
cdef RealBall res = self._new()
|
@@ -3600,12 +3611,12 @@ cdef class RealBall(RingElement):
|
|
3600
3611
|
|
3601
3612
|
EXAMPLES::
|
3602
3613
|
|
3603
|
-
sage: RBF(1).Shi()
|
3614
|
+
sage: RBF(1).Shi() # abs tol 5e-15
|
3604
3615
|
[1.05725087537573 +/- 2.77e-15]
|
3605
3616
|
|
3606
3617
|
TESTS::
|
3607
3618
|
|
3608
|
-
sage: RBF(Shi(1))
|
3619
|
+
sage: RBF(Shi(1)) # abs tol 5e-15 # needs sage.symbolic
|
3609
3620
|
[1.05725087537573 +/- 2.77e-15]
|
3610
3621
|
"""
|
3611
3622
|
cdef RealBall res = self._new()
|
@@ -3622,12 +3633,12 @@ cdef class RealBall(RingElement):
|
|
3622
3633
|
|
3623
3634
|
EXAMPLES::
|
3624
3635
|
|
3625
|
-
sage: RBF(1).Chi() # abs tol
|
3636
|
+
sage: RBF(1).Chi() # abs tol 5e-16
|
3626
3637
|
[0.837866940980208 +/- 4.72e-16]
|
3627
3638
|
|
3628
3639
|
TESTS::
|
3629
3640
|
|
3630
|
-
sage: RBF(Chi(1)) # abs tol
|
3641
|
+
sage: RBF(Chi(1)) # abs tol 5e-16 # needs sage.symbolic
|
3631
3642
|
[0.837866940980208 +/- 4.72e-16]
|
3632
3643
|
"""
|
3633
3644
|
cdef RealBall res = self._new()
|
@@ -3644,14 +3655,14 @@ cdef class RealBall(RingElement):
|
|
3644
3655
|
|
3645
3656
|
EXAMPLES::
|
3646
3657
|
|
3647
|
-
sage: RBF(3).li() # abs tol
|
3658
|
+
sage: RBF(3).li() # abs tol 5e-15
|
3648
3659
|
[2.16358859466719 +/- 4.72e-15]
|
3649
3660
|
|
3650
3661
|
TESTS::
|
3651
3662
|
|
3652
3663
|
sage: RBF(li(0)) # needs sage.symbolic
|
3653
3664
|
0
|
3654
|
-
sage: RBF(Li(0))
|
3665
|
+
sage: RBF(Li(0)) # abs tol 5e-15 # needs sage.symbolic
|
3655
3666
|
[-1.04516378011749 +/- 4.23e-15]
|
3656
3667
|
"""
|
3657
3668
|
cdef RealBall res = self._new()
|
@@ -3668,7 +3679,7 @@ cdef class RealBall(RingElement):
|
|
3668
3679
|
|
3669
3680
|
EXAMPLES::
|
3670
3681
|
|
3671
|
-
sage: RBF(3).Li() # abs tol
|
3682
|
+
sage: RBF(3).Li() # abs tol 5e-15
|
3672
3683
|
[1.11842481454970 +/- 7.61e-15]
|
3673
3684
|
"""
|
3674
3685
|
cdef RealBall res = self._new()
|
Binary file
|
Binary file
|