Skip to content

Commit

Permalink
wrap at 80
Browse files Browse the repository at this point in the history
  • Loading branch information
grhkm21 committed Feb 23, 2024
1 parent a0d5d4a commit 9d1d0a1
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions src/sage/rings/polynomial/polynomial_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ def __init__(self, base_ring, name=None, sparse=False, implementation=None,
sage: GF(7)['x']['y'].is_finite()
False
"""
# We trust that, if category is given, it is useful and does not need to be joined
# with the default category
Expand Down Expand Up @@ -1626,8 +1625,8 @@ def karatsuba_threshold(self):

def set_karatsuba_threshold(self, Karatsuba_threshold):
"""
Changes the default threshold for this ring in the method :meth:`_mul_karatsuba`
to fall back to the schoolbook algorithm.
Changes the default threshold for this ring in the method
:meth:`_mul_karatsuba` to fall back to the schoolbook algorithm.
.. warning::
Expand Down Expand Up @@ -1948,37 +1947,43 @@ def __init__(self, base_ring, name="x", sparse=False, implementation=None,
@cached_method(key=lambda self, d, q, sign, lead: (d, q, sign, tuple([x if isinstance(x, (tuple, list)) else (x, 0) for x in lead]) if isinstance(lead, (tuple, list)) else ((lead, 0))))
def weil_polynomials(self, d, q, sign=1, lead=1):
r"""
Return all integer polynomials whose complex roots all have a specified absolute value.
Return all integer polynomials whose complex roots all have a specified
absolute value.
Such polynomials `f` satisfy a functional equation
.. MATH::
T^d f(q/T) = s q^{d/2} f(T)
where `d` is the degree of `f`, `s` is a sign and `q^{1/2}` is the absolute value
of the roots of `f`.
where `d` is the degree of `f`, `s` is a sign and `q^{1/2}` is the
absolute value of the roots of `f`.
INPUT:
- ``d`` -- integer, the degree of the polynomials
- ``q`` -- integer, the square of the complex absolute value of the roots
- ``q`` -- integer, the square of the complex absolute value of the
roots
- ``sign`` -- integer (default `1`), the sign `s` of the functional equation
- ``sign`` -- integer (default `1`), the sign `s` of the functional
equation
- ``lead`` -- integer, list of integers or list of pairs of integers (default `1`),
constraints on the leading few coefficients of the generated polynomials.
If pairs `(a, b)` of integers are given, they are treated as a constraint
of the form `\equiv a \pmod{b}`; the moduli must be in decreasing order by
divisibility, and the modulus of the leading coefficient must be 0.
- ``lead`` -- integer, list of integers or list of pairs of integers
(default `1`), constraints on the leading few coefficients of the
generated polynomials. If pairs `(a, b)` of integers are given, they
are treated as a constraint of the form `\equiv a \pmod{b}`; the
moduli must be in decreasing order by divisibility, and the modulus
of the leading coefficient must be 0.
.. SEEALSO::
More documentation and additional options are available using the iterator
More documentation and additional options are available using the
iterator
:class:`sage.rings.polynomial.weil.weil_polynomials.WeilPolynomials`
directly. In addition, polynomials have a method :meth:`is_weil_polynomial` to
test whether or not the given polynomial is a Weil polynomial.
directly. In addition, polynomials have a method
:meth:`is_weil_polynomial` to test whether or not the given
polynomial is a Weil polynomial.
EXAMPLES::
Expand Down Expand Up @@ -2013,7 +2018,8 @@ def weil_polynomials(self, d, q, sign=1, lead=1):
TESTS:
We check that products of Weil polynomials are also listed as Weil polynomials::
We check that products of Weil polynomials are also listed as Weil
polynomials::
sage: all((f * g) in R.weil_polynomials(6, q) for q in [3, 4] # needs sage.libs.flint
....: for f in R.weil_polynomials(2, q) for g in R.weil_polynomials(4, q))
Expand All @@ -2028,13 +2034,15 @@ def weil_polynomials(self, d, q, sign=1, lead=1):
....: for j in range(1, (3+i)//2 + 1))
....: for i in range(4)]) for f in simples]
Check that every polynomial in this list has 3 real roots between `-2 \sqrt{3}` and `2 \sqrt{3}`::
Check that every polynomial in this list has 3 real roots between `-2
\sqrt{3}` and `2 \sqrt{3}`::
sage: roots = [f.roots(RR, multiplicities=False) for f in reals] # needs sage.libs.flint
sage: all(len(L) == 3 and all(x^2 <= 12 for x in L) for L in roots) # needs sage.libs.flint
True
Finally, check that the original polynomials are reconstructed as CM polynomials::
Finally, check that the original polynomials are reconstructed as CM
polynomials::
sage: all(f == T^3*r(T + 3/T) for (f, r) in zip(simples, reals)) # needs sage.libs.flint
True
Expand Down Expand Up @@ -2190,7 +2198,8 @@ def _element_class():

def _ideal_class_(self, n=0):
"""
Returns the class representing ideals in univariate polynomial rings over fields.
Returns the class representing ideals in univariate polynomial rings
over fields.
EXAMPLES::
Expand Down

0 comments on commit 9d1d0a1

Please sign in to comment.