passagemath-flint 10.5.40__cp310-cp310-macosx_14_0_arm64.whl → 10.5.42__cp310-cp310-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.
Files changed (73) hide show
  1. {passagemath_flint-10.5.40.dist-info → passagemath_flint-10.5.42.dist-info}/METADATA +3 -3
  2. {passagemath_flint-10.5.40.dist-info → passagemath_flint-10.5.42.dist-info}/RECORD +73 -73
  3. passagemath_flint.dylibs/libgcc_s.1.1.dylib +0 -0
  4. passagemath_flint.dylibs/libgfortran.5.dylib +0 -0
  5. passagemath_flint.dylibs/libgsl.28.dylib +0 -0
  6. passagemath_flint.dylibs/libmpfi.0.dylib +0 -0
  7. passagemath_flint.dylibs/{libopenblas_armv8p-r0.3.28.dylib → libopenblas_armv8p-r0.3.29.dylib} +0 -0
  8. passagemath_flint.dylibs/libquadmath.0.dylib +0 -0
  9. sage/combinat/posets/hasse_cython_flint.cpython-310-darwin.so +0 -0
  10. sage/data_structures/bounded_integer_sequences.cpython-310-darwin.so +0 -0
  11. sage/graphs/chrompoly.cpython-310-darwin.so +0 -0
  12. sage/graphs/matchpoly.cpython-310-darwin.so +0 -0
  13. sage/libs/arb/arith.cpython-310-darwin.so +0 -0
  14. sage/libs/flint/arith.cpython-310-darwin.so +0 -0
  15. sage/libs/flint/arith_sage.cpython-310-darwin.so +0 -0
  16. sage/libs/flint/flint_sage.cpython-310-darwin.so +0 -0
  17. sage/libs/flint/fmpq_poly_sage.cpython-310-darwin.so +0 -0
  18. sage/libs/flint/fmpz_factor_sage.cpython-310-darwin.so +0 -0
  19. sage/libs/flint/fmpz_poly.cpython-310-darwin.so +0 -0
  20. sage/libs/flint/fmpz_poly_sage.cpython-310-darwin.so +0 -0
  21. sage/libs/flint/qsieve.cpython-310-darwin.so +0 -0
  22. sage/libs/flint/qsieve_sage.cpython-310-darwin.so +0 -0
  23. sage/libs/flint/ulong_extras.cpython-310-darwin.so +0 -0
  24. sage/libs/flint/ulong_extras_sage.cpython-310-darwin.so +0 -0
  25. sage/matrix/change_ring.cpython-310-darwin.so +0 -0
  26. sage/matrix/matrix_complex_ball_dense.cpython-310-darwin.so +0 -0
  27. sage/matrix/matrix_cyclo_dense.cpython-310-darwin.so +0 -0
  28. sage/matrix/matrix_integer_dense.cpython-310-darwin.so +0 -0
  29. sage/matrix/matrix_integer_sparse.cpython-310-darwin.so +0 -0
  30. sage/matrix/matrix_rational_dense.cpython-310-darwin.so +0 -0
  31. sage/matrix/matrix_rational_sparse.cpython-310-darwin.so +0 -0
  32. sage/matrix/misc_flint.cpython-310-darwin.so +0 -0
  33. sage/modular/modform/eis_series_cython.cpython-310-darwin.so +0 -0
  34. sage/modular/modsym/apply.cpython-310-darwin.so +0 -0
  35. sage/modular/modsym/heilbronn.cpython-310-darwin.so +0 -0
  36. sage/modular/pollack_stevens/dist.cpython-310-darwin.so +0 -0
  37. sage/quivers/algebra_elements.cpython-310-darwin.so +0 -0
  38. sage/quivers/paths.cpython-310-darwin.so +0 -0
  39. sage/rings/complex_arb.cpython-310-darwin.so +0 -0
  40. sage/rings/complex_interval.cpython-310-darwin.so +0 -0
  41. sage/rings/convert/mpfi.cpython-310-darwin.so +0 -0
  42. sage/rings/factorint_flint.cpython-310-darwin.so +0 -0
  43. sage/rings/fraction_field_FpT.cpython-310-darwin.so +0 -0
  44. sage/rings/number_field/S_unit_solver.py +28 -28
  45. sage/rings/number_field/bdd_height.py +2 -1
  46. sage/rings/number_field/class_group.py +2 -2
  47. sage/rings/number_field/galois_group.py +5 -3
  48. sage/rings/number_field/number_field.py +115 -77
  49. sage/rings/number_field/number_field_element.cpython-310-darwin.so +0 -0
  50. sage/rings/number_field/number_field_element.pyx +5 -5
  51. sage/rings/number_field/number_field_element_quadratic.cpython-310-darwin.so +0 -0
  52. sage/rings/number_field/number_field_ideal_rel.py +7 -9
  53. sage/rings/number_field/number_field_morphisms.cpython-310-darwin.so +0 -0
  54. sage/rings/number_field/number_field_rel.py +8 -8
  55. sage/rings/number_field/order.py +2 -2
  56. sage/rings/number_field/selmer_group.py +4 -4
  57. sage/rings/polynomial/evaluation_flint.cpython-310-darwin.so +0 -0
  58. sage/rings/polynomial/hilbert.cpython-310-darwin.so +0 -0
  59. sage/rings/polynomial/polynomial_complex_arb.cpython-310-darwin.so +0 -0
  60. sage/rings/polynomial/polynomial_integer_dense_flint.cpython-310-darwin.so +0 -0
  61. sage/rings/polynomial/polynomial_number_field.cpython-310-darwin.so +0 -0
  62. sage/rings/polynomial/polynomial_rational_flint.cpython-310-darwin.so +0 -0
  63. sage/rings/polynomial/polynomial_zmod_flint.cpython-310-darwin.so +0 -0
  64. sage/rings/polynomial/real_roots.cpython-310-darwin.so +0 -0
  65. sage/rings/polynomial/refine_root.cpython-310-darwin.so +0 -0
  66. sage/rings/polynomial/weil/weil_polynomials.cpython-310-darwin.so +0 -0
  67. sage/rings/qqbar.py +11 -10
  68. sage/rings/real_arb.cpython-310-darwin.so +0 -0
  69. sage/rings/real_interval_absolute.cpython-310-darwin.so +0 -0
  70. sage/rings/real_mpfi.cpython-310-darwin.so +0 -0
  71. sage/schemes/elliptic_curves/descent_two_isogeny.cpython-310-darwin.so +0 -0
  72. {passagemath_flint-10.5.40.dist-info → passagemath_flint-10.5.42.dist-info}/WHEEL +0 -0
  73. {passagemath_flint-10.5.40.dist-info → passagemath_flint-10.5.42.dist-info}/top_level.txt +0 -0
@@ -526,9 +526,9 @@ class ClassGroup(AbelianGroupWithValues_class):
526
526
  Class group of order 68 with structure C34 x C2 of Number Field
527
527
  in a with defining polynomial x^2 + x + 23899
528
528
  sage: C.gens()
529
- (Fractional ideal class (7, a + 5), Fractional ideal class (5, a + 3))
529
+ (Fractional ideal class (83, a + 21), Fractional ideal class (15, a + 8))
530
530
  sage: C.gens_ideals()
531
- (Fractional ideal (7, a + 5), Fractional ideal (5, a + 3))
531
+ (Fractional ideal (83, a + 21), Fractional ideal (15, a + 8))
532
532
  """
533
533
  return self.gens_values()
534
534
 
@@ -995,9 +995,11 @@ 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: [G.artin_symbol(P) for P in K.primes_above(7)] # random (see remark in primes_above)
999
- [(1,4)(2,3)(5,8)(6,7), (1,4)(2,3)(5,8)(6,7),
1000
- (1,5)(2,6)(3,7)(4,8), (1,5)(2,6)(3,7)(4,8)]
998
+ sage: sorted([G.artin_symbol(P) for P in K.primes_above(7)])
999
+ [(1,4)(2,3)(5,8)(6,7),
1000
+ (1,4)(2,3)(5,8)(6,7),
1001
+ (1,5)(2,6)(3,7)(4,8),
1002
+ (1,5)(2,6)(3,7)(4,8)]
1001
1003
  sage: G.artin_symbol(17)
1002
1004
  Traceback (most recent call last):
1003
1005
  ...
@@ -3624,7 +3624,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
3624
3624
  sage: L.<b> = K.extension(x^2 - 3, x^2 + 1)
3625
3625
  sage: M.<c> = L.extension(x^2 + 1)
3626
3626
  sage: L.ideal(K.ideal(2, a))
3627
- Fractional ideal (a)
3627
+ Fractional ideal (-a)
3628
3628
  sage: M.ideal(K.ideal(2, a)) == M.ideal(a*(b - c)/2)
3629
3629
  True
3630
3630
 
@@ -3667,35 +3667,37 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
3667
3667
  ....: print(n)
3668
3668
  ....: for I in sorted(d[n]):
3669
3669
  ....: print(I)
3670
- 1
3671
- Fractional ideal (1)
3672
- 2
3673
- Fractional ideal (2, 1/2*a - 1/2)
3674
- Fractional ideal (2, 1/2*a + 1/2)
3675
- 3
3676
- Fractional ideal (3, 1/2*a - 1/2)
3677
- Fractional ideal (3, 1/2*a + 1/2)
3678
- 4
3679
- Fractional ideal (2)
3680
- Fractional ideal (4, 1/2*a + 3/2)
3681
- Fractional ideal (4, 1/2*a + 5/2)
3682
- 5
3683
- 6
3684
- Fractional ideal (1/2*a - 1/2)
3685
- Fractional ideal (1/2*a + 1/2)
3686
- Fractional ideal (6, 1/2*a + 5/2)
3687
- Fractional ideal (6, 1/2*a + 7/2)
3688
- 7
3689
- 8
3690
- Fractional ideal (4, a - 1)
3691
- Fractional ideal (4, a + 1)
3692
- Fractional ideal (1/2*a + 3/2)
3693
- Fractional ideal (1/2*a - 3/2)
3694
- 9
3695
- Fractional ideal (3)
3696
- Fractional ideal (9, 1/2*a + 7/2)
3697
- Fractional ideal (9, 1/2*a + 11/2)
3698
- 10
3670
+ 1
3671
+ Fractional ideal (1)
3672
+ 2
3673
+ Fractional ideal (2, 1/2*a - 1/2)
3674
+ Fractional ideal (2, 1/2*a + 1/2)
3675
+ 3
3676
+ Fractional ideal (3, 1/2*a - 1/2)
3677
+ Fractional ideal (3, 1/2*a + 1/2)
3678
+ 4
3679
+ Fractional ideal (2)
3680
+ Fractional ideal (4, 1/2*a + 3/2)
3681
+ Fractional ideal (4, 1/2*a + 5/2)
3682
+ 5
3683
+ 6
3684
+ Fractional ideal (-1/2*a + 1/2)
3685
+ Fractional ideal (1/2*a + 1/2)
3686
+ Fractional ideal (6, 1/2*a + 5/2)
3687
+ Fractional ideal (6, 1/2*a + 7/2)
3688
+ 7
3689
+ 8
3690
+ Fractional ideal (4, a - 1)
3691
+ Fractional ideal (4, a + 1)
3692
+ Fractional ideal (-1/2*a - 3/2)
3693
+ Fractional ideal (1/2*a - 3/2)
3694
+ 9
3695
+ Fractional ideal (3)
3696
+ Fractional ideal (9, 1/2*a + 7/2)
3697
+ Fractional ideal (9, 1/2*a + 11/2)
3698
+ 10
3699
+ sage: [[I.norm() for I in sorted(d[n])] for n in d]
3700
+ [[1], [2, 2], [3, 3], [4, 4, 4], [], [6, 6, 6, 6], [], [8, 8, 8, 8], [9, 9, 9], []]
3699
3701
  """
3700
3702
  hnf_ideals = self.pari_nf().ideallist(bound)
3701
3703
  d = {}
@@ -3926,8 +3928,10 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
3926
3928
 
3927
3929
  sage: K.<i> = QuadraticField(-1)
3928
3930
  sage: K.primes_of_bounded_norm(10)
3929
- [Fractional ideal (i + 1), Fractional ideal (-i - 2),
3930
- Fractional ideal (2*i + 1), Fractional ideal (3)]
3931
+ [Fractional ideal (i - 1),
3932
+ Fractional ideal (2*i - 1),
3933
+ Fractional ideal (-2*i - 1),
3934
+ Fractional ideal (3)]
3931
3935
  sage: K.primes_of_bounded_norm(1)
3932
3936
  []
3933
3937
  sage: x = polygen(QQ, 'x')
@@ -3936,10 +3940,10 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
3936
3940
  sage: P
3937
3941
  [Fractional ideal (a),
3938
3942
  Fractional ideal (a + 1),
3939
- Fractional ideal (-a^2 - 1),
3943
+ Fractional ideal (a^2 + 1),
3940
3944
  Fractional ideal (a^2 + a - 1),
3941
3945
  Fractional ideal (2*a + 1),
3942
- Fractional ideal (-2*a^2 - a - 1),
3946
+ Fractional ideal (2*a^2 + a + 1),
3943
3947
  Fractional ideal (a^2 - 2*a - 1),
3944
3948
  Fractional ideal (a + 3)]
3945
3949
  sage: [p.norm() for p in P]
@@ -3989,10 +3993,10 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
3989
3993
  sage: K.<i> = QuadraticField(-1)
3990
3994
  sage: it = K.primes_of_bounded_norm_iter(10)
3991
3995
  sage: list(it)
3992
- [Fractional ideal (i + 1),
3996
+ [Fractional ideal (i - 1),
3993
3997
  Fractional ideal (3),
3994
- Fractional ideal (-i - 2),
3995
- Fractional ideal (2*i + 1)]
3998
+ Fractional ideal (2*i - 1),
3999
+ Fractional ideal (-2*i - 1)]
3996
4000
  sage: list(K.primes_of_bounded_norm_iter(1))
3997
4001
  []
3998
4002
  """
@@ -4317,7 +4321,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
4317
4321
  sage: k.<a> = NumberField(x^4 - 3/2*x + 5/3); k
4318
4322
  Number Field in a with defining polynomial x^4 - 3/2*x + 5/3
4319
4323
  sage: k.pari_nf()
4320
- [y^4 - 324*y + 2160, [0, 2], 48918708, 216, ..., [36, 36*y, y^3 + 6*y^2 - 252, 6*y^2], [1, 0, 0, 252; 0, 1, 0, 0; 0, 0, 0, 36; 0, 0, 6, -36], [1, 0, 0, 0, 0, 0, -18, 42, 0, -18, -46, -60, 0, 42, -60, -60; 0, 1, 0, 0, 1, 0, 2, 0, 0, 2, -11, -1, 0, 0, -1, 9; 0, 0, 1, 0, 0, 0, 6, 6, 1, 6, -5, 0, 0, 6, 0, 0; 0, 0, 0, 1, 0, 6, -6, -6, 0, -6, -1, 2, 1, -6, 2, 0]]
4324
+ [y^4 - 324*y + 2160, [0, 2], 48918708, 216, ..., [36, 36*y, y^3 + 6*y^2 - 252, -6*y^2], [1, 0, 0, 252; 0, 1, 0, 0; 0, 0, 0, 36; 0, 0, -6, 36], [1, 0, 0, 0, 0, 0, -18, -42, 0, -18, -46, 60, 0, -42, 60, -60; 0, 1, 0, 0, 1, 0, 2, 0, 0, 2, -11, 1, 0, 0, 1, 9; 0, 0, 1, 0, 0, 0, 6, -6, 1, 6, -5, 0, 0, -6, 0, 0; 0, 0, 0, 1, 0, -6, 6, -6, 0, 6, 1, 2, 1, -6, 2, 0]]
4321
4325
  sage: pari(k)
4322
4326
  [y^4 - 324*y + 2160, [0, 2], 48918708, 216, ...]
4323
4327
  sage: gp(k)
@@ -4444,10 +4448,14 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
4444
4448
  bnf = self._pari_bnf
4445
4449
  except AttributeError:
4446
4450
  f = self.pari_polynomial("y")
4451
+ _saved_rand = pari.getrand()
4452
+ # make this deterministic, it affects printing of ideals
4453
+ pari.setrand(1)
4447
4454
  if units:
4448
4455
  self._pari_bnf = f.bnfinit(1)
4449
4456
  else:
4450
4457
  self._pari_bnf = f.bnfinit()
4458
+ pari.setrand(_saved_rand)
4451
4459
  bnf = self._pari_bnf
4452
4460
  # Certify if needed
4453
4461
  if proof and not getattr(self, "_pari_bnf_certified", False):
@@ -4807,7 +4815,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
4807
4815
  1/13*a^2 + 7/13*a - 332/13,
4808
4816
  -1/13*a^2 + 6/13*a + 345/13,
4809
4817
  -1,
4810
- -2/13*a^2 - 1/13*a + 755/13]
4818
+ 1/13*a^2 - 19/13*a - 7/13]
4811
4819
  sage: units[5] in (1/13*a^2 - 19/13*a - 7/13, 1/13*a^2 + 20/13*a - 7/13)
4812
4820
  True
4813
4821
  sage: len(units) == 6
@@ -4818,7 +4826,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
4818
4826
 
4819
4827
  sage: K.<a> = NumberField(2*x^2 - 1/3)
4820
4828
  sage: K._S_class_group_and_units(tuple(K.primes_above(2) + K.primes_above(3)))
4821
- ([6*a + 2, 6*a + 3, -1, -12*a + 5], [])
4829
+ ([6*a + 2, -6*a + 3, -1, -12*a - 5], []) # 64-bit
4830
+ ([6*a + 2, -6*a - 3, -1, -12*a - 5], []) # 32-bit
4822
4831
  """
4823
4832
  K_pari = self.pari_bnf(proof=proof)
4824
4833
  S_pari = [p.pari_prime() for p in sorted(set(S))]
@@ -4996,7 +5005,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
4996
5005
  1/13*a^2 + 7/13*a - 332/13,
4997
5006
  -1/13*a^2 + 6/13*a + 345/13,
4998
5007
  -1,
4999
- -2/13*a^2 - 1/13*a + 755/13]
5008
+ 1/13*a^2 - 19/13*a - 7/13]
5000
5009
  sage: gens[5] in (1/13*a^2 - 19/13*a - 7/13, 1/13*a^2 + 20/13*a - 7/13)
5001
5010
  True
5002
5011
  sage: gens[6] in (-1/13*a^2 + 45/13*a - 97/13, 1/13*a^2 - 45/13*a + 97/13)
@@ -5160,9 +5169,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
5160
5169
 
5161
5170
  sage: [K.ideal(g).factor() for g in gens]
5162
5171
  [(Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)),
5163
- Fractional ideal (a),
5164
- (Fractional ideal (2, a + 1))^2,
5165
- 1]
5172
+ Fractional ideal (-a), (Fractional ideal (2, a + 1))^2, 1]
5166
5173
 
5167
5174
  sage: toKS2(10)
5168
5175
  (0, 0, 1, 1)
@@ -5640,7 +5647,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
5640
5647
  sage: k.<a> = NumberField(x^2 + 23)
5641
5648
  sage: d = k.different()
5642
5649
  sage: d
5643
- Fractional ideal (-a)
5650
+ Fractional ideal (a)
5644
5651
  sage: d.norm()
5645
5652
  23
5646
5653
  sage: k.disc()
@@ -5760,7 +5767,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
5760
5767
  sage: K.elements_of_norm(3)
5761
5768
  []
5762
5769
  sage: K.elements_of_norm(50)
5763
- [-a - 7, 5*a - 5, 7*a + 1]
5770
+ [7*a - 1, 5*a - 5, -7*a - 1]
5764
5771
 
5765
5772
  TESTS:
5766
5773
 
@@ -5872,10 +5879,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
5872
5879
  sage: K.factor(1/3)
5873
5880
  (Fractional ideal (3))^-1
5874
5881
  sage: K.factor(1+a)
5875
- Fractional ideal (a + 1)
5882
+ Fractional ideal (a - 1)
5876
5883
  sage: K.factor(1+a/5)
5877
- (Fractional ideal (a + 1)) * (Fractional ideal (-a - 2))^-1
5878
- * (Fractional ideal (2*a + 1))^-1 * (Fractional ideal (-2*a + 3))
5884
+ (Fractional ideal (a - 1)) * (Fractional ideal (2*a - 1))^-1 * (Fractional ideal (-2*a - 1))^-1 * (Fractional ideal (3*a + 2))
5879
5885
 
5880
5886
  An example over a relative number field::
5881
5887
 
@@ -5908,9 +5914,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
5908
5914
  sage: (fi, fj) = f[::]
5909
5915
  sage: (fi[1], fj[1])
5910
5916
  (1, 1)
5911
- sage: fi[0] == L.fractional_ideal(1/2*a*b - a + 1/2)
5917
+ sage: fi[0] == L.fractional_ideal(-1/2*a*b - a + 1/2)
5912
5918
  True
5913
- sage: fj[0] == L.fractional_ideal(-1/2*a*b - a + 1/2)
5919
+ sage: fj[0] == L.fractional_ideal(1/2*a*b - a + 1/2)
5914
5920
  True
5915
5921
  """
5916
5922
  return self.ideal(n).factor()
@@ -6524,13 +6530,15 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
6524
6530
  # the inner product on the Minkowski embedding, which is
6525
6531
  # faster than computing all the conjugates, etc ...
6526
6532
 
6533
+ # flag to disable FLATTER, which is much more unstable than fplll
6534
+ flag = 1 if pari.version() >= (2,17) else 0
6527
6535
  if self.is_totally_real():
6528
6536
  from sage.matrix.constructor import matrix
6529
6537
  M = matrix(ZZ, d, d, [[(x*y).trace() for x in ZK] for y in ZK])
6530
- T = pari(M).qflllgram()
6538
+ T = pari(M).qflllgram(flag=flag)
6531
6539
  else:
6532
6540
  M = self.minkowski_embedding(ZK, prec=prec)
6533
- T = pari(M).qflll()
6541
+ T = pari(M).qflll(flag=flag)
6534
6542
 
6535
6543
  return [sum([ZZ(T[i][j]) * ZK[j] for j in range(d)]) for i in range(d)]
6536
6544
 
@@ -7108,14 +7116,14 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
7108
7116
  sage: K.units(proof=True) # takes forever, not tested
7109
7117
  ...
7110
7118
  sage: K.units(proof=False) # result not independently verified
7111
- (-a^9 - a + 1,
7119
+ (a^9 + a - 1,
7120
+ -a^15 + a^12 - a^10 + a^9 + 2*a^8 - 3*a^7 - a^6 + 3*a^5 - a^4 - 4*a^3 + 3*a^2 + 2*a - 2,
7121
+ a^15 + a^14 + a^13 + a^12 + a^10 - a^7 - a^6 - a^2 - 1,
7122
+ 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4,
7112
7123
  -a^16 + a^15 - a^14 + a^12 - a^11 + a^10 + a^8 - a^7 + 2*a^6 - a^4 + 3*a^3 - 2*a^2 + 2*a - 1,
7113
- 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4,
7114
- 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,
7115
- -a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 + 2,
7116
- -2*a^16 + 3*a^15 - 3*a^14 + 3*a^13 - 3*a^12 + a^11 - a^9 + 3*a^8 - 4*a^7 + 5*a^6 - 6*a^5 + 4*a^4 - 3*a^3 + 2*a^2 + 2*a - 4,
7117
- a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2,
7118
- 2*a^16 + a^15 - a^11 - 3*a^10 - 4*a^9 - 4*a^8 - 4*a^7 - 5*a^6 - 7*a^5 - 8*a^4 - 6*a^3 - 5*a^2 - 6*a - 7)
7124
+ a^16 - 2*a^15 - 2*a^13 - a^12 - a^11 - 2*a^10 + a^9 - 2*a^8 + 2*a^7 - 3*a^6 - 3*a^4 - 2*a^3 - a^2 - 4*a + 2,
7125
+ -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,
7126
+ -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)
7119
7127
 
7120
7128
  TESTS:
7121
7129
 
@@ -7124,7 +7132,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
7124
7132
 
7125
7133
  sage: K.<a> = NumberField(1/2*x^2 - 1/6)
7126
7134
  sage: K.units()
7127
- (3*a - 2,)
7135
+ (3*a + 2,)
7128
7136
  """
7129
7137
  proof = proof_flag(proof)
7130
7138
 
@@ -7206,14 +7214,14 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
7206
7214
  (u0, u1, u2, u3, u4, u5, u6, u7, u8)
7207
7215
  sage: U.gens_values() # result not independently verified
7208
7216
  [-1,
7209
- -a^9 - a + 1,
7217
+ a^9 + a - 1,
7218
+ -a^15 + a^12 - a^10 + a^9 + 2*a^8 - 3*a^7 - a^6 + 3*a^5 - a^4 - 4*a^3 + 3*a^2 + 2*a - 2,
7219
+ a^15 + a^14 + a^13 + a^12 + a^10 - a^7 - a^6 - a^2 - 1,
7220
+ 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4,
7210
7221
  -a^16 + a^15 - a^14 + a^12 - a^11 + a^10 + a^8 - a^7 + 2*a^6 - a^4 + 3*a^3 - 2*a^2 + 2*a - 1,
7211
- 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4,
7212
- 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,
7213
- -a^16 - a^15 - a^14 - a^13 - a^12 - a^11 - a^10 - a^9 - a^8 - a^7 - a^6 - a^5 - a^4 - a^3 - a^2 + 2,
7214
- -2*a^16 + 3*a^15 - 3*a^14 + 3*a^13 - 3*a^12 + a^11 - a^9 + 3*a^8 - 4*a^7 + 5*a^6 - 6*a^5 + 4*a^4 - 3*a^3 + 2*a^2 + 2*a - 4,
7215
- a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2,
7216
- 2*a^16 + a^15 - a^11 - 3*a^10 - 4*a^9 - 4*a^8 - 4*a^7 - 5*a^6 - 7*a^5 - 8*a^4 - 6*a^3 - 5*a^2 - 6*a - 7]
7222
+ a^16 - 2*a^15 - 2*a^13 - a^12 - a^11 - 2*a^10 + a^9 - 2*a^8 + 2*a^7 - 3*a^6 - 3*a^4 - 2*a^3 - a^2 - 4*a + 2,
7223
+ -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
+ -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]
7217
7225
  """
7218
7226
  proof = proof_flag(proof)
7219
7227
 
@@ -7262,8 +7270,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
7262
7270
  sage: U = K.S_unit_group(S=a); U
7263
7271
  S-unit group with structure C10 x Z x Z x Z of
7264
7272
  Number Field in a with defining polynomial x^4 - 10*x^3 + 100*x^2 - 375*x + 1375
7265
- with S = (Fractional ideal (5, 1/275*a^3 + 4/55*a^2 - 5/11*a + 5),
7266
- Fractional ideal (11, 1/275*a^3 + 4/55*a^2 - 5/11*a + 9))
7273
+ with S = (Fractional ideal (5, -7/275*a^3 + 1/11*a^2 - 9/11*a),
7274
+ Fractional ideal (11, -7/275*a^3 + 1/11*a^2 - 9/11*a + 3))
7267
7275
  sage: U.gens()
7268
7276
  (u0, u1, u2, u3)
7269
7277
  sage: U.gens_values() # random
@@ -7274,8 +7282,8 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
7274
7282
  sage: [u.multiplicative_order() for u in U.gens()]
7275
7283
  [10, +Infinity, +Infinity, +Infinity]
7276
7284
  sage: U.primes()
7277
- (Fractional ideal (5, 1/275*a^3 + 4/55*a^2 - 5/11*a + 5),
7278
- Fractional ideal (11, 1/275*a^3 + 4/55*a^2 - 5/11*a + 9))
7285
+ (Fractional ideal (5, -7/275*a^3 + 1/11*a^2 - 9/11*a),
7286
+ Fractional ideal (11, -7/275*a^3 + 1/11*a^2 - 9/11*a + 3))
7279
7287
 
7280
7288
  With the default value of `S`, the S-unit group is the same as
7281
7289
  the global unit group::
@@ -7428,7 +7436,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
7428
7436
  sage: # needs fpylll sage.rings.padics sage.symbolic
7429
7437
  sage: solutions, bound = K.S_unit_solutions(S, prec=100, include_bound=True)
7430
7438
  sage: bound
7431
- 7
7439
+ 6
7432
7440
  """
7433
7441
  from .S_unit_solver import solve_S_unit_equation
7434
7442
  return solve_S_unit_equation(self, S, prec, include_exponents, include_bound, proof)
@@ -8786,10 +8794,40 @@ class NumberField_absolute(NumberField_generic):
8786
8794
  polynomials are supported (:issue:`252`)::
8787
8795
 
8788
8796
  sage: K.<a> = NumberField(2*x^4 + 6*x^2 + 1/2)
8789
- sage: K
8790
- Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8791
- sage: sorted([F.discriminant() for F, _, _ in K.subfields()])
8792
- [-8, -4, 1, 8, 256]
8797
+ sage: K.subfields()
8798
+ [(Number Field in a0 with defining polynomial x,
8799
+ Ring morphism:
8800
+ From: Number Field in a0 with defining polynomial x
8801
+ To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8802
+ Defn: 0 |--> 0,
8803
+ None),
8804
+ (Number Field in a1 with defining polynomial x^2 - 2,
8805
+ Ring morphism:
8806
+ From: Number Field in a1 with defining polynomial x^2 - 2
8807
+ To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8808
+ Defn: a1 |--> -a^2 - 3/2,
8809
+ None),
8810
+ (Number Field in a2 with defining polynomial x^2 + 4,
8811
+ Ring morphism:
8812
+ From: Number Field in a2 with defining polynomial x^2 + 4
8813
+ To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8814
+ Defn: a2 |--> 2*a^3 + 7*a,
8815
+ None),
8816
+ (Number Field in a3 with defining polynomial x^2 + 2,
8817
+ Ring morphism:
8818
+ From: Number Field in a3 with defining polynomial x^2 + 2
8819
+ To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8820
+ Defn: a3 |--> -2*a^3 - 5*a,
8821
+ None),
8822
+ (Number Field in a4 with defining polynomial x^4 + 1,
8823
+ Ring morphism:
8824
+ From: Number Field in a4 with defining polynomial x^4 + 1
8825
+ To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8826
+ Defn: a4 |--> -a^3 - 1/2*a^2 - 5/2*a - 3/4,
8827
+ Ring morphism:
8828
+ From: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
8829
+ To: Number Field in a4 with defining polynomial x^4 + 1
8830
+ Defn: a |--> 1/2*a4^3 + a4^2 + 1/2*a4)]
8793
8831
  """
8794
8832
  return self._subfields_helper(degree=degree, name=name,
8795
8833
  both_maps=True, optimize=False)
@@ -1956,14 +1956,14 @@ cdef class NumberFieldElement(NumberFieldElement_base):
1956
1956
  sage: x = polygen(ZZ, 'x')
1957
1957
  sage: K.<i> = NumberField(x^2 + 1)
1958
1958
  sage: (6*i + 6).factor()
1959
- (-i) * (i + 1)^3 * 3
1959
+ (i - 1)^3 * 3
1960
1960
 
1961
1961
  In the following example, the class number is 2. If a factorization
1962
1962
  in prime elements exists, we will find it::
1963
1963
 
1964
1964
  sage: K.<a> = NumberField(x^2 - 10)
1965
1965
  sage: factor(169*a + 531)
1966
- (-6*a - 19) * (-3*a - 1) * (-2*a + 9)
1966
+ (-6*a - 19) * (2*a - 9) * (3*a + 1)
1967
1967
  sage: factor(K(3))
1968
1968
  Traceback (most recent call last):
1969
1969
  ...
@@ -2045,7 +2045,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
2045
2045
  0
2046
2046
  sage: R = K.maximal_order()
2047
2047
  sage: R(i+1).gcd(2)
2048
- i + 1
2048
+ i - 1
2049
2049
  sage: R = K.order(2*i)
2050
2050
  sage: R(1).gcd(R(4*i))
2051
2051
  1
@@ -4243,7 +4243,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
4243
4243
 
4244
4244
  sage: P5s = F(5).support()
4245
4245
  sage: P5s
4246
- [Fractional ideal (-t^2 - 1), Fractional ideal (t^2 - 2*t - 1)]
4246
+ [Fractional ideal (t^2 + 1), Fractional ideal (t^2 - 2*t - 1)]
4247
4247
  sage: all(5 in P5 for P5 in P5s)
4248
4248
  True
4249
4249
  sage: all(P5.is_prime() for P5 in P5s)
@@ -4492,7 +4492,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
4492
4492
  sage: f = Qi.embeddings(K)[0]
4493
4493
  sage: a = f(2+3*i) * (2-zeta)^2
4494
4494
  sage: a.descend_mod_power(Qi,2)
4495
- [-2*i + 3, 3*i + 2]
4495
+ [3*i + 2, 2*i - 3]
4496
4496
 
4497
4497
  An absolute example::
4498
4498
 
@@ -13,7 +13,7 @@ EXAMPLES::
13
13
  sage: G = [from_A(z) for z in I.gens()]; G
14
14
  [7, -2*b*a - 1]
15
15
  sage: K.fractional_ideal(G)
16
- Fractional ideal ((1/2*b + 2)*a - 1/2*b + 2)
16
+ Fractional ideal ((-1/2*b + 2)*a - 1/2*b - 2)
17
17
  sage: K.fractional_ideal(G).absolute_norm().factor()
18
18
  7^2
19
19
 
@@ -191,7 +191,7 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal):
191
191
  sage: J.absolute_norm()
192
192
  2
193
193
  sage: J.ideal_below()
194
- Fractional ideal (b)
194
+ Fractional ideal (-b)
195
195
  sage: J.ideal_below().norm()
196
196
  2
197
197
  """
@@ -279,7 +279,7 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal):
279
279
  sage: L.<b> = K.extension(5*x^2 + 1)
280
280
  sage: P = L.primes_above(2)[0]
281
281
  sage: P.gens_reduced()
282
- (2, -15*a*b + 3*a + 1)
282
+ (2, -15*a*b - 3*a + 1)
283
283
  """
284
284
  try:
285
285
  # Compute the single generator, if it exists
@@ -550,14 +550,12 @@ class NumberFieldFractionalIdeal_rel(NumberFieldFractionalIdeal):
550
550
  sage: x = polygen(ZZ, 'x')
551
551
  sage: K.<a, b> = QQ.extension([x^2 + 11, x^2 - 5])
552
552
  sage: K.factor(5)
553
- (Fractional ideal (5, (-1/4*b - 1/4)*a + 1/4*b - 3/4))^2
554
- * (Fractional ideal (5, (-1/4*b - 1/4)*a + 1/4*b - 7/4))^2
553
+ (Fractional ideal (5, (1/4*b - 1/4)*a + 1/4*b + 3/4))^2 * (Fractional ideal (5, (1/4*b - 1/4)*a + 1/4*b + 7/4))^2
555
554
  sage: K.ideal(5).factor()
556
- (Fractional ideal (5, (-1/4*b - 1/4)*a + 1/4*b - 3/4))^2
557
- * (Fractional ideal (5, (-1/4*b - 1/4)*a + 1/4*b - 7/4))^2
555
+ (Fractional ideal (5, (1/4*b - 1/4)*a + 1/4*b + 3/4))^2 * (Fractional ideal (5, (1/4*b - 1/4)*a + 1/4*b + 7/4))^2
558
556
  sage: K.ideal(5).prime_factors()
559
- [Fractional ideal (5, (-1/4*b - 1/4)*a + 1/4*b - 3/4),
560
- Fractional ideal (5, (-1/4*b - 1/4)*a + 1/4*b - 7/4)]
557
+ [Fractional ideal (5, (1/4*b - 1/4)*a + 1/4*b + 3/4),
558
+ Fractional ideal (5, (1/4*b - 1/4)*a + 1/4*b + 7/4)]
561
559
 
562
560
  sage: PQ.<X> = QQ[]
563
561
  sage: F.<a, b> = NumberFieldTower([X^2 - 2, X^2 - 3])
@@ -233,21 +233,21 @@ class NumberField_relative(NumberField_generic):
233
233
  sage: l.<b> = k.extension(5*x^2 + 3); l
234
234
  Number Field in b with defining polynomial 5*x^2 + 3 over its base field
235
235
  sage: l.pari_rnf()
236
- [x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4), ..., y^4 + 6*y^2 + 1, x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4)], [0, 0]]
236
+ [x^2 + (5/4*y^3 - 1/4*y^2 + 27/4*y - 3/4)*x + (-9/4*y^3 - 1/4*y^2 - 47/4*y - 7/4), ..., y^4 + 6*y^2 + 1, x^2 + (5/4*y^3 - 1/4*y^2 + 27/4*y - 3/4)*x + (-9/4*y^3 - 1/4*y^2 - 47/4*y - 7/4)], [0, 0]]
237
237
  sage: b
238
238
  b
239
239
 
240
240
  sage: l.<b> = k.extension(x^2 + 3/5); l
241
241
  Number Field in b with defining polynomial x^2 + 3/5 over its base field
242
242
  sage: l.pari_rnf()
243
- [x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4), ..., y^4 + 6*y^2 + 1, x^2 + (-y^3 + 1/2*y^2 - 6*y + 3/2)*x + (-3/4*y^3 - 1/4*y^2 - 17/4*y - 19/4)], [0, 0]]
243
+ [x^2 + (5/4*y^3 - 1/4*y^2 + 27/4*y - 3/4)*x + (-9/4*y^3 - 1/4*y^2 - 47/4*y - 7/4), ..., y^4 + 6*y^2 + 1, x^2 + (5/4*y^3 - 1/4*y^2 + 27/4*y - 3/4)*x + (-9/4*y^3 - 1/4*y^2 - 47/4*y - 7/4)], [0, 0]]
244
244
  sage: b
245
245
  b
246
246
 
247
247
  sage: l.<b> = k.extension(x - 1/a0); l
248
248
  Number Field in b with defining polynomial x + 1/2*a0 over its base field
249
249
  sage: l.pari_rnf()
250
- [x, [4, -x^3 - x^2 - 7*x - 3, -x^3 + x^2 - 7*x + 3, 2*x^3 + 10*x], ..., [x^4 + 6*x^2 + 1, -x, -1, y^4 + 6*y^2 + 1, x], [0, 0]]
250
+ [x, [4, -x^3 + x^2 - 7*x + 3, -2*x^3 - 10*x, x^3 + x^2 + 7*x + 3], ..., [x^4 + 6*x^2 + 1, -x, -1, y^4 + 6*y^2 + 1, x], [0, 0]]
251
251
  sage: b
252
252
  -1/2*a0
253
253
 
@@ -1624,9 +1624,9 @@ class NumberField_relative(NumberField_generic):
1624
1624
  sage: K.<a> = NumberField(x^2 + 1)
1625
1625
  sage: L.<b> = K.extension(x^2 - 1/2)
1626
1626
  sage: L._pari_relative_structure()
1627
- (x^2 + Mod(-y, y^2 + 1),
1628
- Mod(Mod(1/2*y - 1/2, y^2 + 1)*x, x^2 + Mod(-y, y^2 + 1)),
1629
- Mod(Mod(-y - 1, y^2 + 1)*x, Mod(1, y^2 + 1)*x^2 + Mod(-1/2, y^2 + 1)))
1627
+ (x^2 + Mod(y, y^2 + 1),
1628
+ Mod(Mod(-1/2*y - 1/2, y^2 + 1)*x, x^2 + Mod(y, y^2 + 1)),
1629
+ Mod(Mod(y - 1, y^2 + 1)*x, x^2 + Mod(-1/2, y^2 + 1)))
1630
1630
 
1631
1631
  An example where both fields are defined by non-integral or
1632
1632
  non-monic polynomials::
@@ -1927,7 +1927,7 @@ class NumberField_relative(NumberField_generic):
1927
1927
  sage: k.relative_polynomial()
1928
1928
  x^2 + 1/3
1929
1929
  sage: k.pari_relative_polynomial()
1930
- x^2 + Mod(y, y^2 + 1)*x - 1
1930
+ x^2 + Mod(-y, y^2 + 1)*x - 1
1931
1931
  """
1932
1932
  return QQ['x'](self._pari_rnfeq()[0])
1933
1933
 
@@ -2700,7 +2700,7 @@ class NumberField_relative(NumberField_generic):
2700
2700
  sage: x = polygen(ZZ, 'x')
2701
2701
  sage: K.<a, b> = NumberField([x^2 + 23, x^2 - 3])
2702
2702
  sage: P = K.prime_factors(5)[0]; P
2703
- Fractional ideal (5, 1/2*a + b - 5/2)
2703
+ Fractional ideal (5, -1/2*a + b + 5/2)
2704
2704
  sage: u = K.uniformizer(P)
2705
2705
  sage: u.valuation(P)
2706
2706
  1
@@ -2938,7 +2938,7 @@ def GaussianIntegers(names='I', latex_name='i'):
2938
2938
  sage: ZZI
2939
2939
  Gaussian Integers generated by I in Number Field in I with defining polynomial x^2 + 1 with I = 1*I
2940
2940
  sage: factor(3 + I)
2941
- (-I) * (I + 1) * (2*I + 1)
2941
+ (-2*I - 1) * (I - 1)
2942
2942
  sage: CC(I)
2943
2943
  1.00000000000000*I
2944
2944
  sage: I.minpoly()
@@ -2969,7 +2969,7 @@ def EisensteinIntegers(names='omega'):
2969
2969
  with defining polynomial x^2 + x + 1
2970
2970
  with omega = -0.50000000000000000? + 0.866025403784439?*I
2971
2971
  sage: factor(3 + omega)
2972
- (-1) * (-omega - 3)
2972
+ (omega) * (-3*omega - 2)
2973
2973
  sage: CC(omega)
2974
2974
  -0.500000000000000 + 0.866025403784439*I
2975
2975
  sage: omega.minpoly()
@@ -73,7 +73,7 @@ def _ideal_generator(I):
73
73
 
74
74
  sage: K.<a> = QuadraticField(-11)
75
75
  sage: [_ideal_generator(K.prime_above(p)) for p in primes(25)]
76
- [2, 1/2*a - 1/2, -1/2*a - 3/2, 7, -a, 13, 17, 19, 1/2*a + 9/2]
76
+ [2, 1/2*a - 1/2, -1/2*a - 3/2, 7, a, 13, 17, 19, 1/2*a + 9/2]
77
77
  """
78
78
  try:
79
79
  return I.gens_reduced()[0]
@@ -491,9 +491,9 @@ def pSelmerGroup(K, S, p, proof=None, debug=False):
491
491
 
492
492
  sage: [K.ideal(g).factor() for g in gens]
493
493
  [(Fractional ideal (2, a + 1)) * (Fractional ideal (3, a + 1)),
494
- Fractional ideal (a),
495
- (Fractional ideal (2, a + 1))^2,
496
- 1]
494
+ Fractional ideal (-a),
495
+ (Fractional ideal (2, a + 1))^2,
496
+ 1]
497
497
 
498
498
  sage: toKS2(10)
499
499
  (0, 0, 1, 1)