Skip to content

Commit 2f7a277

Browse files
committed
remove GaloisGroup_v1, long deprecated
1 parent 70191d1 commit 2f7a277

File tree

2 files changed

+3
-242
lines changed

2 files changed

+3
-242
lines changed

src/sage/rings/number_field/galois_group.py

Lines changed: 2 additions & 222 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- David Loeffler (2009): rewrote to give explicit homomorphism groups
99
"""
1010

11-
from sage.structure.sage_object import SageObject
1211
from sage.groups.galois_group import _alg_key
1312
from sage.groups.galois_group_perm import GaloisGroup_perm, GaloisSubgroup_perm
1413
from sage.groups.perm_gps.permgroup import standardize_generator
@@ -24,198 +23,6 @@
2423
from sage.rings.rational_field import QQ
2524

2625

27-
class GaloisGroup_v1(SageObject):
28-
r"""
29-
A wrapper around a class representing an abstract transitive group.
30-
31-
This is just a fairly minimal object at present. To get the underlying
32-
group, do ``G.group()``, and to get the corresponding number field do
33-
``G.number_field()``. For a more sophisticated interface use the
34-
``type=None`` option.
35-
36-
EXAMPLES::
37-
38-
sage: # needs sage.symbolic
39-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
40-
sage: K = QQ[2^(1/3)]
41-
sage: pK = K.absolute_polynomial()
42-
sage: G = GaloisGroup_v1(pK.galois_group(pari_group=True), K); G
43-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
44-
See https://github.com/sagemath/sage/issues/28782 for details.
45-
Galois group PARI group [6, -1, 2, "S3"] of degree 3 of the
46-
Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873?
47-
sage: G.order()
48-
6
49-
sage: G.group()
50-
PARI group [6, -1, 2, "S3"] of degree 3
51-
sage: G.number_field()
52-
Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873?
53-
"""
54-
55-
def __init__(self, group, number_field):
56-
"""
57-
Create a Galois group.
58-
59-
EXAMPLES::
60-
61-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
62-
sage: x = polygen(ZZ, 'x')
63-
sage: K = NumberField([x^2 + 1, x^2 + 2],'a')
64-
sage: GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K)
65-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
66-
See https://github.com/sagemath/sage/issues/28782 for details.
67-
Galois group PARI group [4, 1, 2, "E(4) = 2[x]2"] of degree 4 of the
68-
Number Field in a0 with defining polynomial x^2 + 1 over its base field
69-
70-
TESTS::
71-
72-
sage: x = polygen(ZZ, 'x')
73-
sage: G = NumberField(x^3 + 2, 'alpha').galois_group(names='beta'); G
74-
Galois group 3T2 (S3) with order 6 of x^3 + 2
75-
sage: G == loads(dumps(G))
76-
True
77-
"""
78-
deprecation(28782, "GaloisGroup_v1 is deprecated; please use GaloisGroup_v2")
79-
self.__group = group
80-
self.__number_field = number_field
81-
82-
def __eq__(self, other):
83-
"""
84-
Compare two number field Galois groups.
85-
86-
First the number fields are compared, then the Galois groups
87-
if the number fields are equal. (Of course, if the number
88-
fields are the same, the Galois groups are automatically
89-
equal.)
90-
91-
EXAMPLES::
92-
93-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
94-
sage: x = polygen(ZZ, 'x')
95-
sage: K = NumberField(x^3 + 2, 'alpha')
96-
sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K)
97-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
98-
See https://github.com/sagemath/sage/issues/28782 for details.
99-
100-
sage: # needs sage.symbolic
101-
sage: L = QQ[sqrt(2)]
102-
sage: H = GaloisGroup_v1(L.absolute_polynomial().galois_group(pari_group=True), L)
103-
sage: H == G
104-
False
105-
sage: H == H
106-
True
107-
sage: G == G
108-
True
109-
"""
110-
if not isinstance(other, GaloisGroup_v1):
111-
return False
112-
if self.__number_field == other.__number_field:
113-
return True
114-
return self.__group == other.__group
115-
116-
def __ne__(self, other):
117-
"""
118-
Test for unequality.
119-
120-
EXAMPLES::
121-
122-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
123-
sage: x = polygen(ZZ, 'x')
124-
sage: K = NumberField(x^3 + 2, 'alpha')
125-
sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K)
126-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
127-
See https://github.com/sagemath/sage/issues/28782 for details.
128-
129-
sage: # needs sage.symbolic
130-
sage: L = QQ[sqrt(2)]
131-
sage: H = GaloisGroup_v1(L.absolute_polynomial().galois_group(pari_group=True), L)
132-
sage: H != G
133-
True
134-
sage: H != H
135-
False
136-
sage: G != G
137-
False
138-
"""
139-
return not (self == other)
140-
141-
def __repr__(self):
142-
"""
143-
Display print representation of a Galois group.
144-
145-
EXAMPLES::
146-
147-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
148-
sage: x = polygen(ZZ, 'x')
149-
sage: K = NumberField(x^4 + 2*x + 2, 'a')
150-
sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K)
151-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
152-
See https://github.com/sagemath/sage/issues/28782 for details.
153-
sage: G.__repr__()
154-
'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'
155-
"""
156-
return "Galois group %s of the %s" % (self.__group,
157-
self.__number_field)
158-
159-
def group(self):
160-
"""
161-
Return the underlying abstract group.
162-
163-
EXAMPLES::
164-
165-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
166-
sage: x = polygen(ZZ, 'x')
167-
sage: K = NumberField(x^3 + 2*x + 2, 'theta')
168-
sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K)
169-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
170-
See https://github.com/sagemath/sage/issues/28782 for details.
171-
sage: H = G.group(); H
172-
PARI group [6, -1, 2, "S3"] of degree 3
173-
sage: P = H.permutation_group(); P
174-
Transitive group number 2 of degree 3
175-
sage: sorted(P)
176-
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)]
177-
"""
178-
return self.__group
179-
180-
def order(self):
181-
"""
182-
Return the order of this Galois group.
183-
184-
EXAMPLES::
185-
186-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
187-
sage: x = polygen(ZZ, 'x')
188-
sage: K = NumberField(x^5 + 2, 'theta_1')
189-
sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K); G
190-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
191-
See https://github.com/sagemath/sage/issues/28782 for details.
192-
Galois group PARI group [20, -1, 3, "F(5) = 5:4"] of degree 5 of the
193-
Number Field in theta_1 with defining polynomial x^5 + 2
194-
sage: G.order()
195-
20
196-
"""
197-
return self.__group.order()
198-
199-
def number_field(self):
200-
"""
201-
Return the number field of which this is the Galois group.
202-
203-
EXAMPLES::
204-
205-
sage: from sage.rings.number_field.galois_group import GaloisGroup_v1
206-
sage: x = polygen(ZZ, 'x')
207-
sage: K = NumberField(x^6 + 2, 't')
208-
sage: G = GaloisGroup_v1(K.absolute_polynomial().galois_group(pari_group=True), K); G
209-
...DeprecationWarning: GaloisGroup_v1 is deprecated; please use GaloisGroup_v2
210-
See https://github.com/sagemath/sage/issues/28782 for details.
211-
Galois group PARI group [12, -1, 3, "D(6) = S(3)[x]2"] of degree 6 of the
212-
Number Field in t with defining polynomial x^6 + 2
213-
sage: G.number_field()
214-
Number Field in t with defining polynomial x^6 + 2
215-
"""
216-
return self.__number_field
217-
218-
21926
class GaloisGroup_v2(GaloisGroup_perm):
22027
r"""
22128
The Galois group of an (absolute) number field.
@@ -327,31 +134,9 @@ def _pol_galgp(self, algorithm=None):
327134
"""
328135
algorithm = self._get_algorithm(algorithm)
329136
f = self._field.absolute_polynomial()
330-
pari_group = (self._type != "gap") # while GaloisGroup_v1 is deprecated
137+
pari_group = (self._type != "gap") # while GaloisGroup_v1 is deprecated
331138
return f.galois_group(pari_group=pari_group, algorithm=algorithm)
332139

333-
def group(self):
334-
"""
335-
While :class:`GaloisGroup_v1` is being deprecated, this provides public access to the PARI/GAP group
336-
in order to keep all aspects of that API.
337-
338-
EXAMPLES::
339-
340-
sage: R.<x> = ZZ[]
341-
sage: x = polygen(ZZ, 'x')
342-
sage: K.<a> = NumberField(x^3 + 2*x + 2)
343-
sage: G = K.galois_group(type='pari')
344-
...DeprecationWarning: the different Galois types have been merged into one class
345-
See https://github.com/sagemath/sage/issues/28782 for details.
346-
sage: G.group()
347-
...DeprecationWarning: the group method is deprecated;
348-
you can use _pol_galgp if you really need it
349-
See https://github.com/sagemath/sage/issues/28782 for details.
350-
PARI group [6, -1, 2, "S3"] of degree 3
351-
"""
352-
deprecation(28782, "the group method is deprecated; you can use _pol_galgp if you really need it")
353-
return self._pol_galgp()
354-
355140
@cached_method(key=_alg_key)
356141
def order(self, algorithm=None, recompute=False):
357142
"""
@@ -1270,8 +1055,7 @@ def __call__(self, x):
12701055
"""
12711056
if x.parent() == self.parent().splitting_field():
12721057
return self.as_hom()(x)
1273-
else:
1274-
return self.as_hom()(self.parent()._gc_map(x))
1058+
return self.as_hom()(self.parent()._gc_map(x))
12751059

12761060
def ramification_degree(self, P):
12771061
"""
@@ -1298,7 +1082,3 @@ def ramification_degree(self, P):
12981082
GaloisGroup_v2.Element = GaloisGroupElement
12991083
GaloisGroup_v2.Subgroup = GaloisGroup_subgroup
13001084
GaloisGroup_subgroup.Element = GaloisGroupElement
1301-
1302-
# For unpickling purposes we rebind GaloisGroup as GaloisGroup_v1.
1303-
1304-
GaloisGroup = GaloisGroup_v1

src/sage/rings/number_field/number_field.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6217,15 +6217,12 @@ def is_abelian(self):
62176217
return pari_pol.galoisinit().galoisisabelian(1) == 1
62186218

62196219
@cached_method
6220-
def galois_group(self, type=None, algorithm='pari', names=None, gc_numbering=None):
6220+
def galois_group(self, algorithm='pari', names=None, gc_numbering=None):
62216221
r"""
62226222
Return the Galois group of the Galois closure of this number field.
62236223
62246224
INPUT:
62256225
6226-
- ``type`` -- deprecated; the different versions of Galois groups have been
6227-
merged in :issue:`28782`
6228-
62296226
- ``algorithm`` -- ``'pari'``, ``'gap'``, ``'kash'``, or ``'magma'``
62306227
(default: ``'pari'``); for degrees between 12 and 15 default is
62316228
``'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
63126309
if you want the Galois group of the absolute field
63136310
See https://github.com/sagemath/sage/issues/28782 for details.
63146311
Galois group 10T22 (S(5)[x]2) with order 240 of t^5 - t + a
6315-
6316-
TESTS:
6317-
6318-
We check that the changes in :issue:`28782` won't break code that used v1 Galois groups::
6319-
6320-
sage: # needs sage.groups
6321-
sage: G = NumberField(x^3 - 2, 'a').galois_group(type='pari')
6322-
...DeprecationWarning: the different Galois types have been merged into one class
6323-
See https://github.com/sagemath/sage/issues/28782 for details.
6324-
sage: G.group()
6325-
...DeprecationWarning: the group method is deprecated; you can use _pol_galgp if you really need it
6326-
See https://github.com/sagemath/sage/issues/28782 for details.
6327-
PARI group [6, -1, 2, "S3"] of degree 3
63286312
"""
6329-
if type is not None:
6330-
deprecation(28782, "the different Galois types have been merged into one class")
6331-
63326313
from .galois_group import GaloisGroup_v2
63336314
return GaloisGroup_v2(self, algorithm=algorithm, names=names, gc_numbering=gc_numbering, _type=type)
63346315

0 commit comments

Comments
 (0)