Skip to content

Commit ee36eb6

Browse files
committed
rename assume_distinct_deg to assume_equal_deg
1 parent 6d767c3 commit ee36eb6

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/sage/rings/finite_rings/conway_polynomials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def polynomial(self, n):
239239
# TODO: something like the following
240240
# gcds = [n.gcd(d) for d in self.nodes.keys()]
241241
# xi = { m: (...) for m in gcds }
242-
xi = {q: self.polynomial(n//q).any_root(K, n//q, assume_squarefree=True, assume_distinct_deg=True)
242+
xi = {q: self.polynomial(n//q).any_root(K, n//q, assume_squarefree=True, assume_equal_deg=True)
243243
for q in n.prime_divisors()}
244244

245245
# The following is needed to ensure that in the concrete instantiation

src/sage/rings/polynomial/polynomial_element.pyx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,7 +2284,7 @@ cdef class Polynomial(CommutativePolynomial):
22842284
raise ValueError(f"no irreducible factor of degree {degree} dividing {ext_degree} could be computed from {self}")
22852285
raise AssertionError(f"no irreducible factor could be computed from {self}")
22862286

2287-
def any_irreducible_factor(self, degree=None, assume_squarefree=False, assume_distinct_deg=False, ext_degree=None):
2287+
def any_irreducible_factor(self, degree=None, assume_squarefree=False, assume_equal_deg=False, ext_degree=None):
22882288
"""
22892289
Return an irreducible factor of this polynomial.
22902290
@@ -2300,7 +2300,7 @@ cdef class Polynomial(CommutativePolynomial):
23002300
Used for polynomials over finite fields. If ``True``,
23012301
this polynomial is assumed to be squarefree.
23022302
2303-
- ``assume_distinct_deg`` (boolean) -- (default: ``False``).
2303+
- ``assume_equal_deg`` (boolean) -- (default: ``False``).
23042304
Used for polynomials over finite fields. If ``True``,
23052305
this polynomial is assumed to be the product of irreducible
23062306
polynomials of degree equal to ``degree``.
@@ -2360,9 +2360,9 @@ cdef class Polynomial(CommutativePolynomial):
23602360
sage: F = GF(163)
23612361
sage: R.<x> = F[]
23622362
sage: h = (x + 57) * (x + 98) * (x + 117) * (x + 145)
2363-
sage: h.any_irreducible_factor(degree=1, assume_distinct_deg=True) # random
2363+
sage: h.any_irreducible_factor(degree=1, assume_equal_deg=True) # random
23642364
x + 98
2365-
sage: h.any_irreducible_factor(assume_distinct_deg=True)
2365+
sage: h.any_irreducible_factor(assume_equal_deg=True)
23662366
Traceback (most recent call last):
23672367
...
23682368
ValueError: degree must be known if distinct degree factorisation is assumed
@@ -2391,7 +2391,7 @@ cdef class Polynomial(CommutativePolynomial):
23912391
if degree < 1:
23922392
raise ValueError(f"{degree = } must be positive")
23932393

2394-
if assume_distinct_deg and degree is None:
2394+
if assume_equal_deg and degree is None:
23952395
raise ValueError("degree must be known if distinct degree factorisation is assumed")
23962396

23972397
# When not working over a finite field, do the simple thing of factoring.
@@ -2429,7 +2429,7 @@ cdef class Polynomial(CommutativePolynomial):
24292429

24302430
# If we know the polynomial is square-free, we can start here
24312431
if assume_squarefree:
2432-
if assume_distinct_deg:
2432+
if assume_equal_deg:
24332433
return self._cantor_zassenhaus_split_to_irreducible(degree)
24342434
return self._any_irreducible_factor_squarefree(degree, ext_degree)
24352435

@@ -2452,7 +2452,7 @@ cdef class Polynomial(CommutativePolynomial):
24522452
# But if any degree is allowed then there should certainly be a factor if self has degree > 0
24532453
raise AssertionError(f"no irreducible factor was computed for {self}. Bug.")
24542454

2455-
def any_root(self, ring=None, degree=None, assume_squarefree=False, assume_distinct_deg=False):
2455+
def any_root(self, ring=None, degree=None, assume_squarefree=False, assume_equal_deg=False):
24562456
"""
24572457
Return a root of this polynomial in the given ring.
24582458
@@ -2472,14 +2472,14 @@ cdef class Polynomial(CommutativePolynomial):
24722472
finite fields. If ``True``, this polynomial is assumed to be
24732473
squarefree.
24742474
2475-
- ``assume_distinct_deg`` (bool) -- Used for polynomials over
2475+
- ``assume_equal_deg`` (bool) -- Used for polynomials over
24762476
finite fields. If ``True``, all factors of this polynomial
24772477
are assumed to have degree ``degree``.
24782478
24792479
.. WARNING::
24802480
24812481
Negative degree input will be deprecated. Instead use
2482-
``assume_distinct_deg``.
2482+
``assume_equal_deg``.
24832483
24842484
EXAMPLES::
24852485
@@ -2656,9 +2656,9 @@ cdef class Polynomial(CommutativePolynomial):
26562656
degree = ZZ(degree)
26572657
if degree < 0:
26582658
from sage.misc.superseded import deprecation
2659-
deprecation(37170, "negative ``degree`` will be disallowed. Instead use the bool `assume_distinct_deg`.")
2659+
deprecation(37170, "negative ``degree`` will be disallowed. Instead use the bool `assume_equal_deg`.")
26602660
degree = -degree
2661-
assume_distinct_deg = True
2661+
assume_equal_deg = True
26622662

26632663
# If a certain degree is requested, then we find an irreducible factor of degree `degree`
26642664
# use this to compute a field extension and return the generator as root of this polynomial
@@ -2667,7 +2667,7 @@ cdef class Polynomial(CommutativePolynomial):
26672667
try:
26682668
f = self.any_irreducible_factor(degree=degree,
26692669
assume_squarefree=assume_squarefree,
2670-
assume_distinct_deg=assume_distinct_deg)
2670+
assume_equal_deg=assume_equal_deg)
26712671
except ValueError:
26722672
raise ValueError(f"no irreducible factor of degree {degree} can be computed from {self}")
26732673

src/sage/rings/polynomial/polynomial_quotient_ring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ def _isomorphic_ring(self):
20982098
base_image = self.base_ring().modulus().change_ring(isomorphic_ring).any_root()
20992099
base_to_isomorphic_ring = self.base_ring().hom([isomorphic_ring(base_image)])
21002100
modulus = self.modulus().map_coefficients(base_to_isomorphic_ring)
2101-
gen = modulus.any_root(assume_squarefree=True, degree=1, assume_distinct_deg=True)
2101+
gen = modulus.any_root(assume_squarefree=True, degree=1, assume_equal_deg=True)
21022102

21032103
homspace = Hom(self, isomorphic_ring)
21042104
to_isomorphic_ring = homspace.__make_element_class__(SetMorphism)(homspace,

src/sage/schemes/elliptic_curves/cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def is_HCP(f, check_monic_irreducible=True):
279279
continue
280280
if d < h and d not in h2list:
281281
return zero
282-
jp = r.any_root(degree=1, assume_squarefree=True, assume_distinct_deg=True)
282+
jp = r.any_root(degree=1, assume_squarefree=True, assume_equal_deg=True)
283283
E = EllipticCurve(j=jp)
284284
if E.is_supersingular():
285285
continue

0 commit comments

Comments
 (0)