From 70191d15b08d1edbe0a522ba69299edca96093ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 4 Oct 2025 15:22:47 +0200 Subject: [PATCH 1/2] remove some deprecated materiel in rings --- ...otics_multivariate_generating_functions.py | 47 ------------ src/sage/rings/asymptotic/term_monoid.py | 44 ++---------- .../rings/polynomial/polynomial_element.pyx | 2 - .../polynomial/polynomial_zmod_flint.pyx | 7 +- src/sage/rings/qqbar.py | 72 ++++--------------- src/sage/rings/rational_field.py | 10 +-- 6 files changed, 23 insertions(+), 159 deletions(-) diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py index 02a3d1291ff..94a054d601a 100644 --- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py @@ -3620,53 +3620,6 @@ def diff_prod(f_derivs, u, g, X, interval, end, uderivs, atc): return uderivs -def permutation_sign(s, u): - r""" - This function returns the sign of the permutation on - ``1, ..., len(u)`` that is induced by the sublist ``s`` of ``u``. - - .. NOTE:: - - This function was intended for internal use and is deprecated now - (:issue:`29465`). - - INPUT: - - - ``s`` -- a sublist of ``u`` - - ``u`` -- list - - OUTPUT: - - The sign of the permutation obtained by taking indices - within ``u`` of the list ``s + sc``, where ``sc`` is ``u`` - with the elements of ``s`` removed. - - EXAMPLES:: - - sage: from sage.rings.asymptotic.asymptotics_multivariate_generating_functions import permutation_sign - sage: u = ['a', 'b', 'c', 'd', 'e'] - sage: s = ['b', 'd'] - sage: permutation_sign(s, u) - doctest:...: DeprecationWarning: the function permutation_sign is deprecated - See https://github.com/sagemath/sage/issues/29465 for details. - -1 - sage: s = ['d', 'b'] - sage: permutation_sign(s, u) - 1 - """ - from sage.misc.superseded import deprecation - deprecation(29465, 'the function permutation_sign is deprecated') - from sage.combinat.permutation import Permutation - - # Convert lists to lists of numbers in {1,..., len(u)} - A = [i + 1 for i in range(len(u))] - B = [u.index(x) + 1 for x in s] - - C = sorted(set(A).difference(set(B))) - P = Permutation(B + C) - return P.signature() - - def subs_all(f, sub, simplify=False): r""" Return the items of `f` substituted by the dictionaries diff --git a/src/sage/rings/asymptotic/term_monoid.py b/src/sage/rings/asymptotic/term_monoid.py index 588580c3e13..931aeae94dd 100644 --- a/src/sage/rings/asymptotic/term_monoid.py +++ b/src/sage/rings/asymptotic/term_monoid.py @@ -1664,7 +1664,7 @@ def _coerce_map_from_(self, S): self.coefficient_ring.has_coerce_map_from(S.coefficient_ring): return True - def _element_constructor_(self, data, *args, **kwds): + def _element_constructor_(self, data, **kwds): r""" Convert the given object to this term monoid. @@ -1673,9 +1673,6 @@ def _element_constructor_(self, data, *args, **kwds): - ``data`` -- a growth element or an object representing the element to be initialized - - ``coefficient`` -- (default: ``None``) an element of the coefficient - ring - - ``**kwds`` -- keyword arguments passed on to the term OUTPUT: an element of this term monoid @@ -1774,41 +1771,12 @@ def _element_constructor_(self, data, *args, **kwds): Traceback (most recent call last): ... ValueError: Argument 'growth=x' is ambiguous. - - :: - - sage: OT(G.gen(), 4) - doctest:warning - ... - DeprecationWarning: Passing 'coefficient' as a positional argument is deprecated; - specify it as keyword argument 'coefficient=...'. - See https://github.com/sagemath/sage/issues/32215 for details. - O(x) - sage: OT(G.gen(), 4, coefficient=5) - Traceback (most recent call last): - ... - ValueError: Argument 'coefficient=5' is ambiguous. """ - if len(args) > 1: - raise TypeError( - f'GenericTermMonoid._element_constructor_ ' - f'takes one positional argument, ' - f'another positional argument is deprecated, ' - f'but {len(args)+1} were given') - if len(args) == 1: - from sage.misc.superseded import deprecation - deprecation(32215, - "Passing 'coefficient' as a positional argument is deprecated; " - "specify it as keyword argument 'coefficient=...'.") - if 'coefficient' in kwds: - raise ValueError(f"Argument 'coefficient={kwds['coefficient']}' is ambiguous.") - kwds['coefficient'] = args[0] - if isinstance(data, self.element_class) and data.parent() == self: return data - elif isinstance(data, GenericTerm): + if isinstance(data, GenericTerm): return self.from_construction(data.construction(), **kwds) - elif isinstance(data, int) and data == 0: + if isinstance(data, int) and data == 0: raise ValueError('No input specified. Cannot continue ' 'creating an element of %s.' % (self,)) @@ -2081,7 +2049,7 @@ def from_construction(self, construction, **kwds_overrides): sage: T = TermMonoid('O', G, QQ) sage: T(G.gen()) # indirect doctest O(x) - sage: T(G.gen(), SR.var('y')) # indirect doctest + sage: T(G.gen(), coefficient=SR.var('y')) # indirect doctest Traceback (most recent call last): ... ValueError: Cannot create OTerm(x) since given coefficient y @@ -3033,7 +3001,7 @@ def __init__(self, parent, growth, coefficient): The coefficients have to be from the given coefficient ring:: - sage: CT_ZZ(x, 1/2) + sage: CT_ZZ(x, coefficient=1/2) Traceback (most recent call last): ... ValueError: Cannot create TermWithCoefficient(x) @@ -3045,7 +3013,7 @@ def __init__(self, parent, growth, coefficient): For technical reasons, the coefficient 0 is not allowed:: - sage: CT_ZZ(x^42, 0) + sage: CT_ZZ(x^42, coefficient=0) Traceback (most recent call last): ... ZeroCoefficientError: Zero coefficient 0 is not allowed in diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 1a2e1257cb6..6b4a8792edc 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -10024,8 +10024,6 @@ cdef class Polynomial(CommutativePolynomial): t1 = t1 / c return t1, t0 - rational_reconstruct = deprecated_function_alias(12696, rational_reconstruction) - def variables(self): """ Return the tuple of variables occurring in this polynomial. diff --git a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx index 060dbed099f..0b472118b56 100644 --- a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx +++ b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx @@ -666,12 +666,7 @@ cdef class Polynomial_zmod_flint(Polynomial_template): # make the denominator monic c = t0.leading_coefficient() - t0 = t0.monic() - t1 = t1/c - - return t1, t0 - - rational_reconstruct = deprecated_function_alias(12696, rational_reconstruction) + return t1 / c, t0.monic() @cached_method def is_irreducible(self): diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 6e0aadb56f8..996cea78a4f 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -986,7 +986,7 @@ def _factor_multivariate_polynomial(self, f, proof=True): for k, v in numfield_f.monomial_coefficients().items()) norm_flat = polynomial_flat.resultant(numfield_polynomial_flat, nf_gen) - norm_f = norm_flat((0,)+norm_ring.gens()) + norm_f = norm_flat((0,) + norm_ring.gens()) else: norm_f = numfield_f @@ -1001,9 +1001,9 @@ def _factor_multivariate_polynomial(self, f, proof=True): factors = [] - for i in range(2, len(L[1])+1): + for i in range(2, len(L[1]) + 1): factor = L[1][i].sage() - #multiplicity = L[2][i].sage() + # multiplicity = L[2][i].sage() minpoly = L[3][i].sage() factors.append((factor, minpoly)) @@ -1050,7 +1050,7 @@ def NF_elem_map(e): factor_f = factor_f.change_ring(AA) for i in itertools.count(1): if f % factor_f**i != 0: - multiplicity = i-1 + multiplicity = i - 1 break if multiplicity > 0: factorization.append((factor_f, multiplicity)) @@ -1570,28 +1570,6 @@ def _factor_univariate_polynomial(self, f): unit=f.leading_coefficient()) -def is_AlgebraicRealField(F): - r""" - Check whether ``F`` is an :class:`~AlgebraicRealField` instance. For internal use. - - This function is deprecated. Use :func:`isinstance` with - :class:`~sage.rings.abc.AlgebraicRealField` instead. - - EXAMPLES:: - - sage: from sage.rings.qqbar import is_AlgebraicRealField - sage: [is_AlgebraicRealField(x) for x in [AA, QQbar, None, 0, "spam"]] - doctest:warning... - DeprecationWarning: is_AlgebraicRealField is deprecated; - use isinstance(..., sage.rings.abc.AlgebraicRealField instead - See https://github.com/sagemath/sage/issues/32660 for details. - [True, False, False, False, False] - """ - from sage.misc.superseded import deprecation - deprecation(32660, 'is_AlgebraicRealField is deprecated; use isinstance(..., sage.rings.abc.AlgebraicRealField instead') - return isinstance(F, AlgebraicRealField) - - # Create the globally unique AlgebraicRealField object. AA = AlgebraicRealField() @@ -2123,28 +2101,6 @@ def _factor_univariate_polynomial(self, f): unit=f.leading_coefficient()) -def is_AlgebraicField(F): - r""" - Check whether ``F`` is an :class:`~AlgebraicField` instance. - - This function is deprecated. Use :func:`isinstance` with - :class:`~sage.rings.abc.AlgebraicField` instead. - - EXAMPLES:: - - sage: from sage.rings.qqbar import is_AlgebraicField - sage: [is_AlgebraicField(x) for x in [AA, QQbar, None, 0, "spam"]] - doctest:warning... - DeprecationWarning: is_AlgebraicField is deprecated; - use isinstance(..., sage.rings.abc.AlgebraicField instead - See https://github.com/sagemath/sage/issues/32660 for details. - [False, True, False, False, False] - """ - from sage.misc.superseded import deprecation - deprecation(32660, 'is_AlgebraicField is deprecated; use isinstance(..., sage.rings.abc.AlgebraicField instead') - return isinstance(F, AlgebraicField) - - # Create the globally unique AlgebraicField object. QQbar = AlgebraicField() @@ -3060,7 +3016,7 @@ def cmp_elements_with_same_minpoly(a, b, p): real = ar.union(br) imag = ai.union(bi) oroots = [r for r in roots if r._value.real().overlaps(real) - and r._value.imag().overlaps(imag)] + and r._value.imag().overlaps(imag)] if not oroots: raise RuntimeError('a = {}\nb = {}\np = {}'.format(a, b, p)) if len(oroots) == 1: @@ -3072,9 +3028,8 @@ def cmp_elements_with_same_minpoly(a, b, p): # real part are equal) imag = ai.abs().union(bi.abs()) oroots = [r for r in roots if r._value.real().overlaps(real) - and r._value.imag().abs().overlaps(imag)] - if (len(oroots) == 2 and - not oroots[0]._value.imag().contains_zero()): + and r._value.imag().abs().overlaps(imag)] + if len(oroots) == 2 and not oroots[0]._value.imag().contains_zero(): # There is a complex conjugate pair of roots matching both # descriptors, so compare by imaginary value. while ai.contains_zero(): @@ -7460,9 +7415,9 @@ def _real_refine_interval(self, interval, prec): newton_lower = not newton_lower if newton_lower: - interval = interval.intersection(field(l) - pl/slope) + interval = interval.intersection(field(l) - pl / slope) else: - interval = interval.intersection(field(u) - pu/slope) + interval = interval.intersection(field(u) - pu / slope) new_diam = interval.diameter() if new_diam == 0: @@ -7481,8 +7436,8 @@ def _real_refine_interval(self, interval, prec): continue # bisection - for i,j in [(2,2),(3,1),(1,3)]: - c = (i*l + j*u) / 4 + for i, j in [(2, 2), (3, 1), (1, 3)]: + c = (i * l + j * u) / 4 pc = interval_p(field(c)) if c <= l or c >= u: @@ -8946,8 +8901,9 @@ def an_binop_element(a, b, op): # instanciation of the multimethod dispatch _binop_algo[ANRational, ANRational] = an_binop_rational _binop_algo[ANRational, ANExtensionElement] = \ -_binop_algo[ANExtensionElement, ANRational] = \ -_binop_algo[ANExtensionElement, ANExtensionElement] = an_binop_element + _binop_algo[ANExtensionElement, ANRational] = \ + _binop_algo[ANExtensionElement, ANExtensionElement] = an_binop_element + for t1 in (ANRational, ANRoot, ANExtensionElement, ANUnaryExpr, ANBinaryExpr): for t2 in (ANUnaryExpr, ANBinaryExpr, ANRoot): _binop_algo[t1, t2] = _binop_algo[t2, t1] = an_binop_expr diff --git a/src/sage/rings/rational_field.py b/src/sage/rings/rational_field.py index c8c84901607..37f84cd3eee 100644 --- a/src/sage/rings/rational_field.py +++ b/src/sage/rings/rational_field.py @@ -1329,16 +1329,10 @@ def selmer_generators(self, S, m, proof=True, orders=False): """ gens = list(S) ords = [ZZ(m)] * len(S) - if m % 2 == 0: + if not m % 2: gens = [ZZ(-1)] + gens ords = [ZZ(2)] + ords - if orders: - return gens, ords - else: - return gens - - # For backwards compatibility: - selmer_group = deprecated_function_alias(31345, selmer_generators) + return (gens, ords) if orders else gens def selmer_group_iterator(self, S, m, proof=True): r""" From 2f7a277028c688d32b498529aa96971b5fb7d1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 4 Oct 2025 16:00:31 +0200 Subject: [PATCH 2/2] remove GaloisGroup_v1, long deprecated --- src/sage/rings/number_field/galois_group.py | 224 +------------------- src/sage/rings/number_field/number_field.py | 21 +- 2 files changed, 3 insertions(+), 242 deletions(-) diff --git a/src/sage/rings/number_field/galois_group.py b/src/sage/rings/number_field/galois_group.py index 2807f3c6299..e6d476806bd 100644 --- a/src/sage/rings/number_field/galois_group.py +++ b/src/sage/rings/number_field/galois_group.py @@ -8,7 +8,6 @@ - David Loeffler (2009): rewrote to give explicit homomorphism groups """ -from sage.structure.sage_object import SageObject from sage.groups.galois_group import _alg_key from sage.groups.galois_group_perm import GaloisGroup_perm, GaloisSubgroup_perm from sage.groups.perm_gps.permgroup import standardize_generator @@ -24,198 +23,6 @@ from sage.rings.rational_field import QQ -class GaloisGroup_v1(SageObject): - r""" - A wrapper around a class representing an abstract transitive group. - - This is just a fairly minimal object at present. To get the underlying - group, do ``G.group()``, and to get the corresponding number field do - ``G.number_field()``. For a more sophisticated interface use the - ``type=None`` option. - - EXAMPLES:: - - sage: # needs sage.symbolic - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: K = QQ[2^(1/3)] - sage: pK = K.absolute_polynomial() - sage: G = GaloisGroup_v1(pK.galois_group(pari_group=True), K); G - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - Galois group PARI group [6, -1, 2, "S3"] of degree 3 of the - Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873? - sage: G.order() - 6 - sage: G.group() - PARI group [6, -1, 2, "S3"] of degree 3 - sage: G.number_field() - Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873? - """ - - def __init__(self, group, number_field): - """ - Create a Galois group. - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField([x^2 + 1, x^2 + 2],'a') - sage: GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K) - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - Galois group PARI group [4, 1, 2, "E(4) = 2[x]2"] of degree 4 of the - Number Field in a0 with defining polynomial x^2 + 1 over its base field - - TESTS:: - - sage: x = polygen(ZZ, 'x') - sage: G = NumberField(x^3 + 2, 'alpha').galois_group(names='beta'); G - Galois group 3T2 (S3) with order 6 of x^3 + 2 - sage: G == loads(dumps(G)) - True - """ - deprecation(28782, "GaloisGroup_v1 is deprecated; please use GaloisGroup_v2") - self.__group = group - self.__number_field = number_field - - def __eq__(self, other): - """ - Compare two number field Galois groups. - - First the number fields are compared, then the Galois groups - if the number fields are equal. (Of course, if the number - fields are the same, the Galois groups are automatically - equal.) - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField(x^3 + 2, 'alpha') - sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K) - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - - sage: # needs sage.symbolic - sage: L = QQ[sqrt(2)] - sage: H = GaloisGroup_v1(L.absolute_polynomial().galois_group(pari_group=True), L) - sage: H == G - False - sage: H == H - True - sage: G == G - True - """ - if not isinstance(other, GaloisGroup_v1): - return False - if self.__number_field == other.__number_field: - return True - return self.__group == other.__group - - def __ne__(self, other): - """ - Test for unequality. - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField(x^3 + 2, 'alpha') - sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K) - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - - sage: # needs sage.symbolic - sage: L = QQ[sqrt(2)] - sage: H = GaloisGroup_v1(L.absolute_polynomial().galois_group(pari_group=True), L) - sage: H != G - True - sage: H != H - False - sage: G != G - False - """ - return not (self == other) - - def __repr__(self): - """ - Display print representation of a Galois group. - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField(x^4 + 2*x + 2, 'a') - sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K) - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - sage: G.__repr__() - 'Galois group PARI group [24, -1, 5, "S4"] of degree 4 of the Number Field in a with defining polynomial x^4 + 2*x + 2' - """ - return "Galois group %s of the %s" % (self.__group, - self.__number_field) - - def group(self): - """ - Return the underlying abstract group. - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField(x^3 + 2*x + 2, 'theta') - sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K) - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - sage: H = G.group(); H - PARI group [6, -1, 2, "S3"] of degree 3 - sage: P = H.permutation_group(); P - Transitive group number 2 of degree 3 - sage: sorted(P) - [(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)] - """ - return self.__group - - def order(self): - """ - Return the order of this Galois group. - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField(x^5 + 2, 'theta_1') - sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K); G - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - Galois group PARI group [20, -1, 3, "F(5) = 5:4"] of degree 5 of the - Number Field in theta_1 with defining polynomial x^5 + 2 - sage: G.order() - 20 - """ - return self.__group.order() - - def number_field(self): - """ - Return the number field of which this is the Galois group. - - EXAMPLES:: - - sage: from sage.rings.number_field.galois_group import GaloisGroup_v1 - sage: x = polygen(ZZ, 'x') - sage: K = NumberField(x^6 + 2, 't') - sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K); G - ...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2 - See https://github.com/sagemath/sage/issues/28782 for details. - Galois group PARI group [12, -1, 3, "D(6) = S(3)[x]2"] of degree 6 of the - Number Field in t with defining polynomial x^6 + 2 - sage: G.number_field() - Number Field in t with defining polynomial x^6 + 2 - """ - return self.__number_field - - class GaloisGroup_v2(GaloisGroup_perm): r""" The Galois group of an (absolute) number field. @@ -327,31 +134,9 @@ def _pol_galgp(self, algorithm=None): """ algorithm = self._get_algorithm(algorithm) f = self._field.absolute_polynomial() - pari_group = (self._type != "gap") # while GaloisGroup_v1 is deprecated + pari_group = (self._type != "gap") # while GaloisGroup_v1 is deprecated return f.galois_group(pari_group=pari_group, algorithm=algorithm) - def group(self): - """ - While :class:`GaloisGroup_v1` is being deprecated, this provides public access to the PARI/GAP group - in order to keep all aspects of that API. - - EXAMPLES:: - - sage: R. = ZZ[] - sage: x = polygen(ZZ, 'x') - sage: K. = NumberField(x^3 + 2*x + 2) - sage: G = K.galois_group(type='pari') - ...DeprecationWarning: the different Galois types have been merged into one class - See https://github.com/sagemath/sage/issues/28782 for details. - sage: G.group() - ...DeprecationWarning: the group method is deprecated; - you can use _pol_galgp if you really need it - See https://github.com/sagemath/sage/issues/28782 for details. - PARI group [6, -1, 2, "S3"] of degree 3 - """ - deprecation(28782, "the group method is deprecated; you can use _pol_galgp if you really need it") - return self._pol_galgp() - @cached_method(key=_alg_key) def order(self, algorithm=None, recompute=False): """ @@ -1270,8 +1055,7 @@ def __call__(self, x): """ if x.parent() == self.parent().splitting_field(): return self.as_hom()(x) - else: - return self.as_hom()(self.parent()._gc_map(x)) + return self.as_hom()(self.parent()._gc_map(x)) def ramification_degree(self, P): """ @@ -1298,7 +1082,3 @@ def ramification_degree(self, P): GaloisGroup_v2.Element = GaloisGroupElement GaloisGroup_v2.Subgroup = GaloisGroup_subgroup GaloisGroup_subgroup.Element = GaloisGroupElement - -# For unpickling purposes we rebind GaloisGroup as GaloisGroup_v1. - -GaloisGroup = GaloisGroup_v1 diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index 844bfc3d557..598104f2c18 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -6217,15 +6217,12 @@ def is_abelian(self): return pari_pol.galoisinit().galoisisabelian(1) == 1 @cached_method - def galois_group(self, type=None, algorithm='pari', names=None, gc_numbering=None): + def galois_group(self, algorithm='pari', names=None, gc_numbering=None): r""" Return the Galois group of the Galois closure of this number field. INPUT: - - ``type`` -- deprecated; the different versions of Galois groups have been - merged in :issue:`28782` - - ``algorithm`` -- ``'pari'``, ``'gap'``, ``'kash'``, or ``'magma'`` (default: ``'pari'``); for degrees between 12 and 15 default is ``'gap'``, and when the degree is >= 16 it is ``'kash'``) @@ -6312,23 +6309,7 @@ def galois_group(self, type=None, algorithm='pari', names=None, gc_numbering=Non if you want the Galois group of the absolute field See https://github.com/sagemath/sage/issues/28782 for details. Galois group 10T22 (S(5)[x]2) with order 240 of t^5 - t + a - - TESTS: - - We check that the changes in :issue:`28782` won't break code that used v1 Galois groups:: - - sage: # needs sage.groups - sage: G = NumberField(x^3 - 2, 'a').galois_group(type='pari') - ...DeprecationWarning: the different Galois types have been merged into one class - See https://github.com/sagemath/sage/issues/28782 for details. - sage: G.group() - ...DeprecationWarning: the group method is deprecated; you can use _pol_galgp if you really need it - See https://github.com/sagemath/sage/issues/28782 for details. - PARI group [6, -1, 2, "S3"] of degree 3 """ - if type is not None: - deprecation(28782, "the different Galois types have been merged into one class") - from .galois_group import GaloisGroup_v2 return GaloisGroup_v2(self, algorithm=algorithm, names=names, gc_numbering=gc_numbering, _type=type)