passagemath-flint 10.5.42__cp311-cp311-macosx_14_0_arm64.whl → 10.6.1rc1__cp311-cp311-macosx_14_0_arm64.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.42.dist-info → passagemath_flint-10.6.1rc1.dist-info}/METADATA +5 -6
- {passagemath_flint-10.5.42.dist-info → passagemath_flint-10.6.1rc1.dist-info}/RECORD +106 -106
- passagemath_flint.dylibs/{libflint.19.0.dylib → libflint.20.0.dylib} +0 -0
- passagemath_flint.dylibs/libgcc_s.1.1.dylib +0 -0
- passagemath_flint.dylibs/libgf2x.3.dylib +0 -0
- passagemath_flint.dylibs/libgfortran.5.dylib +0 -0
- passagemath_flint.dylibs/libmpfi.0.dylib +0 -0
- passagemath_flint.dylibs/libopenblas_armv8p-r0.3.29.dylib +0 -0
- passagemath_flint.dylibs/libquadmath.0.dylib +0 -0
- sage/combinat/posets/hasse_cython_flint.cpython-311-darwin.so +0 -0
- sage/data_structures/bounded_integer_sequences.cpython-311-darwin.so +0 -0
- sage/data_structures/bounded_integer_sequences.pyx +22 -20
- sage/graphs/chrompoly.cpython-311-darwin.so +0 -0
- sage/graphs/chrompoly.pyx +4 -3
- sage/graphs/matchpoly.cpython-311-darwin.so +0 -0
- sage/libs/arb/arith.cpython-311-darwin.so +0 -0
- sage/libs/flint/arith.cpython-311-darwin.so +0 -0
- sage/libs/flint/arith_sage.cpython-311-darwin.so +0 -0
- sage/libs/flint/flint.pxd +2 -2
- sage/libs/flint/flint_sage.cpython-311-darwin.so +0 -0
- sage/libs/flint/flint_wrap.h +4 -0
- sage/libs/flint/fmpq_poly_sage.cpython-311-darwin.so +0 -0
- sage/libs/flint/fmpz_factor_sage.cpython-311-darwin.so +0 -0
- sage/libs/flint/fmpz_poly.cpython-311-darwin.so +0 -0
- sage/libs/flint/fmpz_poly_sage.cpython-311-darwin.so +0 -0
- sage/libs/flint/nmod_poly_linkage.pxi +5 -4
- sage/libs/flint/qsieve.cpython-311-darwin.so +0 -0
- sage/libs/flint/qsieve_sage.cpython-311-darwin.so +0 -0
- sage/libs/flint/types.pxd +2 -2
- sage/libs/flint/ulong_extras.cpython-311-darwin.so +0 -0
- sage/libs/flint/ulong_extras_sage.cpython-311-darwin.so +0 -0
- sage/matrix/change_ring.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_complex_ball_dense.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_cyclo_dense.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_cyclo_dense.pyx +3 -3
- sage/matrix/matrix_integer_dense.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_integer_dense.pyx +50 -33
- sage/matrix/matrix_integer_sparse.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_integer_sparse.pyx +1 -1
- sage/matrix/matrix_rational_dense.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_rational_dense.pyx +64 -28
- sage/matrix/matrix_rational_sparse.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_rational_sparse.pyx +3 -3
- sage/matrix/misc_flint.cpython-311-darwin.so +0 -0
- sage/modular/modform/eis_series_cython.cpython-311-darwin.so +0 -0
- sage/modular/modsym/apply.cpython-311-darwin.so +0 -0
- sage/modular/modsym/heilbronn.cpython-311-darwin.so +0 -0
- sage/modular/pollack_stevens/dist.cpython-311-darwin.so +0 -0
- sage/modular/pollack_stevens/dist.pyx +2 -2
- sage/quivers/algebra.py +2 -1
- sage/quivers/algebra_elements.cpython-311-darwin.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-311-darwin.so +0 -0
- sage/quivers/paths.pyx +2 -2
- sage/quivers/representation.py +22 -24
- sage/rings/complex_arb.cpython-311-darwin.so +0 -0
- sage/rings/complex_arb.pyx +37 -36
- sage/rings/complex_interval.cpython-311-darwin.so +0 -0
- sage/rings/convert/mpfi.cpython-311-darwin.so +0 -0
- sage/rings/factorint_flint.cpython-311-darwin.so +0 -0
- sage/rings/fraction_field_FpT.cpython-311-darwin.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 +98 -76
- sage/rings/number_field/number_field_element.cpython-311-darwin.so +0 -0
- sage/rings/number_field/number_field_element.pyx +72 -0
- sage/rings/number_field/number_field_element_quadratic.cpython-311-darwin.so +0 -0
- sage/rings/number_field/number_field_element_quadratic.pyx +35 -17
- sage/rings/number_field/number_field_morphisms.cpython-311-darwin.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-311-darwin.so +0 -0
- sage/rings/polynomial/hilbert.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/hilbert.pyx +3 -6
- sage/rings/polynomial/polynomial_complex_arb.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/polynomial_integer_dense_flint.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/polynomial_integer_dense_flint.pyx +3 -5
- sage/rings/polynomial/polynomial_number_field.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/polynomial_rational_flint.cpython-311-darwin.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-311-darwin.so +0 -0
- sage/rings/polynomial/polynomial_zmod_flint.pyx +3 -4
- sage/rings/polynomial/real_roots.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/real_roots.pyx +1 -1
- sage/rings/polynomial/refine_root.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/weil/weil_polynomials.cpython-311-darwin.so +0 -0
- sage/rings/polynomial/weil/weil_polynomials.pyx +1 -1
- sage/rings/qqbar.py +1 -1
- sage/rings/real_arb.cpython-311-darwin.so +0 -0
- sage/rings/real_arb.pyx +21 -10
- sage/rings/real_interval_absolute.cpython-311-darwin.so +0 -0
- sage/rings/real_mpfi.cpython-311-darwin.so +0 -0
- sage/rings/real_mpfi.pyx +14 -11
- sage/schemes/elliptic_curves/descent_two_isogeny.cpython-311-darwin.so +0 -0
- sage/schemes/elliptic_curves/descent_two_isogeny.pyx +11 -0
- {passagemath_flint-10.5.42.dist-info → passagemath_flint-10.6.1rc1.dist-info}/WHEEL +0 -0
- {passagemath_flint-10.5.42.dist-info → passagemath_flint-10.6.1rc1.dist-info}/top_level.txt +0 -0
sage/rings/complex_arb.pyx
CHANGED
@@ -494,7 +494,7 @@ class ComplexBallField(UniqueRepresentation, sage.rings.abc.ComplexBallField):
|
|
494
494
|
else:
|
495
495
|
raise ValueError("only one generator")
|
496
496
|
|
497
|
-
def gens(self):
|
497
|
+
def gens(self) -> tuple:
|
498
498
|
r"""
|
499
499
|
Return the tuple of generators of this complex ball field, i.e.
|
500
500
|
``(i,)``.
|
@@ -790,27 +790,28 @@ class ComplexBallField(UniqueRepresentation, sage.rings.abc.ComplexBallField):
|
|
790
790
|
...
|
791
791
|
ValueError: polynomial with interval coefficients, use multiplicities=False
|
792
792
|
|
793
|
-
sage: (x^4 - 1/3).roots(multiplicities=False)
|
794
|
-
[
|
795
|
-
[
|
796
|
-
[+/-
|
797
|
-
[+/-
|
793
|
+
sage: set((x^4 - 1/3).roots(multiplicities=False)) # indirect doctest
|
794
|
+
{[+/- 1.27e-16] + [-0.759835685651593 +/- 5.90e-16]*I,
|
795
|
+
[+/- 1.27e-16] + [0.759835685651593 +/- 5.90e-16]*I,
|
796
|
+
[-0.759835685651593 +/- 5.90e-16] + [+/- 1.27e-16]*I,
|
797
|
+
[0.759835685651593 +/- 5.90e-16] + [+/- 1.27e-16]*I}
|
798
798
|
|
799
|
-
sage: (x^4 - 1/3).roots(RBF, multiplicities=False)
|
800
|
-
[
|
799
|
+
sage: set((x^4 - 1/3).roots(RBF, multiplicities=False))
|
800
|
+
{[-0.759835685651593 +/- 5.90e-16], [0.759835685651593 +/- 5.90e-16]}
|
801
801
|
|
802
|
-
sage: (x^4 - 3).roots(RealBallField(100), multiplicities=False)
|
803
|
-
[
|
804
|
-
[1.316074012952492460819218901797 +/-
|
802
|
+
sage: set((x^4 - 3).roots(RealBallField(100), multiplicities=False))
|
803
|
+
{[-1.316074012952492460819218901797 +/- 9.7e-34],
|
804
|
+
[1.316074012952492460819218901797 +/- 9.7e-34]}
|
805
805
|
|
806
|
-
sage: (x^4 - 3).roots(ComplexIntervalField(100),
|
806
|
+
sage: sorted((x^4 - 3).roots(ComplexIntervalField(100),
|
807
|
+
....: multiplicities=False), key=repr)
|
807
808
|
[-1.31607401295249246081921890180? + 0.?e-37*I,
|
808
|
-
1.31607401295249246081921890180? + 0.?e-37*I,
|
809
809
|
0.?e-37 + 1.31607401295249246081921890180?*I,
|
810
|
-
0.?e-37 - 1.31607401295249246081921890180?*I
|
810
|
+
0.?e-37 - 1.31607401295249246081921890180?*I,
|
811
|
+
1.31607401295249246081921890180? + 0.?e-37*I]
|
811
812
|
|
812
|
-
sage: (x^2 - i/3).roots(ComplexBallField(2), multiplicities=False)
|
813
|
-
[
|
813
|
+
sage: set((x^2 - i/3).roots(ComplexBallField(2), multiplicities=False))
|
814
|
+
{[+/- 0.409] + [+/- 0.409]*I, [+/- 0.409] + [+/- 0.409]*I}
|
814
815
|
|
815
816
|
sage: ((x - 1)^2).roots(multiplicities=False)
|
816
817
|
Traceback (most recent call last):
|
@@ -820,8 +821,8 @@ class ComplexBallField(UniqueRepresentation, sage.rings.abc.ComplexBallField):
|
|
820
821
|
sage: ((x - 1)^2).roots(multiplicities=False, proof=False)
|
821
822
|
doctest:...
|
822
823
|
UserWarning: roots may have been lost...
|
823
|
-
[[1.
|
824
|
-
[1.
|
824
|
+
[[1.000000000... +/- ...] + [+/- ...]*I,
|
825
|
+
[1.000000000... +/- ...] + [+/- ...]*I]
|
825
826
|
|
826
827
|
sage: pol = x^7 - 2*(1000*x - 1)^2 # Mignotte polynomial
|
827
828
|
sage: pol.roots(multiplicities=False)
|
@@ -846,7 +847,7 @@ class ComplexBallField(UniqueRepresentation, sage.rings.abc.ComplexBallField):
|
|
846
847
|
sage: ((x - 1)^2 + 2^(-70)*i/3).roots(RBF, multiplicities=False)
|
847
848
|
Traceback (most recent call last):
|
848
849
|
...
|
849
|
-
ValueError:
|
850
|
+
ValueError: ...
|
850
851
|
|
851
852
|
TESTS::
|
852
853
|
|
@@ -4264,14 +4265,14 @@ cdef class ComplexBall(RingElement):
|
|
4264
4265
|
|
4265
4266
|
EXAMPLES::
|
4266
4267
|
|
4267
|
-
sage: CBF(1, 1).Ei()
|
4268
|
-
[1.76462598556385 +/-
|
4268
|
+
sage: CBF(1, 1).Ei() # abs tol 6e-15
|
4269
|
+
[1.76462598556385 +/- 6.03e-15] + [2.38776985151052 +/- 4.23e-15]*I
|
4269
4270
|
sage: CBF(0).Ei()
|
4270
|
-
nan
|
4271
|
+
nan...
|
4271
4272
|
|
4272
4273
|
TESTS:
|
4273
4274
|
|
4274
|
-
sage: CBF(Ei(I)) # abs tol
|
4275
|
+
sage: CBF(Ei(I)) # abs tol 2e-15 # needs sage.symbolic
|
4275
4276
|
[0.337403922900968 +/- 3.76e-16] + [2.51687939716208 +/- 2.01e-15]*I
|
4276
4277
|
"""
|
4277
4278
|
cdef ComplexBall result = self._new()
|
@@ -4286,14 +4287,14 @@ cdef class ComplexBall(RingElement):
|
|
4286
4287
|
|
4287
4288
|
EXAMPLES::
|
4288
4289
|
|
4289
|
-
sage: CBF(1, 1).Si()
|
4290
|
-
[1.10422265823558 +/-
|
4290
|
+
sage: CBF(1, 1).Si() # abs tol 3e-15
|
4291
|
+
[1.10422265823558 +/- 2.48e-15] + [0.88245380500792 +/- 3.36e-15]*I
|
4291
4292
|
sage: CBF(0).Si()
|
4292
4293
|
0
|
4293
4294
|
|
4294
4295
|
TESTS:
|
4295
4296
|
|
4296
|
-
sage: CBF(Si(I))
|
4297
|
+
sage: CBF(Si(I)) # abs tol 3e-15 # needs sage.symbolic
|
4297
4298
|
[1.05725087537573 +/- 2.77e-15]*I
|
4298
4299
|
"""
|
4299
4300
|
cdef ComplexBall result = self._new()
|
@@ -4310,14 +4311,14 @@ cdef class ComplexBall(RingElement):
|
|
4310
4311
|
|
4311
4312
|
EXAMPLES::
|
4312
4313
|
|
4313
|
-
sage: CBF(1, 1).Ci()
|
4314
|
-
[0.882172180555936 +/-
|
4314
|
+
sage: CBF(1, 1).Ci() # abs tol 5e-16
|
4315
|
+
[0.882172180555936 +/- 5.89e-16] + [0.287249133519956 +/- 3.37e-16]*I
|
4315
4316
|
sage: CBF(0).Ci()
|
4316
4317
|
nan + nan*I
|
4317
4318
|
|
4318
4319
|
TESTS:
|
4319
4320
|
|
4320
|
-
sage: CBF(Ci(I)) # abs tol
|
4321
|
+
sage: CBF(Ci(I)) # abs tol 5e-16 # needs sage.symbolic
|
4321
4322
|
[0.837866940980208 +/- 4.72e-16] + [1.570796326794897 +/- 5.54e-16]*I
|
4322
4323
|
"""
|
4323
4324
|
cdef ComplexBall result = self._new()
|
@@ -4334,8 +4335,8 @@ cdef class ComplexBall(RingElement):
|
|
4334
4335
|
|
4335
4336
|
EXAMPLES::
|
4336
4337
|
|
4337
|
-
sage: CBF(1, 1).Shi()
|
4338
|
-
[0.88245380500792 +/-
|
4338
|
+
sage: CBF(1, 1).Shi() # abs tol 3e-15
|
4339
|
+
[0.88245380500792 +/- 3.36e-15] + [1.10422265823558 +/- 2.48e-15]*I
|
4339
4340
|
sage: CBF(0).Shi()
|
4340
4341
|
0
|
4341
4342
|
|
@@ -4358,14 +4359,14 @@ cdef class ComplexBall(RingElement):
|
|
4358
4359
|
|
4359
4360
|
EXAMPLES::
|
4360
4361
|
|
4361
|
-
sage: CBF(1, 1).Chi()
|
4362
|
-
[0.882172180555936 +/-
|
4362
|
+
sage: CBF(1, 1).Chi() # abs tol 1e-15
|
4363
|
+
[0.882172180555936 +/- 5.89e-16] + [1.28354719327494 +/- 1.01e-15]*I
|
4363
4364
|
sage: CBF(0).Chi()
|
4364
4365
|
nan + nan*I
|
4365
4366
|
|
4366
4367
|
TESTS:
|
4367
4368
|
|
4368
|
-
sage: CBF(Chi(I)) # abs tol
|
4369
|
+
sage: CBF(Chi(I)) # abs tol 5e-16 # needs sage.symbolic
|
4369
4370
|
[0.337403922900968 +/- 3.25e-16] + [1.570796326794897 +/- 5.54e-16]*I
|
4370
4371
|
"""
|
4371
4372
|
cdef ComplexBall result = self._new()
|
@@ -4384,8 +4385,8 @@ cdef class ComplexBall(RingElement):
|
|
4384
4385
|
|
4385
4386
|
EXAMPLES::
|
4386
4387
|
|
4387
|
-
sage: CBF(1, 1).li()
|
4388
|
-
[0.61391166922120 +/-
|
4388
|
+
sage: CBF(1, 1).li() # abs tol 6e-15
|
4389
|
+
[0.61391166922120 +/- 6.23e-15] + [2.05958421419258 +/- 5.59e-15]*I
|
4389
4390
|
sage: CBF(0).li()
|
4390
4391
|
0
|
4391
4392
|
sage: CBF(0).li(offset=True)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -573,6 +573,35 @@ cdef class FpTElement(FieldElement):
|
|
573
573
|
normalize(x._numer, x._denom, self.p)
|
574
574
|
return x
|
575
575
|
|
576
|
+
def _im_gens_(self, codomain, im_gens, base_map=None):
|
577
|
+
r"""
|
578
|
+
Return the image of this element in ``codomain`` under the
|
579
|
+
map that sends the image of the generator of the parent to
|
580
|
+
the element in ``im_gens``.
|
581
|
+
|
582
|
+
INPUT:
|
583
|
+
|
584
|
+
- ``codomain`` -- a ring; where the image is computed
|
585
|
+
|
586
|
+
- ``im_gens`` -- a list containing the image of the
|
587
|
+
generator of the parent as unique element
|
588
|
+
|
589
|
+
- ``base_map`` -- a morphism (default: ``None``);
|
590
|
+
the action on the underlying base ring
|
591
|
+
|
592
|
+
EXAMPLES::
|
593
|
+
|
594
|
+
sage: A.<T> = GF(5)[]
|
595
|
+
sage: K.<T> = Frac(A)
|
596
|
+
sage: f = K.hom([T^2])
|
597
|
+
sage: f(1/T)
|
598
|
+
1/T^2
|
599
|
+
"""
|
600
|
+
nden = self.denom()._im_gens_(codomain, im_gens, base_map=base_map)
|
601
|
+
invden = nden.inverse_of_unit()
|
602
|
+
nnum = self.numer()._im_gens_(codomain, im_gens, base_map=base_map)
|
603
|
+
return nnum * invden
|
604
|
+
|
576
605
|
cpdef FpTElement next(self):
|
577
606
|
"""
|
578
607
|
Iterate through all polynomials, returning the "next" polynomial after this one.
|
@@ -1420,7 +1420,7 @@ def defining_polynomial_for_Kp(prime, prec=106):
|
|
1420
1420
|
L = [g.change_ring(ZZ) for g, _ in factors]
|
1421
1421
|
A = [g for g in L if (g(theta)).valuation(prime) >= e*N/2]
|
1422
1422
|
|
1423
|
-
# We narrow down the list
|
1423
|
+
# We narrow down the list until only one value remains
|
1424
1424
|
|
1425
1425
|
if len(A) == 1:
|
1426
1426
|
return A[0].change_ring(Integers(p**prec)).change_ring(ZZ)
|
@@ -995,7 +995,7 @@ class GaloisGroup_v2(GaloisGroup_perm):
|
|
995
995
|
sage: x = polygen(ZZ, 'x')
|
996
996
|
sage: K.<b> = NumberField(x^4 - 2*x^2 + 2, 'a').galois_closure()
|
997
997
|
sage: G = K.galois_group()
|
998
|
-
sage: sorted([G.artin_symbol(P) for P in K.primes_above(7)])
|
998
|
+
sage: sorted([G.artin_symbol(P) for P in K.primes_above(7)]) # random (see remark in primes_above)
|
999
999
|
[(1,4)(2,3)(5,8)(6,7),
|
1000
1000
|
(1,4)(2,3)(5,8)(6,7),
|
1001
1001
|
(1,5)(2,6)(3,7)(4,8),
|
@@ -7,18 +7,17 @@ This module provides classes to represent ring homomorphisms between number
|
|
7
7
|
fields (i.e. field embeddings).
|
8
8
|
"""
|
9
9
|
|
10
|
-
|
10
|
+
# ***************************************************************************
|
11
11
|
# Copyright (C) 2007 William Stein <wstein@gmail.com>
|
12
12
|
#
|
13
13
|
# This program is free software: you can redistribute it and/or modify
|
14
14
|
# it under the terms of the GNU General Public License as published by
|
15
15
|
# the Free Software Foundation, either version 2 of the License, or
|
16
16
|
# (at your option) any later version.
|
17
|
-
#
|
18
|
-
|
17
|
+
# https://www.gnu.org/licenses/
|
18
|
+
# ***************************************************************************
|
19
19
|
|
20
20
|
from sage.misc.cachefunc import cached_method
|
21
|
-
from sage.misc.lazy_import import lazy_import
|
22
21
|
|
23
22
|
from sage.rings.morphism import RingHomomorphism_im_gens, RingHomomorphism
|
24
23
|
from sage.structure.sequence import Sequence
|
@@ -86,8 +86,6 @@ import sage.rings.abc
|
|
86
86
|
import sage.rings.complex_mpfr
|
87
87
|
from sage.rings.polynomial.polynomial_element import Polynomial
|
88
88
|
import sage.rings.real_mpfr
|
89
|
-
import sage.rings.real_mpfi
|
90
|
-
import sage.rings.complex_double
|
91
89
|
import sage.rings.real_double
|
92
90
|
import sage.rings.real_lazy
|
93
91
|
|
@@ -96,7 +94,6 @@ from sage.misc.fast_methods import WithEqualityById
|
|
96
94
|
from sage.misc.functional import is_odd, lift
|
97
95
|
from sage.misc.lazy_import import lazy_import
|
98
96
|
from sage.misc.misc_c import prod
|
99
|
-
from sage.misc.sage_eval import sage_eval
|
100
97
|
from sage.rings.infinity import Infinity
|
101
98
|
from sage.rings.finite_rings.integer_mod import mod
|
102
99
|
from sage.categories.number_fields import NumberFields
|
@@ -115,6 +112,7 @@ from sage.structure.proof.proof import get_flag
|
|
115
112
|
from . import maps
|
116
113
|
from . import structure
|
117
114
|
from . import number_field_morphisms
|
115
|
+
from . import number_field_base
|
118
116
|
|
119
117
|
from sage.categories.homset import Hom
|
120
118
|
from sage.categories.sets_cat import Sets
|
@@ -125,7 +123,35 @@ from sage.rings.real_mpfr import RR
|
|
125
123
|
from sage.interfaces.abc import GapElement
|
126
124
|
from sage.rings.number_field.morphism import RelativeNumberFieldHomomorphism_from_abs
|
127
125
|
|
126
|
+
from sage.misc.latex import latex
|
127
|
+
|
128
|
+
import sage.rings.infinity as infinity
|
129
|
+
from sage.rings.rational import Rational
|
130
|
+
from sage.rings.integer import Integer
|
131
|
+
import sage.rings.polynomial.polynomial_element as polynomial_element
|
132
|
+
import sage.groups.abelian_gps.abelian_group
|
133
|
+
import sage.rings.complex_interval_field
|
134
|
+
|
135
|
+
from sage.structure.factory import UniqueFactory
|
136
|
+
from . import number_field_element
|
137
|
+
from . import number_field_element_quadratic
|
138
|
+
from .number_field_ideal import NumberFieldIdeal, NumberFieldFractionalIdeal
|
139
|
+
|
140
|
+
try:
|
141
|
+
from sage.libs.pari import pari
|
142
|
+
from cypari2.gen import Gen as pari_gen
|
143
|
+
except ImportError:
|
144
|
+
pari_gen = ()
|
145
|
+
|
146
|
+
from sage.rings.rational_field import QQ
|
147
|
+
from sage.rings.integer_ring import ZZ
|
148
|
+
from sage.rings.cif import CIF
|
149
|
+
from sage.rings.real_double import RDF
|
150
|
+
from sage.rings.real_lazy import RLF, CLF
|
151
|
+
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
|
152
|
+
|
128
153
|
lazy_import('sage.libs.gap.element', 'GapElement', as_='LibGapElement')
|
154
|
+
lazy_import('sage.misc.sage_eval', 'sage_eval')
|
129
155
|
lazy_import('sage.rings.number_field.unit_group', 'UnitGroup')
|
130
156
|
lazy_import('sage.rings.number_field.class_group', ['ClassGroup', 'SClassGroup'])
|
131
157
|
lazy_import('sage.rings.universal_cyclotomic_field', 'UniversalCyclotomicFieldElement')
|
@@ -134,18 +160,14 @@ lazy_import('sage.rings.universal_cyclotomic_field', 'UniversalCyclotomicFieldEl
|
|
134
160
|
_NumberFields = NumberFields()
|
135
161
|
|
136
162
|
|
137
|
-
def is_NumberFieldHomsetCodomain(codomain):
|
163
|
+
def is_NumberFieldHomsetCodomain(codomain, category=None):
|
138
164
|
"""
|
139
|
-
Return whether ``codomain`` is a valid codomain for a
|
140
|
-
|
141
|
-
|
142
|
-
This is used by NumberField._Hom_ to determine
|
143
|
-
whether the created homsets should be a
|
144
|
-
:class:`sage.rings.number_field.homset.NumberFieldHomset`.
|
165
|
+
Return whether ``codomain`` is a valid codomain for a
|
166
|
+
:class:`NumberFieldHomset` in ``category``.
|
145
167
|
|
146
168
|
EXAMPLES:
|
147
169
|
|
148
|
-
This currently accepts any
|
170
|
+
This currently accepts any ring (CC, RR, ...)::
|
149
171
|
|
150
172
|
sage: from sage.rings.number_field.number_field import is_NumberFieldHomsetCodomain
|
151
173
|
sage: is_NumberFieldHomsetCodomain(QQ)
|
@@ -154,24 +176,31 @@ def is_NumberFieldHomsetCodomain(codomain):
|
|
154
176
|
sage: is_NumberFieldHomsetCodomain(NumberField(x^2 + 1, 'x'))
|
155
177
|
True
|
156
178
|
sage: is_NumberFieldHomsetCodomain(ZZ)
|
157
|
-
|
179
|
+
True
|
158
180
|
sage: is_NumberFieldHomsetCodomain(3)
|
159
181
|
False
|
160
182
|
sage: is_NumberFieldHomsetCodomain(MatrixSpace(QQ, 2))
|
161
|
-
|
183
|
+
True
|
162
184
|
sage: is_NumberFieldHomsetCodomain(InfinityRing)
|
163
|
-
|
164
|
-
|
165
|
-
Question: should, for example, QQ-algebras be accepted as well?
|
185
|
+
True
|
166
186
|
|
167
|
-
|
168
|
-
|
187
|
+
Gap objects are not (yet) in :class:`Fields`, and therefore not accepted as
|
188
|
+
number field homset codomains::
|
169
189
|
|
170
190
|
sage: is_NumberFieldHomsetCodomain(gap.Rationals) # needs sage.libs.gap
|
171
191
|
False
|
172
192
|
"""
|
173
|
-
from sage.categories.
|
174
|
-
|
193
|
+
from sage.categories.rings import Rings
|
194
|
+
|
195
|
+
if category is None:
|
196
|
+
category = codomain.category()
|
197
|
+
|
198
|
+
if not category.is_subcategory(Rings()):
|
199
|
+
return False
|
200
|
+
|
201
|
+
assert codomain in category
|
202
|
+
|
203
|
+
return True
|
175
204
|
|
176
205
|
|
177
206
|
def proof_flag(t):
|
@@ -196,36 +225,6 @@ def proof_flag(t):
|
|
196
225
|
return get_flag(t, "number_field")
|
197
226
|
|
198
227
|
|
199
|
-
from sage.misc.latex import latex
|
200
|
-
|
201
|
-
import sage.rings.infinity as infinity
|
202
|
-
from sage.rings.rational import Rational
|
203
|
-
from sage.rings.integer import Integer
|
204
|
-
import sage.rings.polynomial.polynomial_element as polynomial_element
|
205
|
-
import sage.groups.abelian_gps.abelian_group
|
206
|
-
import sage.rings.complex_interval_field
|
207
|
-
|
208
|
-
from sage.structure.factory import UniqueFactory
|
209
|
-
from . import number_field_element
|
210
|
-
from . import number_field_element_quadratic
|
211
|
-
from .number_field_ideal import NumberFieldIdeal, NumberFieldFractionalIdeal
|
212
|
-
|
213
|
-
from sage.rings.rational_field import QQ
|
214
|
-
from sage.rings.integer_ring import ZZ
|
215
|
-
from sage.rings.real_mpfi import RIF
|
216
|
-
from sage.rings.cif import CIF
|
217
|
-
from sage.rings.real_double import RDF
|
218
|
-
from sage.rings.complex_double import CDF
|
219
|
-
from sage.rings.real_lazy import RLF, CLF
|
220
|
-
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
|
221
|
-
|
222
|
-
try:
|
223
|
-
from sage.libs.pari import pari
|
224
|
-
from cypari2.gen import Gen as pari_gen
|
225
|
-
except ImportError:
|
226
|
-
pari_gen = ()
|
227
|
-
|
228
|
-
|
229
228
|
def NumberField(polynomial, name=None, check=True, names=None, embedding=None,
|
230
229
|
latex_name=None, assume_disc_small=False, maximize_at_primes=None, structure=None,
|
231
230
|
*, latex_names=None, **kwds):
|
@@ -1200,9 +1199,6 @@ class CyclotomicFieldFactory(UniqueFactory):
|
|
1200
1199
|
CyclotomicField = CyclotomicFieldFactory("sage.rings.number_field.number_field.CyclotomicField")
|
1201
1200
|
|
1202
1201
|
|
1203
|
-
from . import number_field_base
|
1204
|
-
|
1205
|
-
|
1206
1202
|
is_NumberField = number_field_base.is_NumberField
|
1207
1203
|
|
1208
1204
|
|
@@ -1990,10 +1986,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
1990
1986
|
sage: loads(dumps(H)) is H
|
1991
1987
|
True
|
1992
1988
|
"""
|
1993
|
-
if not is_NumberFieldHomsetCodomain(codomain):
|
1994
|
-
|
1995
|
-
|
1996
|
-
raise TypeError(LazyFormat("%s is not suitable as codomain for homomorphisms from %s") % (codomain, self))
|
1989
|
+
if not is_NumberFieldHomsetCodomain(codomain, category):
|
1990
|
+
raise TypeError
|
1991
|
+
|
1997
1992
|
from sage.rings.number_field.homset import NumberFieldHomset
|
1998
1993
|
return NumberFieldHomset(self, codomain, category)
|
1999
1994
|
|
@@ -2053,6 +2048,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
2053
2048
|
if p == infinity.infinity:
|
2054
2049
|
gen_image = self.gen_embedding()
|
2055
2050
|
if gen_image is not None:
|
2051
|
+
from sage.rings.complex_double import CDF
|
2052
|
+
|
2056
2053
|
if gen_image in RDF:
|
2057
2054
|
return QQ.completion(p, prec, extras)
|
2058
2055
|
elif gen_image in CDF:
|
@@ -2609,11 +2606,11 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
2609
2606
|
f = x**2 + x
|
2610
2607
|
while w < u and not w % 2:
|
2611
2608
|
s = F.lift(q((a - 1) / pi**w).sqrt())
|
2612
|
-
a = a / (1 + s*(pi**(w/2)))**2
|
2609
|
+
a = a / (1 + s * (pi**(w / 2)))**2
|
2613
2610
|
w = (a - 1).valuation(p)
|
2614
2611
|
if w < u and w % 2:
|
2615
2612
|
return v + w
|
2616
|
-
if w == u and (f + F((a-1) / 4)).is_irreducible():
|
2613
|
+
if w == u and (f + F((a - 1) / 4)).is_irreducible():
|
2617
2614
|
return v + w
|
2618
2615
|
return Infinity
|
2619
2616
|
|
@@ -3424,7 +3421,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
3424
3421
|
H.append(chi)
|
3425
3422
|
return H
|
3426
3423
|
|
3427
|
-
def _repr_(self):
|
3424
|
+
def _repr_(self) -> str:
|
3428
3425
|
"""
|
3429
3426
|
Return string representation of this number field.
|
3430
3427
|
|
@@ -3444,7 +3441,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
3444
3441
|
result += " with {} = {}".format(self.variable_name(), gen)
|
3445
3442
|
return result
|
3446
3443
|
|
3447
|
-
def _latex_(self):
|
3444
|
+
def _latex_(self) -> str:
|
3448
3445
|
r"""
|
3449
3446
|
Return latex representation of this number field. This is viewed as
|
3450
3447
|
a polynomial quotient ring over a field.
|
@@ -3934,6 +3931,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
3934
3931
|
Fractional ideal (3)]
|
3935
3932
|
sage: K.primes_of_bounded_norm(1)
|
3936
3933
|
[]
|
3934
|
+
sage: K.primes_of_bounded_norm(1.1)
|
3935
|
+
[]
|
3937
3936
|
sage: x = polygen(QQ, 'x')
|
3938
3937
|
sage: K.<a> = NumberField(x^3 - 2)
|
3939
3938
|
sage: P = K.primes_of_bounded_norm(30)
|
@@ -3953,7 +3952,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
3953
3952
|
B = ZZ(B)
|
3954
3953
|
except (TypeError, AttributeError):
|
3955
3954
|
try:
|
3956
|
-
B = ZZ(B.
|
3955
|
+
B = ZZ(B.floor())
|
3957
3956
|
except (TypeError, AttributeError):
|
3958
3957
|
raise TypeError("%s is not valid bound on prime ideals" % B)
|
3959
3958
|
if B < 2:
|
@@ -4616,6 +4615,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
4616
4615
|
``proof.number_field(False)``. It can easily take 1000s of times
|
4617
4616
|
longer to do computations with ``proof=True`` (the default).
|
4618
4617
|
"""
|
4618
|
+
from .class_group import ClassGroup
|
4619
|
+
|
4619
4620
|
proof = proof_flag(proof)
|
4620
4621
|
try:
|
4621
4622
|
return self.__class_group[proof, names]
|
@@ -4703,6 +4704,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
4703
4704
|
Class group of order 4 with structure C4 of Number Field in a
|
4704
4705
|
with defining polynomial x^2 + 14 with a = 3.741657386773942?*I
|
4705
4706
|
"""
|
4707
|
+
from .class_group import SClassGroup
|
4708
|
+
|
4706
4709
|
proof = proof_flag(proof)
|
4707
4710
|
if all(P.is_principal() for P in S):
|
4708
4711
|
C = self.class_group(proof=proof)
|
@@ -6531,10 +6534,10 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
6531
6534
|
# faster than computing all the conjugates, etc ...
|
6532
6535
|
|
6533
6536
|
# flag to disable FLATTER, which is much more unstable than fplll
|
6534
|
-
flag = 1 if pari.version() >= (2,17) else 0
|
6537
|
+
flag = 1 if pari.version() >= (2, 17) else 0
|
6535
6538
|
if self.is_totally_real():
|
6536
6539
|
from sage.matrix.constructor import matrix
|
6537
|
-
M = matrix(ZZ, d, d, [[(x*y).trace() for x in ZK] for y in ZK])
|
6540
|
+
M = matrix(ZZ, d, d, [[(x * y).trace() for x in ZK] for y in ZK])
|
6538
6541
|
T = pari(M).qflllgram(flag=flag)
|
6539
6542
|
else:
|
6540
6543
|
M = self.minkowski_embedding(ZK, prec=prec)
|
@@ -6709,10 +6712,12 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
6709
6712
|
sage: QuadraticField(3, 'a').narrow_class_group()
|
6710
6713
|
Multiplicative Abelian group isomorphic to C2
|
6711
6714
|
"""
|
6715
|
+
from sage.groups.abelian_gps.abelian_group import AbelianGroup
|
6716
|
+
|
6712
6717
|
proof = proof_flag(proof)
|
6713
6718
|
k = self.pari_bnf(proof)
|
6714
6719
|
s = k.bnfnarrow().sage()
|
6715
|
-
return
|
6720
|
+
return AbelianGroup(s[1])
|
6716
6721
|
|
6717
6722
|
def ngens(self):
|
6718
6723
|
"""
|
@@ -6778,6 +6783,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
6778
6783
|
return (self.__polynomial_ntl, self.__denominator_ntl)
|
6779
6784
|
except AttributeError:
|
6780
6785
|
import sage.libs.ntl.all as ntl
|
6786
|
+
|
6781
6787
|
self.__denominator_ntl = ntl.ZZ()
|
6782
6788
|
den = self.polynomial().denominator()
|
6783
6789
|
self.__denominator_ntl.set_from_sage_int(ZZ(den))
|
@@ -7223,6 +7229,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
7223
7229
|
-a^15 - a^14 - 2*a^11 - a^10 + a^9 - a^8 - 2*a^7 + a^5 - 2*a^3 + a^2 + 3*a - 1,
|
7224
7230
|
-3*a^16 - 3*a^15 - 3*a^14 - 3*a^13 - 3*a^12 - 2*a^11 - 2*a^10 - 2*a^9 - a^8 + a^7 + 2*a^6 + 3*a^5 + 3*a^4 + 4*a^3 + 6*a^2 + 8*a + 8]
|
7225
7231
|
"""
|
7232
|
+
from sage.rings.number_field.unit_group import UnitGroup
|
7233
|
+
|
7226
7234
|
proof = proof_flag(proof)
|
7227
7235
|
|
7228
7236
|
try:
|
@@ -7339,6 +7347,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
|
|
7339
7347
|
sage: U.log(u)
|
7340
7348
|
(1, 1, 4, 1, 5)
|
7341
7349
|
"""
|
7350
|
+
from sage.rings.number_field.unit_group import UnitGroup
|
7351
|
+
|
7342
7352
|
proof = proof_flag(proof)
|
7343
7353
|
|
7344
7354
|
# process the parameter S:
|
@@ -9651,6 +9661,8 @@ class NumberField_absolute(NumberField_generic):
|
|
9651
9661
|
Defn: alpha |--> 0.96 + 1.7*I]
|
9652
9662
|
"""
|
9653
9663
|
if prec is None:
|
9664
|
+
from sage.rings.real_mpfi import RIF
|
9665
|
+
|
9654
9666
|
R = RIF
|
9655
9667
|
C = CIF
|
9656
9668
|
|
@@ -10476,7 +10488,7 @@ class NumberField_absolute(NumberField_generic):
|
|
10476
10488
|
# symbol is negative for all primes in S and positive
|
10477
10489
|
# at all primes in S'
|
10478
10490
|
# For technical reasons, a Hilbert symbol of -1 is
|
10479
|
-
#
|
10491
|
+
# represented as 1 and a Hilbert symbol of 1
|
10480
10492
|
# is represented as 0
|
10481
10493
|
V = VectorSpace(GF(2), len(SL))
|
10482
10494
|
v = V([1]*len(S) + [0]*len(L))
|
@@ -10871,8 +10883,9 @@ class NumberField_cyclotomic(NumberField_absolute, sage.rings.abc.NumberField_cy
|
|
10871
10883
|
# As a consequence, a result of _an_element_() with the wrong class
|
10872
10884
|
# is cached during the call to has_coerce_map_from. We reset the
|
10873
10885
|
# cache afterwards.
|
10886
|
+
from sage.rings.complex_double import CDF
|
10887
|
+
|
10874
10888
|
self._standard_embedding = not CDF.has_coerce_map_from(self) or CDF(self.gen()).imag() > 0
|
10875
|
-
self._cache_an_element = None
|
10876
10889
|
|
10877
10890
|
if n == 4:
|
10878
10891
|
self._element_class = number_field_element_quadratic.NumberFieldElement_gaussian
|
@@ -11028,7 +11041,7 @@ class NumberField_cyclotomic(NumberField_absolute, sage.rings.abc.NumberField_cy
|
|
11028
11041
|
from sage.libs.gap.libgap import libgap
|
11029
11042
|
return libgap.CyclotomicField(self.__n)
|
11030
11043
|
|
11031
|
-
def _repr_(self):
|
11044
|
+
def _repr_(self) -> str:
|
11032
11045
|
r"""
|
11033
11046
|
Return string representation of this cyclotomic field.
|
11034
11047
|
|
@@ -11060,7 +11073,7 @@ class NumberField_cyclotomic(NumberField_absolute, sage.rings.abc.NumberField_cy
|
|
11060
11073
|
"""
|
11061
11074
|
return self.__n
|
11062
11075
|
|
11063
|
-
def _latex_(self):
|
11076
|
+
def _latex_(self) -> str:
|
11064
11077
|
r"""
|
11065
11078
|
Return the latex representation of this cyclotomic field.
|
11066
11079
|
|
@@ -11301,6 +11314,8 @@ class NumberField_cyclotomic(NumberField_absolute, sage.rings.abc.NumberField_cy
|
|
11301
11314
|
sage: K5._log_gen(zeta15**3)
|
11302
11315
|
4
|
11303
11316
|
"""
|
11317
|
+
from sage.rings.complex_double import CDF
|
11318
|
+
|
11304
11319
|
X = x.parent()
|
11305
11320
|
gen = self.gen()
|
11306
11321
|
|
@@ -11502,13 +11517,11 @@ class NumberField_cyclotomic(NumberField_absolute, sage.rings.abc.NumberField_cy
|
|
11502
11517
|
zeta = self.gen()
|
11503
11518
|
return sum(QQ(c) * zeta**i for i, c in enumerate(coeffs))
|
11504
11519
|
|
11505
|
-
def _Hom_(self, codomain,
|
11520
|
+
def _Hom_(self, codomain, category=None):
|
11506
11521
|
"""
|
11507
11522
|
Return homset of homomorphisms from the cyclotomic field ``self`` to
|
11508
11523
|
the number field codomain.
|
11509
11524
|
|
11510
|
-
The ``cat`` option is currently ignored.
|
11511
|
-
|
11512
11525
|
EXAMPLES:
|
11513
11526
|
|
11514
11527
|
This function is implicitly called by the Hom method or
|
@@ -11525,13 +11538,20 @@ class NumberField_cyclotomic(NumberField_absolute, sage.rings.abc.NumberField_cy
|
|
11525
11538
|
to Number Field in a with defining polynomial x^2 + 3
|
11526
11539
|
sage: End(CyclotomicField(21))
|
11527
11540
|
Automorphism group of Cyclotomic Field of order 21 and degree 12
|
11541
|
+
|
11542
|
+
::
|
11543
|
+
|
11544
|
+
sage: K = CyclotomicField(3)
|
11545
|
+
sage: Hom(K, ZZ).category()
|
11546
|
+
Category of homsets of euclidean domains and noetherian rings
|
11547
|
+
|
11528
11548
|
"""
|
11529
|
-
if is_NumberFieldHomsetCodomain(codomain):
|
11530
|
-
from sage.rings.number_field.homset import CyclotomicFieldHomset
|
11531
|
-
return CyclotomicFieldHomset(self, codomain)
|
11532
|
-
else:
|
11549
|
+
if not is_NumberFieldHomsetCodomain(codomain, category):
|
11533
11550
|
raise TypeError
|
11534
11551
|
|
11552
|
+
from sage.rings.number_field.homset import CyclotomicFieldHomset
|
11553
|
+
return CyclotomicFieldHomset(self, codomain, category)
|
11554
|
+
|
11535
11555
|
def is_galois(self):
|
11536
11556
|
"""
|
11537
11557
|
Return ``True`` since all cyclotomic fields are automatically Galois.
|
@@ -12101,6 +12121,8 @@ class NumberField_quadratic(NumberField_absolute, sage.rings.abc.NumberField_qua
|
|
12101
12121
|
|
12102
12122
|
self._NumberField_generic__gen = self._element_class(self, parts)
|
12103
12123
|
|
12124
|
+
from sage.rings.complex_double import CDF
|
12125
|
+
|
12104
12126
|
# we must set the flag _standard_embedding *before* any element creation
|
12105
12127
|
# Note that in the following code, no element is built.
|
12106
12128
|
if self.coerce_embedding() is not None and CDF.has_coerce_map_from(self):
|
Binary file
|