From 69c12696c0a39e19452ed9d7f9e1c1eb214e1feb Mon Sep 17 00:00:00 2001 From: Bryan Gillespie Date: Thu, 25 Jul 2019 19:14:00 -0600 Subject: [PATCH 01/30] Implement check for Lorentzian polynomials Implements methods for univariate and multivariate polynomials to check whether a polynomial is Lorentzian. A helper function checks whether a collection of integer lattice points is M-convex. Additionally extends the constructor for class QuadraticForm to accept as input a homogeneous polynomial of degree two. --- src/sage/quadratic_forms/quadratic_form.py | 60 ++++- .../rings/polynomial/multi_polynomial.pyx | 208 +++++++++++++++++- .../rings/polynomial/polynomial_element.pyx | 38 ++++ 3 files changed, 302 insertions(+), 4 deletions(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index 3b60a467c33..d450b79ec71 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -30,13 +30,16 @@ from sage.arith.all import GCD, LCM from sage.rings.all import Ideal from sage.rings.ring import is_Ring, PrincipalIdealDomain -from sage.structure.sage_object import SageObject from sage.structure.element import is_Vector from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.polynomial.polynomial_element import is_Polynomial +from sage.rings.polynomial.multi_polynomial_element import is_MPolynomial from sage.modules.free_module_element import vector from sage.quadratic_forms.genera.genus import genera from sage.quadratic_forms.quadratic_form__evaluate import QFEvaluateVector, QFEvaluateMatrix +from sage.structure.sage_object import SageObject +from sage.combinat.integer_lists.invlex import IntegerListsLex def QuadraticForm__constructor(R, n=None, entries=None): @@ -93,6 +96,10 @@ class QuadraticForm(SageObject): in `R` (given lexicographically, or equivalently, by rows of the matrix) + #. ``QuadraticForm(p)``, where + + - `p` -- a homogeneous polynomial of degree `2` + #. ``QuadraticForm(R, n)``, where - `R` -- a ring @@ -171,6 +178,16 @@ class QuadraticForm(SageObject): [ 1 5 ] [ * 4 ] + :: + + sage: P. = QQ[] + sage: p = x^2 + 2*x*y + x*z/2 + y^2 + y*z/3 + sage: QuadraticForm(p) + Quadratic form in 3 variables over Rational Field with coefficients: + [ 1 2 1/2 ] + [ * 1 1/3 ] + [ * * 0 ] + :: sage: QuadraticForm(ZZ, m + m.transpose()) @@ -383,6 +400,26 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ sage: s.dim() 4 + sage: P. = QQ[] + sage: p = x^2 + y^2 + 2*x*z + sage: QuadraticForm(p) + Quadratic form in 3 variables over Rational Field with coefficients: + [ 1 0 2 ] + [ * 1 0 ] + [ * * 0 ] + sage: z = P.zero() + sage: QuadraticForm(z) + Quadratic form in 3 variables over Rational Field with coefficients: + [ 0 0 0 ] + [ * 0 0 ] + [ * * 0 ] + sage: q = x^2 + 3*y - z + sage: QuadraticForm(q) + Traceback (most recent call last): + ... + TypeError: Polynomial is not homogeneous of degree 2 or equal to zero + + TESTS:: sage: s == loads(dumps(s)) @@ -432,12 +469,31 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ ## ----------------------------------------------------------- + ## Deal with: QuadraticForm(polynomial) + if is_Polynomial(R) or is_MPolynomial(R): + if (not R.is_homogeneous() or not R.degree() == 2) and not R.is_zero(): + raise TypeError("Polynomial is not homogeneous of degree 2 or equal to zero") + + ## Rename the polynomial and derive base ring + p = R + P = p.parent() + R, n = P.base_ring(), P.ngens() + + ## Extract quadratic form coefficients + entries = [] + exponents = IntegerListsLex(2, length=n) + for alpha in exponents: + entries.append(p.__getitem__(alpha)) + + ## ----------------------------------------------------------- + ## Verify the size of the matrix is an integer >= 0 n = ZZ(n) if n < 0: raise ValueError("the size must be a non-negative integer, not {}".format(n)) - # TODO: Verify that R is a ring... + if not isinstance(R, Ring): + raise ValueError("R must be a ring") # Store the relevant variables N = n * (n + 1) // 2 diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 181b0d17562..b461ebcbbaa 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -16,6 +16,8 @@ from sage.rings.integer cimport Integer from sage.rings.integer_ring import ZZ from sage.structure.coerce cimport coercion_model from sage.misc.derivative import multi_derivative +from sage.combinat.integer_lists.invlex import IntegerListsLex +from itertools import chain, imap, islice from sage.misc.all import prod @@ -27,7 +29,7 @@ from sage.categories.map cimport Map from sage.modules.free_module_element import vector from sage.rings.rational_field import QQ from sage.rings.complex_interval_field import ComplexIntervalField -from sage.rings.real_mpfr import RealField_class,RealField +from sage.rings.real_mpfr import RealField_class, RealField from sage.rings.polynomial.polydict cimport ETuple from sage.rings.polynomial.polynomial_element cimport Polynomial @@ -2444,7 +2446,7 @@ cdef class MPolynomial(CommutativeRingElement): True """ # EXERCISE (Atiyah-McDonald, Ch 1): Let `A[x]` be a polynomial - # ring in one variable. Then `f=\sum a_i x^i \in A[x]` is + # ring in one variable. Then `f=\sum a_i x^i \in A[x]` is # nilpotent if and only if `a_0,\ldots, a_n` are nilpotent. # (Also noted in Dummit and Foote, "Abstract Algebra", 1991, # Section 7.3 Exercise 33). @@ -2453,6 +2455,208 @@ cdef class MPolynomial(CommutativeRingElement): d = self.dict() return all(c.is_nilpotent() for c in d.values()) + def is_lorentzian_polynomial(self): + r""" + Return ``True`` if this is a Lorentzian polynomial. + + Lorentzian polynomials are a class of polynomials connected with the area + of discrete convex analysis. A polynomial `f` with positive real coefficients + is Lorentzian if: + + - `f` is homogeneous; + + - the support of `f` is `M`-convex + + - `f` has degree degree less than `2`, or if its degree is at least two, + the collection of sequential partial derivatives of `f` which are + quadratic forms have Gram matrices with at most one positive eigenvalue. + + Note in particular that the zero polynomial is Lorentzian. Examples of + Lorentzian polynomials include homogeneous stable polynomials, volume + polynomials of convex bodies and projective varieties, and Schur polynomials + after renormalizing the coefficient of each monomial `x^\alpha` by `1/\alpha!`. + + EXAMPLES: + + Renormalized Schur polynomials are Lorentzian, but not in general if the + renormalization is skipped:: + + sage: P. = QQ[] + sage: p = (x^2 / 2) + x*y + (y^2 / 2) + sage: p.is_lorentzian_polynomial() + True + sage: p = x^2 + x*y + y^2 + sage: p.is_lorentzian_polynomial() + False + + Homogeneous linear forms and constant polynomials with positive + coefficients are Lorentzian, as well as the zero polynomial:: + + sage: p = x + 2*y + sage: p.is_lorentzian_polynomial() + True + sage: p = P(5) + sage: p.is_lorentzian_polynomial() + True + sage: P.zero().is_lorentzian_polynomial() + True + + Inhomogeneous polynomials and polynomials with negative coefficients + are not Lorentzian:: + + sage: p = x^2 + 2*x + y^2 + sage: p.is_lorentzian_polynomial() + False + sage: p = 2*x^2 - y^2 + sage: p.is_lorentzian_polynomial() + False + + It is an error to check if a polynomial is Lorentzian if its base ring + is not a subring of the real numbers, as the notion is not defined in + this case:: + + sage: Q. = CC[] + sage: q = z^2 + w^2 + sage: q.is_lorentzian_polynomial() + Traceback (most recent call last): + ... + TypeError: Lorentzian polynomials must have real coefficients + """ + if not self.base_ring().is_subring(RealField()): + raise TypeError("Lorentzian polynomials must have real coefficients") + # zero is Lorentzian + if self.is_zero(): + return True + # check homogeneous + if not self.is_homogeneous(): + return False + # check nonnegative coefficients + for coeff in self.coefficients(): + if coeff < 0: + return False + # for degree <= 1, homogeneous with positive coefficients is sufficient + if self.degree() <= 1: + return True + # check support is M-convex + if not _is_M_convex_(self.exponents(), check_input=False): + return False + # compute quadratic forms coming from a sequence of partial derivatives + if self.degree() == 2: + # print("Degree == 2") + quadratic_derivs = set([self]) + else: + # print("Degree > 2") + gens = self.parent().gens() + quadratic_derivs = set() + multi_exponents = IntegerListsLex(self.degree() - 2, length=len(gens)) + for alpha in multi_exponents: + # print("Multiexponent:", alpha) + # construct list [gen_1, exp_1, ..., gen_n, exp_n] for derivative function + d_list = chain(*zip(gens, alpha)) + d = self.derivative(*d_list) + if d not in quadratic_derivs: + quadratic_derivs |= set([d]) + # check derivative quadratic forms have at most one positive eigenvalue + for deriv in quadratic_derivs: + from sage.quadratic_forms.quadratic_form import QuadraticForm + G = QuadraticForm(deriv).Gram_matrix() + spectrum = sorted(G.eigenvalues(), reverse=True) + if spectrum[1] > 0: + return False + return True + +def _is_M_convex_(points, check_input=True): + r""" + Return ``True`` if ``points`` represents a set of integer lattice points + which are M-convex, and ``False`` otherwise. + + Utility function for method ``is_lorentzian_polynomial``, which would more properly + fit with code related to discrete convex geometry, generalized permutahedra, + or polymatroids, which are not currently implemented in Sage. + + INPUT: + + - ``points`` -- iterable for a list of integer lattice points of the + same dimension. + + - ``check_input`` -- boolean (default: ``True``); if ``True``, checks that + ``points`` contains lists of integers of the same length. Specify ``False`` + to skip this check if the data format is known to be correct. + + Examples of M-convex sets include the vertices of a matroid polytope, and the + support sets of Schur polynomials. + + EXAMPLES: + + The following points represent the vertices of a matroid polytope (indicator + vectors of the bases) of rank `2` on five elements:: + + sage: from sage.rings.polynomial.multi_polynomial import _is_M_convex_ + sage: P = [[1,1,0,0], [1,0,1,0], [0,1,1,0], [0,1,0,1], [0,0,1,1]] + sage: _is_M_convex_(P) + True + + These points are the support of the Schur polynomial in three variables for + the partition `(2,2)`:: + + sage: P = [[2,2,0], [2,0,2], [0,2,2], [2,1,1], [1,2,1], [1,1,2]] + sage: _is_M_convex_(P) + True + + The following are not examples of `M`-convex sets of points:: + + sage: P = [[1, 0, 0], [1, 1, 0], [1, 1, 1]] + sage: _is_M_convex_(P) + False + + sage: P = [[0, 1, 2], [2, 1]] + sage: _is_M_convex_(P) + Traceback (most recent call last): + ... + ValueError: Input points are not the same dimension + + sage: P = [[0, 0.5, 1], [1, 1.5, 2]] + sage: _is_M_convex_(P) + Traceback (most recent call last): + ... + ValueError: Input points are not integer lattice points + """ + points_set = set(imap(tuple, points)) + n_points = len(points_set) + if n_points == 0: + return True + elt = list(islice(points_set, 0, 1))[0] + dim = len(elt) + if check_input: + for p in points_set: + if len(p) != dim: + raise ValueError("Input points are not the same dimension") + for entry in p: + if entry not in ZZ: + raise ValueError("Input points are not integer lattice points") + for p1 in points_set: + list_p1 = list(p1) + for p2 in points_set: + if p2 == p1: + continue + delta = list(x2 - x1 for x1, x2 in zip(p1, p2)) + for i in xrange(dim): + if p2[i] > p1[i]: + # modify list_p1 to represent point p1 + e_i - e_j for various i, j + list_p1[i] += 1 # add e_i + # check exchange condition is satisfied by some index j + for j in xrange(dim): + if p2[j] < p1[j]: + list_p1[j] -= 1 # subtract e_j + exch = tuple(list_p1) # p1 + e_i - e_j + list_p1[j] += 1 # add e_j again + if tuple(exch) in points_set: + break + else: + return False + list_p1[i] -= 1 # subtract e_i + # list_p1 should now have same entries as p1 again + return True cdef remove_from_tuple(e, int ind): w = list(e) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index e55164f56ab..c08515b3e43 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8210,6 +8210,44 @@ cdef class Polynomial(CommutativeAlgebraElement): else: return b + def is_lorentzian_polynomial(self): + r""" + Return ``True`` if this is a Lorentzian polynomial. + + A univariate real polynomial is Lorentzian if and only if it is a + monomial with positive coefficient, or zero. The definition is more + involved for multivariate real polynomials. + + EXAMPLES: + + sage: P. = QQ[] + sage: p1 = x^2 + sage: p1.is_lorentzian_polynomial() + True + sage: p2 = 1 + x^2 + sage: p2.is_lorentzian_polynomial() + False + sage: p3 = P.zero() + sage: p3.is_lorentzian_polynomial() + True + sage: p4 = -2*x^3 + sage: p4.is_lorentzian_polynomial() + False + + It is an error to check if a polynomial is Lorentzian if its base ring + is not a subring of the real numbers, as the notion is not defined in + this case:: + + sage: Q. = CC[] + sage: q = y^2 + sage: q.is_lorentzian_polynomial() + Traceback (most recent call last): + ... + TypeError: Lorentzian polynomials must have real coefficients + """ + if not self.base_ring().is_subring(RealField()): + raise TypeError("Lorentzian polynomials must have real coefficients") + return self.is_zero() or (self.is_homogeneous() and self.coefficients()[0] > 0) def variable_name(self): """ From 6f278eb5a08195f77aed9c2f025e54b922ba5a9d Mon Sep 17 00:00:00 2001 From: Bryan Gillespie Date: Fri, 26 Jul 2019 12:34:38 -0600 Subject: [PATCH 02/30] Add references, and a new parameter for is_lorentzian_polynomial method Added literature references to the doctests, and added a new flag to the is_lorentzian_polynomial method, give_reason, which causes the method to return a tuple containing the boolean output of the function, and if this is false, a string explaining why the polynomial is not Lorentzian. --- src/doc/en/reference/references/index.rst | 9 +++- .../rings/polynomial/multi_polynomial.pyx | 47 +++++++++++++++---- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 478171842e8..945f3f97025 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -578,6 +578,9 @@ REFERENCES: Stein. strassen_window_multiply_c. strassen.pyx, Sage 3.0, 2008. http://www.sagemath.org +.. [BrHu2019] Petter Br{\"a}nd{\'e}n, June Huh. *Lorentzian polynomials*. + Preprint (2019). :arxiv:`1902.03719` + .. [BHNR2004] \S. Brlek, S. Hamel, M. Nivat, C. Reutenauer, On the Palindromic Complexity of Infinite Words, in J. Berstel, J. Karhumaki, D. Perrin, Eds, @@ -2253,6 +2256,10 @@ REFERENCES: J. Combinatorial Theory Ser. A. (1972). http://www.sciencedirect.com/science/article/pii/0097316572900039 . +.. [HMMS2019] June Huh, Jacob P.\ Matherne, Karola M{\'e}sz{\'a}ros, Avery + St.\ Dizier. *Logarithmic concavity of Schur and related + polynomials*. Preprint (2019). :arxiv:`1906.09633` + .. [Hutz2007] \B. Hutz. Arithmetic Dynamics on Varieties of dimension greater than one. PhD Thesis, Brown University 2007 @@ -2555,7 +2562,7 @@ REFERENCES: Compositio Mathematica, **149** (2013), no. 10. :arxiv:`1111.3660`. -.. [Kly1990] Klyachko, Aleksandr Anatolevich. +.. [Kly1990] Klyachko, Aleksandr Anatolevich. Equivariant Bundles on Toral Varieties, Math USSR Izv. 35 (1990), 337-375. http://iopscience.iop.org/0025-5726/35/2/A04/pdf/0025-5726_35_2_A04.pdf diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index b461ebcbbaa..767cf880037 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2455,10 +2455,17 @@ cdef class MPolynomial(CommutativeRingElement): d = self.dict() return all(c.is_nilpotent() for c in d.values()) - def is_lorentzian_polynomial(self): + def is_lorentzian_polynomial(self, give_reason=False): r""" Return ``True`` if this is a Lorentzian polynomial. + INPUTS: + + - ``give_failure_reason`` -- boolean (default: ``False``); if ``True`` + return a tuple whose first element is the boolean result of the test, + and the second element is a string describing the reason the test failed, + or ``None`` if the test succeeded. + Lorentzian polynomials are a class of polynomials connected with the area of discrete convex analysis. A polynomial `f` with positive real coefficients is Lorentzian if: @@ -2467,7 +2474,7 @@ cdef class MPolynomial(CommutativeRingElement): - the support of `f` is `M`-convex - - `f` has degree degree less than `2`, or if its degree is at least two, + - `f` has degree less than `2`, or if its degree is at least two, the collection of sequential partial derivatives of `f` which are quadratic forms have Gram matrices with at most one positive eigenvalue. @@ -2521,25 +2528,43 @@ cdef class MPolynomial(CommutativeRingElement): Traceback (most recent call last): ... TypeError: Lorentzian polynomials must have real coefficients + + The method can give a reason for a polynomial failing to be Lorentzian:: + + sage: p = x^2 + 2*x + y^2 + sage: p.is_lorentzian_polynomial(give_reason=True) + (False, 'inhomogeneous') + + REFERENCES: + + For full definitions and related discussion, see [BrHu2019] and + [HMMS2019]. The second reference gives the characterization of + Lorentzian polynomials applied in this implementation explicitly. """ + # function to handle return value when reason requested + def result(val, explanation=None): + if give_reason: + return (val, explanation) + else: + return val if not self.base_ring().is_subring(RealField()): raise TypeError("Lorentzian polynomials must have real coefficients") # zero is Lorentzian if self.is_zero(): - return True + return result(True) # check homogeneous if not self.is_homogeneous(): - return False + return result(False, "inhomogeneous") # check nonnegative coefficients for coeff in self.coefficients(): if coeff < 0: - return False + return result(False, "negative coefficient") # for degree <= 1, homogeneous with positive coefficients is sufficient if self.degree() <= 1: - return True + return result(True) # check support is M-convex if not _is_M_convex_(self.exponents(), check_input=False): - return False + return result(False, "not M-convex") # compute quadratic forms coming from a sequence of partial derivatives if self.degree() == 2: # print("Degree == 2") @@ -2562,8 +2587,8 @@ cdef class MPolynomial(CommutativeRingElement): G = QuadraticForm(deriv).Gram_matrix() spectrum = sorted(G.eigenvalues(), reverse=True) if spectrum[1] > 0: - return False - return True + return result(False, "multiple positive eigenvalues") + return result(True) def _is_M_convex_(points, check_input=True): r""" @@ -2620,6 +2645,10 @@ def _is_M_convex_(points, check_input=True): Traceback (most recent call last): ... ValueError: Input points are not integer lattice points + + REFERENCES: + + See [BrHu2019] for a definition of M-convexity. """ points_set = set(imap(tuple, points)) n_points = len(points_set) From e2830132a9e935b576511b84d585bfe0ba193109 Mon Sep 17 00:00:00 2001 From: Bryan Gillespie Date: Fri, 26 Jul 2019 12:49:56 -0600 Subject: [PATCH 03/30] Add refs and new parameter to univariate is_lorentzian_polynomial --- .../rings/polynomial/polynomial_element.pyx | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index c08515b3e43..8847c580223 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8210,7 +8210,7 @@ cdef class Polynomial(CommutativeAlgebraElement): else: return b - def is_lorentzian_polynomial(self): + def is_lorentzian_polynomial(self, give_reason=False): r""" Return ``True`` if this is a Lorentzian polynomial. @@ -8244,10 +8244,33 @@ cdef class Polynomial(CommutativeAlgebraElement): Traceback (most recent call last): ... TypeError: Lorentzian polynomials must have real coefficients + + The method can give a reason for a polynomial failing to be Lorentzian:: + + sage: p = x^2 + 2*x + sage: p.is_lorentzian_polynomial(give_reason=True) + (False, 'inhomogeneous') + + REFERENCES: + + For full definitions and related discussion, see [BrHu2019] and + [HMMS2019]. """ + def result(val, explanation=None): + if give_reason: + return (val, explanation) + else: + return val if not self.base_ring().is_subring(RealField()): raise TypeError("Lorentzian polynomials must have real coefficients") - return self.is_zero() or (self.is_homogeneous() and self.coefficients()[0] > 0) + if self.is_zero(): + return result(True) + elif not self.is_homogeneous(): + return result(False, "inhomogeneous") + elif not self.coefficients()[0] > 0: + return result(False, "negative coefficient") + else: + return result(True) def variable_name(self): """ From 1a8cb00aa0f1f3a8a2bea0978446b97c776b1892 Mon Sep 17 00:00:00 2001 From: Bryan Gillespie Date: Fri, 26 Jul 2019 13:06:39 -0600 Subject: [PATCH 04/30] Small change of notation, and corresponding update for docs --- src/sage/rings/polynomial/multi_polynomial.pyx | 8 ++++---- src/sage/rings/polynomial/polynomial_element.pyx | 13 ++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 767cf880037..1a8219cca4a 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2455,13 +2455,13 @@ cdef class MPolynomial(CommutativeRingElement): d = self.dict() return all(c.is_nilpotent() for c in d.values()) - def is_lorentzian_polynomial(self, give_reason=False): + def is_lorentzian_polynomial(self, explain=False): r""" Return ``True`` if this is a Lorentzian polynomial. INPUTS: - - ``give_failure_reason`` -- boolean (default: ``False``); if ``True`` + - ``explain`` -- boolean (default: ``False``); if ``True`` return a tuple whose first element is the boolean result of the test, and the second element is a string describing the reason the test failed, or ``None`` if the test succeeded. @@ -2532,7 +2532,7 @@ cdef class MPolynomial(CommutativeRingElement): The method can give a reason for a polynomial failing to be Lorentzian:: sage: p = x^2 + 2*x + y^2 - sage: p.is_lorentzian_polynomial(give_reason=True) + sage: p.is_lorentzian_polynomial(explain=True) (False, 'inhomogeneous') REFERENCES: @@ -2543,7 +2543,7 @@ cdef class MPolynomial(CommutativeRingElement): """ # function to handle return value when reason requested def result(val, explanation=None): - if give_reason: + if explain: return (val, explanation) else: return val diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 8847c580223..d2c5a894503 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8210,7 +8210,7 @@ cdef class Polynomial(CommutativeAlgebraElement): else: return b - def is_lorentzian_polynomial(self, give_reason=False): + def is_lorentzian_polynomial(self, explain=False): r""" Return ``True`` if this is a Lorentzian polynomial. @@ -8218,6 +8218,13 @@ cdef class Polynomial(CommutativeAlgebraElement): monomial with positive coefficient, or zero. The definition is more involved for multivariate real polynomials. + INPUTS: + + - ``explain`` -- boolean (default: ``False``); if ``True`` + return a tuple whose first element is the boolean result of the test, + and the second element is a string describing the reason the test failed, + or ``None`` if the test succeeded. + EXAMPLES: sage: P. = QQ[] @@ -8248,7 +8255,7 @@ cdef class Polynomial(CommutativeAlgebraElement): The method can give a reason for a polynomial failing to be Lorentzian:: sage: p = x^2 + 2*x - sage: p.is_lorentzian_polynomial(give_reason=True) + sage: p.is_lorentzian_polynomial(explain=True) (False, 'inhomogeneous') REFERENCES: @@ -8257,7 +8264,7 @@ cdef class Polynomial(CommutativeAlgebraElement): [HMMS2019]. """ def result(val, explanation=None): - if give_reason: + if explain: return (val, explanation) else: return val From da0ef360cc9746d394bfc0f2e3394265fdb4af54 Mon Sep 17 00:00:00 2001 From: Bryan Gillespie Date: Thu, 14 May 2020 16:21:58 -0600 Subject: [PATCH 05/30] Fix formatting in docstrings and reference file --- src/doc/en/reference/references/index.rst | 6 +++--- src/sage/rings/polynomial/multi_polynomial.pyx | 8 ++++---- src/sage/rings/polynomial/polynomial_element.pyx | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 053b62eadf7..41d3dd7e481 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -707,7 +707,7 @@ REFERENCES: Stein. strassen_window_multiply_c. strassen.pyx, Sage 3.0, 2008. http://www.sagemath.org -.. [BrHu2019] Petter Br{\"a}nd{\'e}n, June Huh. *Lorentzian polynomials*. +.. [BrHu2019] Petter Brändén, June Huh. *Lorentzian polynomials*. Preprint (2019). :arxiv:`1902.03719` .. [BHNR2004] \S. Brlek, S. Hamel, M. Nivat, C. Reutenauer, On the @@ -2781,8 +2781,8 @@ REFERENCES: Designs, Codes and Cryptography 8 (1996) 145-157. :doi:`10.1023/A:1018037025910`. -.. [HMMS2019] June Huh, Jacob P.\ Matherne, Karola M{\'e}sz{\'a}ros, Avery - St.\ Dizier. *Logarithmic concavity of Schur and related +.. [HMMS2019] June Huh, Jacob P. Matherne, Karola Mészáros, Avery + St. Dizier. *Logarithmic concavity of Schur and related polynomials*. Preprint (2019). :arxiv:`1906.09633` .. [Hutz2007] \B. Hutz. Arithmetic Dynamics on Varieties of dimension greater diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index c1e1ab00112..fc9dc4f5af3 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2457,7 +2457,7 @@ cdef class MPolynomial(CommutativeRingElement): r""" Return ``True`` if this is a Lorentzian polynomial. - INPUTS: + INPUT: - ``explain`` -- boolean (default: ``False``); if ``True`` return a tuple whose first element is the boolean result of the test, @@ -2535,8 +2535,8 @@ cdef class MPolynomial(CommutativeRingElement): REFERENCES: - For full definitions and related discussion, see [BrHu2019] and - [HMMS2019]. The second reference gives the characterization of + For full definitions and related discussion, see [BrHu2019]_ and + [HMMS2019]_. The second reference gives the characterization of Lorentzian polynomials applied in this implementation explicitly. """ # function to handle return value when reason requested @@ -2646,7 +2646,7 @@ def _is_M_convex_(points, check_input=True): REFERENCES: - See [BrHu2019] for a definition of M-convexity. + See [BrHu2019]_ for a definition of M-convexity. """ points_set = set(map(tuple, points)) n_points = len(points_set) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index b0916ec8f9b..1519bd369cb 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -28,7 +28,7 @@ AUTHORS: - David Zureick-Brown (2017-09): Added is_weil_polynomial. -- Sebastian Oehms (2018-10): made :meth:`roots` and :meth:`factor` work over more +- Sebastian Oehms (2018-10): made :meth:`roots` and :meth:`factor` work over more cases of proper integral domains (see :trac:`26421`) TESTS:: @@ -4404,14 +4404,14 @@ cdef class Polynomial(CommutativeAlgebraElement): try: F = R.fraction_field() PF = F[self.variable_name()] - pol_frac = PF(self) + pol_frac = PF(self) pol_frac_fact = pol_frac.factor(**kwargs) if R(pol_frac_fact.unit()).is_unit(): # Note: :meth:`base_change` may convert the unit to a non unit return pol_frac_fact.base_change(self.parent()) except (TypeError, AttributeError, NotImplementedError): raise NotImplementedError - + raise NotImplementedError return self._factor_pari_helper(G, n) @@ -8369,14 +8369,14 @@ cdef class Polynomial(CommutativeAlgebraElement): monomial with positive coefficient, or zero. The definition is more involved for multivariate real polynomials. - INPUTS: + INPUT: - ``explain`` -- boolean (default: ``False``); if ``True`` return a tuple whose first element is the boolean result of the test, and the second element is a string describing the reason the test failed, or ``None`` if the test succeeded. - EXAMPLES: + EXAMPLES:: sage: P. = QQ[] sage: p1 = x^2 @@ -8411,8 +8411,8 @@ cdef class Polynomial(CommutativeAlgebraElement): REFERENCES: - For full definitions and related discussion, see [BrHu2019] and - [HMMS2019]. + For full definitions and related discussion, see [BrHu2019]_ and + [HMMS2019]_. """ def result(val, explanation=None): if explain: From d412a84cb70ff88967aacc10b9c69b960855d048 Mon Sep 17 00:00:00 2001 From: aritra Date: Wed, 24 Aug 2022 16:01:12 +0530 Subject: [PATCH 06/30] Cleanup implementation of is_lorentzian --- src/sage/quadratic_forms/quadratic_form.py | 30 +++---- .../rings/polynomial/multi_polynomial.pyx | 80 +++++++++---------- .../rings/polynomial/polynomial_element.pyx | 33 +++----- 3 files changed, 62 insertions(+), 81 deletions(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index 96c429cf4df..b58bfb8fe7c 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -37,7 +37,6 @@ from sage.modules.free_module_element import vector from sage.quadratic_forms.genera.genus import genera from sage.quadratic_forms.quadratic_form__evaluate import QFEvaluateVector, QFEvaluateMatrix - from sage.structure.sage_object import SageObject from sage.combinat.integer_lists.invlex import IntegerListsLex @@ -553,7 +552,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ sage: QuadraticForm(1) Traceback (most recent call last): .... - TypeError: Wrong input for QuadraticForm + TypeError: wrong input for QuadraticForm """ # Deal with: QuadraticForm(ring, matrix) matrix_init_flag = False @@ -569,27 +568,29 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ matrix_init_flag = True elif is_Matrix(R): - # Deal with: QuadraticForm(matrix) + M = R + # Test if R is symmetric and has even diagonal - if not self._is_even_symmetric_matrix_(R): + if not self._is_even_symmetric_matrix_(M): raise TypeError("the matrix is not a symmetric with even diagonal") - # Rename the matrix and ring - M = R - M_ring = R.base_ring() + M_ring = M.base_ring() matrix_init_flag = True - # Deal with: QuadraticForm(polynomial) elif is_Polynomial(R) or is_MPolynomial(R): - if (not R.is_homogeneous() or not R.degree() == 2) and not R.is_zero(): - raise TypeError("Polynomial is not homogeneous of degree 2 or equal to zero") - - ## Rename the polynomial and derive base ring p = R + + if p.is_zero(): + pass + elif p.is_homogeneous() and p.degree() == 2: + pass + else: + raise ValueError("polynomial is not homogeneous of degree 2 or equal to zero") + P = p.parent() R, n = P.base_ring(), P.ngens() - ## Extract quadratic form coefficients + # Extract quadratic form coefficients entries = [] if n == 0: exponents = [] @@ -600,9 +601,8 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ for alpha in exponents: entries.append(p[alpha]) - # Deal with: All other input is invalid else: - raise TypeError('Wrong input for QuadraticForm') + raise TypeError('wrong input for QuadraticForm') # Perform the quadratic form initialization if matrix_init_flag: diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index e74c7b9008b..93b1d0a6e90 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2576,9 +2576,9 @@ cdef class MPolynomial(CommutativeRingElement): d = self.dict() return all(c.is_nilpotent() for c in d.values()) - def is_lorentzian_polynomial(self, explain=False): + def is_lorentzian(self, explain=False): r""" - Return ``True`` if this is a Lorentzian polynomial. + Return whether this is a Lorentzian polynomial. INPUT: @@ -2611,32 +2611,32 @@ cdef class MPolynomial(CommutativeRingElement): sage: P. = QQ[] sage: p = (x^2 / 2) + x*y + (y^2 / 2) - sage: p.is_lorentzian_polynomial() + sage: p.is_lorentzian() True sage: p = x^2 + x*y + y^2 - sage: p.is_lorentzian_polynomial() + sage: p.is_lorentzian() False Homogeneous linear forms and constant polynomials with positive coefficients are Lorentzian, as well as the zero polynomial:: sage: p = x + 2*y - sage: p.is_lorentzian_polynomial() + sage: p.is_lorentzian() True sage: p = P(5) - sage: p.is_lorentzian_polynomial() + sage: p.is_lorentzian() True - sage: P.zero().is_lorentzian_polynomial() + sage: P.zero().is_lorentzian() True Inhomogeneous polynomials and polynomials with negative coefficients are not Lorentzian:: sage: p = x^2 + 2*x + y^2 - sage: p.is_lorentzian_polynomial() + sage: p.is_lorentzian() False sage: p = 2*x^2 - y^2 - sage: p.is_lorentzian_polynomial() + sage: p.is_lorentzian() False It is an error to check if a polynomial is Lorentzian if its base ring @@ -2645,7 +2645,7 @@ cdef class MPolynomial(CommutativeRingElement): sage: Q. = CC[] sage: q = z^2 + w^2 - sage: q.is_lorentzian_polynomial() + sage: q.is_lorentzian() Traceback (most recent call last): ... TypeError: Lorentzian polynomials must have real coefficients @@ -2653,7 +2653,7 @@ cdef class MPolynomial(CommutativeRingElement): The method can give a reason for a polynomial failing to be Lorentzian:: sage: p = x^2 + 2*x + y^2 - sage: p.is_lorentzian_polynomial(explain=True) + sage: p.is_lorentzian(explain=True) (False, 'inhomogeneous') REFERENCES: @@ -2668,40 +2668,40 @@ cdef class MPolynomial(CommutativeRingElement): return (val, explanation) else: return val + if not self.base_ring().is_subring(RealField()): - raise TypeError("Lorentzian polynomials must have real coefficients") - # zero is Lorentzian + raise NotImplementedError("is_lorentzian only implemented for real polynomials") + if self.is_zero(): return result(True) - # check homogeneous + if not self.is_homogeneous(): return result(False, "inhomogeneous") - # check nonnegative coefficients - for coeff in self.coefficients(): - if coeff < 0: - return result(False, "negative coefficient") + + if any(coeff < 0 for coeff in self.coefficients()): + return result(False, "negative coefficient") + # for degree <= 1, homogeneous with positive coefficients is sufficient if self.degree() <= 1: return result(True) + # check support is M-convex - if not _is_M_convex_(self.exponents(), check_input=False): + if not _is_M_convex_(self.exponents()): return result(False, "not M-convex") + # compute quadratic forms coming from a sequence of partial derivatives if self.degree() == 2: - # print("Degree == 2") quadratic_derivs = set([self]) else: - # print("Degree > 2") gens = self.parent().gens() quadratic_derivs = set() multi_exponents = IntegerListsLex(self.degree() - 2, length=len(gens)) for alpha in multi_exponents: - # print("Multiexponent:", alpha) # construct list [gen_1, exp_1, ..., gen_n, exp_n] for derivative function d_list = chain(*zip(gens, alpha)) d = self.derivative(*d_list) - if d not in quadratic_derivs: - quadratic_derivs |= set([d]) + quadratic_derivs.add(d) + # check derivative quadratic forms have at most one positive eigenvalue for deriv in quadratic_derivs: from sage.quadratic_forms.quadratic_form import QuadraticForm @@ -2709,14 +2709,15 @@ cdef class MPolynomial(CommutativeRingElement): spectrum = sorted(G.eigenvalues(), reverse=True) if spectrum[1] > 0: return result(False, "multiple positive eigenvalues") + return result(True) -def _is_M_convex_(points, check_input=True): +def _is_M_convex_(points): r""" - Return ``True`` if ``points`` represents a set of integer lattice points - which are M-convex, and ``False`` otherwise. + Return whether ``points`` represents a set of integer lattice points + which are M-convex. - Utility function for method ``is_lorentzian_polynomial``, which would more properly + Utility function for method ``is_lorentzian``, which would more properly fit with code related to discrete convex geometry, generalized permutahedra, or polymatroids, which are not currently implemented in Sage. @@ -2725,10 +2726,6 @@ def _is_M_convex_(points, check_input=True): - ``points`` -- iterable for a list of integer lattice points of the same dimension. - - ``check_input`` -- boolean (default: ``True``); if ``True``, checks that - ``points`` contains lists of integers of the same length. Specify ``False`` - to skip this check if the data format is known to be correct. - Examples of M-convex sets include the vertices of a matroid polytope, and the support sets of Schur polynomials. @@ -2777,13 +2774,10 @@ def _is_M_convex_(points, check_input=True): return True elt = list(islice(points_set, 0, 1))[0] dim = len(elt) - if check_input: - for p in points_set: - if len(p) != dim: - raise ValueError("Input points are not the same dimension") - for entry in p: - if entry not in ZZ: - raise ValueError("Input points are not integer lattice points") + if any(len(p) != dim for p in points_set): + raise ValueError("input points are not the same dimension") + if any(entry not in ZZ for p in points_set for entry in p): + raise ValueError("input points are not integer lattice points") for p1 in points_set: list_p1 = list(p1) for p2 in points_set: @@ -2793,18 +2787,18 @@ def _is_M_convex_(points, check_input=True): for i in xrange(dim): if p2[i] > p1[i]: # modify list_p1 to represent point p1 + e_i - e_j for various i, j - list_p1[i] += 1 # add e_i + list_p1[i] += 1 # add e_i # check exchange condition is satisfied by some index j for j in xrange(dim): if p2[j] < p1[j]: - list_p1[j] -= 1 # subtract e_j + list_p1[j] -= 1 # subtract e_j exch = tuple(list_p1) # p1 + e_i - e_j - list_p1[j] += 1 # add e_j again + list_p1[j] += 1 # add e_j again if tuple(exch) in points_set: break else: return False - list_p1[i] -= 1 # subtract e_i + list_p1[i] -= 1 # subtract e_i # list_p1 should now have same entries as p1 again return True diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 3cb515f0be5..8e8cd005a82 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8849,7 +8849,7 @@ cdef class Polynomial(CommutativeAlgebraElement): else: return b - def is_lorentzian_polynomial(self, explain=False): + def is_lorentzian(self, explain=False): r""" Return ``True`` if this is a Lorentzian polynomial. @@ -8868,16 +8868,16 @@ cdef class Polynomial(CommutativeAlgebraElement): sage: P. = QQ[] sage: p1 = x^2 - sage: p1.is_lorentzian_polynomial() + sage: p1.is_lorentzian() True sage: p2 = 1 + x^2 - sage: p2.is_lorentzian_polynomial() + sage: p2.is_lorentzian() False sage: p3 = P.zero() - sage: p3.is_lorentzian_polynomial() + sage: p3.is_lorentzian() True sage: p4 = -2*x^3 - sage: p4.is_lorentzian_polynomial() + sage: p4.is_lorentzian() False It is an error to check if a polynomial is Lorentzian if its base ring @@ -8886,7 +8886,7 @@ cdef class Polynomial(CommutativeAlgebraElement): sage: Q. = CC[] sage: q = y^2 - sage: q.is_lorentzian_polynomial() + sage: q.is_lorentzian() Traceback (most recent call last): ... TypeError: Lorentzian polynomials must have real coefficients @@ -8894,7 +8894,7 @@ cdef class Polynomial(CommutativeAlgebraElement): The method can give a reason for a polynomial failing to be Lorentzian:: sage: p = x^2 + 2*x - sage: p.is_lorentzian_polynomial(explain=True) + sage: p.is_lorentzian(explain=True) (False, 'inhomogeneous') REFERENCES: @@ -8902,21 +8902,8 @@ cdef class Polynomial(CommutativeAlgebraElement): For full definitions and related discussion, see [BrHu2019]_ and [HMMS2019]_. """ - def result(val, explanation=None): - if explain: - return (val, explanation) - else: - return val - if not self.base_ring().is_subring(RealField()): - raise TypeError("Lorentzian polynomials must have real coefficients") - if self.is_zero(): - return result(True) - elif not self.is_homogeneous(): - return result(False, "inhomogeneous") - elif not self.coefficients()[0] > 0: - return result(False, "negative coefficient") - else: - return result(True) + R = PolynomialRing(self.base_ring(), 1, [self.variable_name()]) + return R(self).is_lorentzian(explain=explain) def variable_name(self): """ @@ -11402,7 +11389,7 @@ cdef class Polynomial_generic_dense(Polynomial): sage: class BrokenRational(Rational): ....: def __bool__(self): ....: raise NotImplementedError("cannot check whether number is non-zero") - ....: + ....: sage: z = BrokenRational() sage: R. = QQ[] sage: from sage.rings.polynomial.polynomial_element import Polynomial_generic_dense From 0fc397a5a68674d49e6b246d01cd5aa813cc9384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Leli=C3=A8vre?= Date: Wed, 24 Aug 2022 13:07:21 +0200 Subject: [PATCH 07/30] 28252: Add published articles references --- src/doc/en/reference/references/index.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index eac69ff2f16..784f3a12fff 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -786,7 +786,8 @@ REFERENCES: 3.0, 2008. http://www.sagemath.org .. [BrHu2019] Petter Brändén, June Huh. *Lorentzian polynomials*. - Preprint (2019). :arxiv:`1902.03719` + Ann. Math. (2) 192, No. 3, 821-891 (2020). + :arxiv:`1902.03719`, :doi:`10.4007/annals.2020.192.3.4`. .. [BHNR2004] \S. Brlek, S. Hamel, M. Nivat, C. Reutenauer, On the Palindromic Complexity of Infinite Words, @@ -3127,9 +3128,10 @@ REFERENCES: Designs, Codes and Cryptography 8 (1996) 145-157. :doi:`10.1023/A:1018037025910`. -.. [HMMS2019] June Huh, Jacob P. Matherne, Karola Mészáros, Avery - St. Dizier. *Logarithmic concavity of Schur and related - polynomials*. Preprint (2019). :arxiv:`1906.09633` +.. [HMMS2019] June Huh, Jacob P. Matherne, Karola Mészáros, Avery St. Dizier. + *Logarithmic concavity of Schur and related polynomials*. + Trans. Am. Math. Soc. 375, No. 6, 4411-4427 (2022). + :arxiv:`1906.09633`, :doi:`10.1090/tran/8606`. .. [Hutz2007] \B. Hutz. Arithmetic Dynamics on Varieties of dimension greater than one. PhD Thesis, Brown University 2007 From 2d6a762603fa110274dec66b91cc49f5b5dfed5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Leli=C3=A8vre?= Date: Wed, 24 Aug 2022 21:34:20 +0200 Subject: [PATCH 08/30] 28252: Fix one-variable multivariate case and adjust doctests --- src/sage/quadratic_forms/quadratic_form.py | 5 ++--- src/sage/rings/polynomial/multi_polynomial.pyx | 8 ++++---- src/sage/rings/polynomial/polynomial_element.pyx | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index b58bfb8fe7c..5f877dcb5f9 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -532,8 +532,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ sage: QuadraticForm(q) Traceback (most recent call last): ... - TypeError: Polynomial is not homogeneous of degree 2 or equal to zero - + ValueError: polynomial is neither zero nor homogeneous of degree 2 TESTS:: @@ -585,7 +584,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ elif p.is_homogeneous() and p.degree() == 2: pass else: - raise ValueError("polynomial is not homogeneous of degree 2 or equal to zero") + raise ValueError("polynomial is neither zero nor homogeneous of degree 2") P = p.parent() R, n = P.base_ring(), P.ngens() diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 93b1d0a6e90..f727f9276aa 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2648,7 +2648,7 @@ cdef class MPolynomial(CommutativeRingElement): sage: q.is_lorentzian() Traceback (most recent call last): ... - TypeError: Lorentzian polynomials must have real coefficients + NotImplementedError: is_lorentzian only implemented for real polynomials The method can give a reason for a polynomial failing to be Lorentzian:: @@ -2707,7 +2707,7 @@ cdef class MPolynomial(CommutativeRingElement): from sage.quadratic_forms.quadratic_form import QuadraticForm G = QuadraticForm(deriv).Gram_matrix() spectrum = sorted(G.eigenvalues(), reverse=True) - if spectrum[1] > 0: + if len(spectrum) > 1 and spectrum[1] > 0: return result(False, "multiple positive eigenvalues") return result(True) @@ -2756,13 +2756,13 @@ def _is_M_convex_(points): sage: _is_M_convex_(P) Traceback (most recent call last): ... - ValueError: Input points are not the same dimension + ValueError: input points are not the same dimension sage: P = [[0, 0.5, 1], [1, 1.5, 2]] sage: _is_M_convex_(P) Traceback (most recent call last): ... - ValueError: Input points are not integer lattice points + ValueError: input points are not integer lattice points REFERENCES: diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 8e8cd005a82..bba608f2b7a 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8889,7 +8889,7 @@ cdef class Polynomial(CommutativeAlgebraElement): sage: q.is_lorentzian() Traceback (most recent call last): ... - TypeError: Lorentzian polynomials must have real coefficients + NotImplementedError: is_lorentzian only implemented for real polynomials The method can give a reason for a polynomial failing to be Lorentzian:: From 578be46bb4bbcab0ee6efbed80a6974cc7f367e5 Mon Sep 17 00:00:00 2001 From: aritra Date: Thu, 25 Aug 2022 16:02:26 +0530 Subject: [PATCH 09/30] Fixed doctests --- src/sage/quadratic_forms/quadratic_form.py | 2 +- src/sage/rings/polynomial/multi_polynomial.pyx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index b58bfb8fe7c..fceab0dfaf4 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -532,7 +532,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ sage: QuadraticForm(q) Traceback (most recent call last): ... - TypeError: Polynomial is not homogeneous of degree 2 or equal to zero + ValueError: polynomial is not homogeneous of degree 2 or equal to zero TESTS:: diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 93b1d0a6e90..00791c445ef 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2646,10 +2646,10 @@ cdef class MPolynomial(CommutativeRingElement): sage: Q. = CC[] sage: q = z^2 + w^2 sage: q.is_lorentzian() + Traceback (most recent call last): ... - TypeError: Lorentzian polynomials must have real coefficients - + NotImplementedError: is_lorentzian only implemented for real polynomials The method can give a reason for a polynomial failing to be Lorentzian:: sage: p = x^2 + 2*x + y^2 @@ -2754,15 +2754,16 @@ def _is_M_convex_(points): sage: P = [[0, 1, 2], [2, 1]] sage: _is_M_convex_(P) + Traceback (most recent call last): ... - ValueError: Input points are not the same dimension + ValueError: input points are not the same dimension sage: P = [[0, 0.5, 1], [1, 1.5, 2]] sage: _is_M_convex_(P) Traceback (most recent call last): ... - ValueError: Input points are not integer lattice points + ValueError: input points are not integer lattice points REFERENCES: From 65ade873d47ba1f1648ceaa5c2004f58a3700d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Fri, 21 Oct 2022 10:39:51 +0200 Subject: [PATCH 10/30] fix doctests --- src/sage/quadratic_forms/quadratic_form.py | 3 +-- src/sage/rings/polynomial/multi_polynomial.pyx | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index 2515a957ab8..3fa208a715f 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -532,8 +532,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ sage: QuadraticForm(q) Traceback (most recent call last): ... - TypeError: Polynomial is not homogeneous of degree 2 or equal to zero - + TypeError: polynomial is neither zero nor homogeneous of degree 2 TESTS:: diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 0d699cc8101..aec60b9a4b3 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2647,10 +2647,9 @@ cdef class MPolynomial(CommutativeRingElement): sage: Q. = CC[] sage: q = z^2 + w^2 sage: q.is_lorentzian() - Traceback (most recent call last): ... - TypeError: Lorentzian polynomials must have real coefficients + NotImplementedError: is_lorentzian only implemented for real polynomials The method can give a reason for a polynomial failing to be Lorentzian:: @@ -2714,6 +2713,7 @@ cdef class MPolynomial(CommutativeRingElement): return result(True) + def _is_M_convex_(points): r""" Return whether ``points`` represents a set of integer lattice points @@ -2756,7 +2756,6 @@ def _is_M_convex_(points): sage: P = [[0, 1, 2], [2, 1]] sage: _is_M_convex_(P) - Traceback (most recent call last): ... ValueError: input points are not the same dimension @@ -2805,6 +2804,7 @@ def _is_M_convex_(points): # list_p1 should now have same entries as p1 again return True + cdef remove_from_tuple(e, int ind): w = list(e) del w[ind] From bb560f03dbc58cd2e8b075d72d069061bb216caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Fri, 21 Oct 2022 14:36:55 +0200 Subject: [PATCH 11/30] really fix doctests --- src/sage/quadratic_forms/quadratic_form.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index 3fa208a715f..5f877dcb5f9 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -532,7 +532,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ sage: QuadraticForm(q) Traceback (most recent call last): ... - TypeError: polynomial is neither zero nor homogeneous of degree 2 + ValueError: polynomial is neither zero nor homogeneous of degree 2 TESTS:: From d52ad2cae40b3f4dff3580bb072d794fc27ee3ff Mon Sep 17 00:00:00 2001 From: Alex Chandler Date: Sun, 29 Jan 2023 13:59:43 -0800 Subject: [PATCH 12/30] sage -fiximports src/sage/schemes --- src/sage/schemes/affine/affine_morphism.py | 2 +- src/sage/schemes/elliptic_curves/BSD.py | 6 +++-- .../schemes/elliptic_curves/cardinality.py | 5 +++- src/sage/schemes/elliptic_curves/cm.py | 18 ++++++++------- .../elliptic_curves/descent_two_isogeny.pyx | 4 ++-- .../elliptic_curves/ell_curve_isogeny.py | 2 +- src/sage/schemes/elliptic_curves/ell_field.py | 2 +- .../elliptic_curves/ell_finite_field.py | 10 ++++++-- .../schemes/elliptic_curves/ell_generic.py | 2 +- .../elliptic_curves/ell_modular_symbols.py | 5 +++- .../elliptic_curves/ell_number_field.py | 4 ++-- src/sage/schemes/elliptic_curves/ell_point.py | 8 +++++-- .../elliptic_curves/ell_rational_field.py | 22 ++++++++++-------- .../schemes/elliptic_curves/ell_tate_curve.py | 2 +- .../schemes/elliptic_curves/ell_torsion.py | 2 +- .../schemes/elliptic_curves/formal_group.py | 2 +- src/sage/schemes/elliptic_curves/gal_reps.py | 3 ++- .../elliptic_curves/gal_reps_number_field.py | 8 +++++-- src/sage/schemes/elliptic_curves/heegner.py | 23 ++++++++++++++----- src/sage/schemes/elliptic_curves/height.py | 3 ++- .../schemes/elliptic_curves/hom_velusqrt.py | 7 +++++- .../schemes/elliptic_curves/isogeny_class.py | 8 +++---- .../elliptic_curves/isogeny_small_degree.py | 2 +- .../schemes/elliptic_curves/lseries_ell.py | 3 ++- .../schemes/elliptic_curves/mod_sym_num.pyx | 2 +- .../modular_parametrization.py | 5 +++- .../schemes/elliptic_curves/padic_lseries.py | 12 ++++++++-- src/sage/schemes/elliptic_curves/padics.py | 16 ++++++------- .../schemes/elliptic_curves/period_lattice.py | 7 +++++- .../schemes/elliptic_curves/saturation.py | 2 +- src/sage/schemes/elliptic_curves/sha_tate.py | 11 ++++----- .../elliptic_curves/weierstrass_morphism.py | 3 ++- src/sage/schemes/generic/spec.py | 3 ++- .../hyperelliptic_curves/hypellfrob.pyx | 5 ++-- .../hyperelliptic_finite_field.py | 7 ++++-- .../hyperelliptic_padic_field.py | 11 +++++++-- .../jacobian_endomorphism_utils.py | 8 +++++-- .../hyperelliptic_curves/jacobian_generic.py | 3 ++- .../hyperelliptic_curves/kummer_surface.py | 2 +- .../hyperelliptic_curves/monsky_washnitzer.py | 15 ++++++++---- .../plane_conics/con_rational_field.py | 7 ++++-- .../con_rational_function_field.py | 3 ++- .../schemes/projective/proj_bdd_height.py | 4 ++-- .../schemes/projective/projective_morphism.py | 3 ++- .../schemes/projective/projective_point.py | 3 ++- src/sage/schemes/toric/library.py | 5 ++-- src/sage/schemes/toric/morphism.py | 2 +- src/sage/schemes/toric/points.py | 2 +- 48 files changed, 193 insertions(+), 101 deletions(-) diff --git a/src/sage/schemes/affine/affine_morphism.py b/src/sage/schemes/affine/affine_morphism.py index 32c2e47e494..9efef46cda3 100644 --- a/src/sage/schemes/affine/affine_morphism.py +++ b/src/sage/schemes/affine/affine_morphism.py @@ -59,7 +59,7 @@ from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute -from sage.arith.all import gcd +from sage.arith.misc import GCD as gcd from sage.rings.integer import Integer from sage.rings.finite_rings.finite_field_constructor import is_PrimeFiniteField diff --git a/src/sage/schemes/elliptic_curves/BSD.py b/src/sage/schemes/elliptic_curves/BSD.py index a9a42ebd84b..994e397a2f3 100644 --- a/src/sage/schemes/elliptic_curves/BSD.py +++ b/src/sage/schemes/elliptic_curves/BSD.py @@ -2,7 +2,9 @@ "Birch and Swinnerton-Dyer formulas" from sage.arith.misc import prime_divisors -from sage.rings.all import ZZ, Infinity, QuadraticField +from sage.rings.integer_ring import Z as ZZ +from sage.rings.infinity import Infinity +from sage.rings.number_field.number_field import QuadraticField from sage.functions.other import ceil @@ -480,7 +482,7 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5, # We do not know BSD(E,p) for even a single p, since it's # an open problem to show that L^r(E,1)/(Reg*Omega) is # rational for any curve with r >= 2. - from sage.sets.all import Primes + from sage.sets.primes import Primes BSD.primes = Primes() if return_BSD: BSD.rank = rank_lower_bd diff --git a/src/sage/schemes/elliptic_curves/cardinality.py b/src/sage/schemes/elliptic_curves/cardinality.py index cc93b9ecf74..7b86027b69e 100644 --- a/src/sage/schemes/elliptic_curves/cardinality.py +++ b/src/sage/schemes/elliptic_curves/cardinality.py @@ -21,7 +21,10 @@ # **************************************************************************** from .constructor import EllipticCurve, EllipticCurve_from_j from sage.schemes.curves.projective_curve import Hasse_bounds -from sage.rings.all import Integer, ZZ, GF, polygen +from sage.rings.integer import Integer +from sage.rings.integer_ring import Z as ZZ +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF +from sage.rings.polynomial.polynomial_ring import polygen from sage.groups.generic import order_from_bounds diff --git a/src/sage/schemes/elliptic_curves/cm.py b/src/sage/schemes/elliptic_curves/cm.py index 6d56371ce93..72910220d76 100644 --- a/src/sage/schemes/elliptic_curves/cm.py +++ b/src/sage/schemes/elliptic_curves/cm.py @@ -34,12 +34,12 @@ # **************************************************************************** from sage.interfaces.magma import magma -from sage.rings.all import (Integer, - QQ, - ZZ, - IntegerRing, - is_fundamental_discriminant, - PolynomialRing) +from sage.rings.integer import Integer +from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import IntegerRing +from sage.rings.number_field.number_field import is_fundamental_discriminant +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.misc.cachefunc import cached_function @@ -124,7 +124,8 @@ def hilbert_class_polynomial(D, algorithm=None): raise ValueError("%s is not a valid algorithm" % algorithm) from sage.quadratic_forms.binary_qf import BinaryQF_reduced_representatives - from sage.rings.all import RR, ComplexField + from sage.rings.real_mpfr import RR + from sage.rings.complex_mpfr import ComplexField from sage.functions.all import elliptic_j # get all primitive reduced quadratic forms, (necessary to exclude @@ -623,7 +624,8 @@ def is_cm_j_invariant(j, method='new'): True """ # First we check that j is an algebraic number: - from sage.rings.all import NumberFieldElement, NumberField + from sage.rings.number_field.number_field_element import NumberFieldElement + from sage.rings.number_field.number_field import NumberField if not isinstance(j, NumberFieldElement) and j not in QQ: raise NotImplementedError("is_cm_j_invariant() is only implemented for number field elements") diff --git a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx index 5a265b40c85..4550db78cbd 100644 --- a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx +++ b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx @@ -19,8 +19,8 @@ from sage.rings.integer_ring import ZZ from sage.rings.polynomial.polynomial_ring import polygen cdef object x_ZZ = polygen(ZZ) from sage.rings.polynomial.real_roots import real_roots -from sage.arith.all import prime_divisors -from sage.all import ntl +from sage.arith.misc import prime_divisors +import sage.libs.ntl.all as ntl from sage.rings.integer cimport Integer from sage.libs.gmp.mpz cimport * diff --git a/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py b/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py index fe80879bc15..0df83e26dd2 100644 --- a/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py +++ b/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py @@ -2486,7 +2486,7 @@ def __compute_omega_general(self, E, psi, psi_pr, phi, phi_pr): # thesis are wrong, the correct formulas # are coded below - from sage.arith.all import binomial + from sage.arith.misc import binomial for j in range(n - 1): psi_prpr += binomial(j+2, 2) * psi[j+2] * cur_x_pow diff --git a/src/sage/schemes/elliptic_curves/ell_field.py b/src/sage/schemes/elliptic_curves/ell_field.py index 0aef44177e5..f71d60cf0e8 100644 --- a/src/sage/schemes/elliptic_curves/ell_field.py +++ b/src/sage/schemes/elliptic_curves/ell_field.py @@ -1426,7 +1426,7 @@ def isogenies_prime_degree(self, l=None, max_l=31): raise NotImplementedError("This code could be implemented for QQbar, but has not been yet.") if l is None: - from sage.rings.all import prime_range + from sage.rings.fast_arith import prime_range L = prime_range(max_l + 1) else: try: diff --git a/src/sage/schemes/elliptic_curves/ell_finite_field.py b/src/sage/schemes/elliptic_curves/ell_finite_field.py index 419c08cf9ca..6573319bc3e 100644 --- a/src/sage/schemes/elliptic_curves/ell_finite_field.py +++ b/src/sage/schemes/elliptic_curves/ell_finite_field.py @@ -28,11 +28,17 @@ from .ell_field import EllipticCurve_field from .constructor import EllipticCurve from sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field import HyperellipticCurve_finite_field -from sage.rings.all import Integer, ZZ, PolynomialRing, GF, polygen +from sage.rings.integer import Integer +from sage.rings.integer_ring import Z as ZZ +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF +from sage.rings.polynomial.polynomial_ring import polygen from sage.rings.finite_rings.element_base import is_FiniteFieldElement import sage.groups.generic as generic from . import ell_point -from sage.arith.all import gcd, lcm, binomial +from sage.arith.misc import GCD as gcd +from sage.arith.functions import lcm +from sage.arith.misc import binomial from sage.misc.cachefunc import cached_method from sage.groups.additive_abelian.additive_abelian_wrapper import AdditiveAbelianGroupWrapper diff --git a/src/sage/schemes/elliptic_curves/ell_generic.py b/src/sage/schemes/elliptic_curves/ell_generic.py index d3ca4896b01..76768da4763 100644 --- a/src/sage/schemes/elliptic_curves/ell_generic.py +++ b/src/sage/schemes/elliptic_curves/ell_generic.py @@ -62,7 +62,7 @@ import sage.groups.additive_abelian.additive_abelian_group as groups import sage.groups.generic as generic -from sage.arith.all import lcm +from sage.arith.functions import lcm import sage.rings.all as rings from sage.misc.cachefunc import cached_method from sage.misc.fast_methods import WithEqualityById diff --git a/src/sage/schemes/elliptic_curves/ell_modular_symbols.py b/src/sage/schemes/elliptic_curves/ell_modular_symbols.py index c91a54fdc27..af294cae2fe 100644 --- a/src/sage/schemes/elliptic_curves/ell_modular_symbols.py +++ b/src/sage/schemes/elliptic_curves/ell_modular_symbols.py @@ -91,7 +91,10 @@ from sage.modular.modsym.all import ModularSymbols from sage.databases.cremona import parse_cremona_label -from sage.arith.all import next_prime, kronecker_symbol, prime_divisors, valuation +from sage.arith.misc import next_prime +from sage.arith.misc import kronecker as kronecker_symbol +from sage.arith.misc import prime_divisors +from sage.arith.misc import valuation from sage.rings.infinity import unsigned_infinity as infinity from sage.rings.integer import Integer from sage.modular.cusps import Cusps diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py index b9787c1fd6b..fcbfd185d36 100644 --- a/src/sage/schemes/elliptic_curves/ell_number_field.py +++ b/src/sage/schemes/elliptic_curves/ell_number_field.py @@ -388,7 +388,7 @@ def height_pairing_matrix(self, points=None, precision=None, normalised=True): RR = RealField() else: RR = RealField(precision) - from sage.matrix.all import MatrixSpace + from sage.matrix.matrix_space import MatrixSpace M = MatrixSpace(RR, r) mat = M() for j in range(r): @@ -3892,7 +3892,7 @@ def saturation(self, points, verbose=False, raise ValueError("points not linearly independent in saturation()") sat_reg = reg - from sage.rings.all import prime_range + from sage.rings.fast_arith import prime_range if full_saturation: if lower_ht_bound is None: # TODO (robertwb): verify this for rank > 1 diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index 23eb16a1c1a..53b83b3884f 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2836,7 +2836,9 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): 4.0000000000000000000000000000000000000000000000000000000000 """ from sage.rings.number_field.number_field import refine_embedding - from sage.all import RealField, ComplexField, Infinity + from sage.rings.real_mpfr import RealField + from sage.rings.complex_mpfr import ComplexField + from sage.rings.infinity import Infinity E = self.curve() K = E.base_ring() @@ -3257,7 +3259,9 @@ def elliptic_logarithm(self, embedding=None, precision=100, 0.70448375537782208460499649302 - 0.79246725643650979858266018068*I """ from sage.rings.number_field.number_field import refine_embedding - from sage.rings.all import RealField, ComplexField, QQ + from sage.rings.real_mpfr import RealField + from sage.rings.complex_mpfr import ComplexField + from sage.rings.rational_field import Q as QQ # Check the trivial case: diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index c2b8436f2a1..8e63a80730e 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -74,13 +74,15 @@ import sage.arith.all as arith import sage.rings.all as rings -from sage.rings.all import ( - PowerSeriesRing, - infinity as oo, - ZZ, QQ, - Integer, - IntegerRing, RealField, - ComplexField, RationalField) +from sage.rings.power_series_ring import PowerSeriesRing +from sage.rings.infinity import Infinity as oo +from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import Q as QQ +from sage.rings.integer import Integer +from sage.rings.integer_ring import IntegerRing +from sage.rings.real_mpfr import RealField +from sage.rings.complex_mpfr import ComplexField +from sage.rings.rational_field import RationalField from sage.structure.coerce import py_scalar_to_element from sage.structure.element import Element @@ -3436,7 +3438,7 @@ def Lambda(self, s, prec): sage: E.Lambda(1.4+0.5*I, 50) -0.354172680517... + 0.874518681720...*I """ - from sage.all import pi + from sage.symbolic.constants import pi s = C(s) N = self.conductor() @@ -6013,7 +6015,7 @@ def point_preprocessing(free,tor): roots.remove(e3) e1,e2 = roots - from sage.all import pi + from sage.symbolic.constants import pi e = R(1).exp() pi = R(pi) @@ -7054,7 +7056,7 @@ def elliptic_curve_congruence_graph(curves): Graph on 12 vertices """ from sage.graphs.graph import Graph - from sage.arith.all import lcm + from sage.arith.functions import lcm from sage.rings.fast_arith import prime_range from sage.misc.misc_c import prod G = Graph() diff --git a/src/sage/schemes/elliptic_curves/ell_tate_curve.py b/src/sage/schemes/elliptic_curves/ell_tate_curve.py index 22a4f0a29d0..4b7cd3e82c5 100644 --- a/src/sage/schemes/elliptic_curves/ell_tate_curve.py +++ b/src/sage/schemes/elliptic_curves/ell_tate_curve.py @@ -44,7 +44,7 @@ from sage.rings.padics.factory import Qp from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp, richcmp_method -from sage.arith.all import LCM +from sage.arith.functions import lcm as LCM from sage.modular.modform.constructor import EisensteinForms, CuspForms from sage.schemes.elliptic_curves.constructor import EllipticCurve from sage.functions.log import log diff --git a/src/sage/schemes/elliptic_curves/ell_torsion.py b/src/sage/schemes/elliptic_curves/ell_torsion.py index 3097a2ed3de..917f5e68391 100644 --- a/src/sage/schemes/elliptic_curves/ell_torsion.py +++ b/src/sage/schemes/elliptic_curves/ell_torsion.py @@ -26,7 +26,7 @@ # **************************************************************************** from sage.misc.cachefunc import cached_method -from sage.rings.all import RationalField +from sage.rings.rational_field import RationalField import sage.groups.additive_abelian.additive_abelian_wrapper as groups from sage.structure.richcmp import richcmp_method, richcmp diff --git a/src/sage/schemes/elliptic_curves/formal_group.py b/src/sage/schemes/elliptic_curves/formal_group.py index fabe827c4e5..5a8ab2e3b84 100644 --- a/src/sage/schemes/elliptic_curves/formal_group.py +++ b/src/sage/schemes/elliptic_curves/formal_group.py @@ -16,7 +16,7 @@ import sage.misc.misc as misc import sage.rings.all as rings -from sage.rings.all import O +from sage.rings.big_oh import O class EllipticCurveFormalGroup(SageObject): diff --git a/src/sage/schemes/elliptic_curves/gal_reps.py b/src/sage/schemes/elliptic_curves/gal_reps.py index 55d0ac2d352..6a7a7889b6a 100644 --- a/src/sage/schemes/elliptic_curves/gal_reps.py +++ b/src/sage/schemes/elliptic_curves/gal_reps.py @@ -121,7 +121,8 @@ import sage.misc.all as misc from sage.misc.verbose import verbose import sage.rings.all as rings -from sage.rings.all import RealField, GF +from sage.rings.real_mpfr import RealField +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from math import sqrt from sage.libs.pari.all import pari diff --git a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py index d484a4a18bd..7b58417c624 100644 --- a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py +++ b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py @@ -50,9 +50,13 @@ from sage.modules.free_module import VectorSpace from sage.rings.finite_rings.finite_field_constructor import GF from sage.misc.functional import cyclotomic_polynomial -from sage.arith.all import legendre_symbol, primes +from sage.arith.misc import legendre_symbol +from sage.arith.misc import primes from sage.sets.set import Set -from sage.rings.all import Integer, ZZ, QQ, Infinity +from sage.rings.integer import Integer +from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import Q as QQ +from sage.rings.infinity import Infinity class GaloisRepresentation(SageObject): diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index 298f44fedc6..4e2a329fc24 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -105,14 +105,25 @@ import sage.rings.number_field.number_field_element import sage.rings.number_field.number_field as number_field import sage.rings.all as rings -from sage.rings.all import (ZZ, GF, QQ, CDF, - Integers, RealField, ComplexField, QuadraticField) -from sage.arith.all import (gcd, xgcd, lcm, prime_divisors, factorial, - binomial) +from sage.rings.integer_ring import Z as ZZ +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF +from sage.rings.rational_field import Q as QQ +from sage.rings.complex_double import CDF +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers +from sage.rings.real_mpfr import RealField +from sage.rings.complex_mpfr import ComplexField +from sage.rings.number_field.number_field import QuadraticField +from sage.arith.misc import GCD as gcd +from sage.arith.misc import XGCD as xgcd +from sage.arith.functions import lcm +from sage.arith.misc import prime_divisors +from sage.arith.misc import factorial +from sage.arith.misc import binomial from sage.rings.factorint import factor_trial_division from sage.quadratic_forms.all import (BinaryQF, BinaryQF_reduced_representatives) -from sage.matrix.all import MatrixSpace, matrix +from sage.matrix.matrix_space import MatrixSpace +from sage.matrix.constructor import Matrix as matrix from sage.modular.modsym.p1list import P1List @@ -6822,7 +6833,7 @@ def heegner_index_bound(self, D=0, prec=5, max_height=None): else: H = 4*h p = 3 - from sage.all import next_prime + from sage.arith.misc import next_prime while True: c = H/(2*p**2) + B if c < max_height: diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py index 06d83bc7759..019dd555941 100644 --- a/src/sage/schemes/elliptic_curves/height.py +++ b/src/sage/schemes/elliptic_curves/height.py @@ -42,7 +42,8 @@ from sage.misc.cachefunc import cached_method from sage.misc.mrange import cartesian_product_iterator -from sage.arith.all import lcm, factorial +from sage.arith.functions import lcm +from sage.arith.misc import factorial from sage.ext.fast_callable import fast_callable from sage.functions.log import log, exp from sage.symbolic.ring import SR diff --git a/src/sage/schemes/elliptic_curves/hom_velusqrt.py b/src/sage/schemes/elliptic_curves/hom_velusqrt.py index 22ae56018a3..8fc63c4ccfb 100644 --- a/src/sage/schemes/elliptic_curves/hom_velusqrt.py +++ b/src/sage/schemes/elliptic_curves/hom_velusqrt.py @@ -1213,7 +1213,12 @@ def _random_example_for_testing(): sage: 5 <= K.order() True """ - from sage.all import prime_range, choice, randrange, GF, lcm, Mod + from sage.rings.fast_arith import prime_range + from sage.misc.prandom import choice + from sage.misc.prandom import randrange + from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF + from sage.arith.functions import lcm + from sage.rings.finite_rings.integer_mod import Mod while True: p = choice(prime_range(2, 100)) e = randrange(1,5) diff --git a/src/sage/schemes/elliptic_curves/isogeny_class.py b/src/sage/schemes/elliptic_curves/isogeny_class.py index e635c77a458..0d50a9863ef 100644 --- a/src/sage/schemes/elliptic_curves/isogeny_class.py +++ b/src/sage/schemes/elliptic_curves/isogeny_class.py @@ -770,7 +770,7 @@ def _compute(self, verbose=False): True """ from sage.schemes.elliptic_curves.ell_curve_isogeny import fill_isogeny_matrix - from sage.matrix.all import MatrixSpace + from sage.matrix.matrix_space import MatrixSpace from sage.sets.set import Set self._maps = None @@ -1055,7 +1055,7 @@ def _compute(self): [0 2 0 0 0 0] """ algorithm = self._algorithm - from sage.matrix.all import MatrixSpace + from sage.matrix.matrix_space import MatrixSpace self._maps = None if algorithm == "database": try: @@ -1183,8 +1183,8 @@ def isogeny_degrees_cm(E, verbose=False): print("CM case, discriminant = %s" % d) from sage.libs.pari.all import pari - from sage.sets.all import Set - from sage.arith.all import kronecker_symbol + from sage.sets.set import Set + from sage.arith.misc import kronecker as kronecker_symbol n = E.base_field().absolute_degree() if not E.has_rational_cm(): diff --git a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py index f5657f2cf19..65cbbc29a35 100644 --- a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py +++ b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py @@ -536,7 +536,7 @@ def _sporadic_Q_data(j): ....: g = E.division_polynomial(ell) ....: assert g % f == 0 """ - from sage.rings.all import RealField + from sage.rings.real_mpfr import RealField from sage.misc.misc_c import prod ell = sporadic_j[j] E = EllipticCurve(j=j).short_weierstrass_model() diff --git a/src/sage/schemes/elliptic_curves/lseries_ell.py b/src/sage/schemes/elliptic_curves/lseries_ell.py index 94b381a2f0c..e1506b17910 100644 --- a/src/sage/schemes/elliptic_curves/lseries_ell.py +++ b/src/sage/schemes/elliptic_curves/lseries_ell.py @@ -23,7 +23,8 @@ #***************************************************************************** from sage.structure.sage_object import SageObject -from sage.rings.all import RealField, RationalField +from sage.rings.real_mpfr import RealField +from sage.rings.rational_field import RationalField from math import sqrt, log, ceil import sage.functions.exp_integral as exp_integral from sage.misc.verbose import verbose diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index ea646b7fbe3..1902dea1c78 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -174,7 +174,7 @@ from sage.rings.integer cimport Integer from sage.misc.misc_c import prod from sage.misc.verbose import verbose -from sage.arith.all import kronecker_symbol +from sage.arith.misc import kronecker as kronecker_symbol from sage.arith.misc import euler_phi cdef extern from "": diff --git a/src/sage/schemes/elliptic_curves/modular_parametrization.py b/src/sage/schemes/elliptic_curves/modular_parametrization.py index dca43dcd191..43bb52678a7 100644 --- a/src/sage/schemes/elliptic_curves/modular_parametrization.py +++ b/src/sage/schemes/elliptic_curves/modular_parametrization.py @@ -44,7 +44,10 @@ from . import heegner -from sage.rings.all import (LaurentSeriesRing, RationalField, ComplexField, QQ) +from sage.rings.laurent_series_ring import LaurentSeriesRing +from sage.rings.rational_field import RationalField +from sage.rings.complex_mpfr import ComplexField +from sage.rings.rational_field import Q as QQ class ModularParameterization: diff --git a/src/sage/schemes/elliptic_curves/padic_lseries.py b/src/sage/schemes/elliptic_curves/padic_lseries.py index ccdc0dcc941..e7125d92dfd 100644 --- a/src/sage/schemes/elliptic_curves/padic_lseries.py +++ b/src/sage/schemes/elliptic_curves/padic_lseries.py @@ -65,10 +65,18 @@ from sage.rings.rational_field import QQ from sage.rings.padics.factory import Qp from sage.rings.infinity import infinity -from sage.rings.all import LaurentSeriesRing, PowerSeriesRing, PolynomialRing, Integers +from sage.rings.laurent_series_ring import LaurentSeriesRing +from sage.rings.power_series_ring import PowerSeriesRing +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers from sage.rings.integer import Integer -from sage.arith.all import valuation, binomial, kronecker_symbol, gcd, prime_divisors, LCM +from sage.arith.misc import valuation +from sage.arith.misc import binomial +from sage.arith.misc import kronecker as kronecker_symbol +from sage.arith.misc import GCD as gcd +from sage.arith.misc import prime_divisors +from sage.arith.functions import lcm as LCM from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp_method, richcmp diff --git a/src/sage/schemes/elliptic_curves/padics.py b/src/sage/schemes/elliptic_curves/padics.py index bf128244dfb..6ba2532fbad 100644 --- a/src/sage/schemes/elliptic_curves/padics.py +++ b/src/sage/schemes/elliptic_curves/padics.py @@ -25,14 +25,14 @@ import sage.rings.all as rings from . import padic_lseries as plseries import sage.arith.all as arith -from sage.rings.all import ( - Qp, Zp, - Integers, - Integer, - O, - PowerSeriesRing, - LaurentSeriesRing, - RationalField) +from sage.rings.padics.factory import Qp +from sage.rings.padics.factory import Zp +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers +from sage.rings.integer import Integer +from sage.rings.big_oh import O +from sage.rings.power_series_ring import PowerSeriesRing +from sage.rings.laurent_series_ring import LaurentSeriesRing +from sage.rings.rational_field import RationalField import math import sage.misc.misc as misc import sage.matrix.all as matrix diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index 7206ea74a7a..260bdda608b 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -97,7 +97,12 @@ """ from sage.modules.free_module import FreeModule_generic_pid -from sage.rings.all import ZZ, QQ, RealField, ComplexField, QQbar, AA +from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import Q as QQ +from sage.rings.real_mpfr import RealField +from sage.rings.complex_mpfr import ComplexField +from sage.rings.qqbar import QQbar +from sage.rings.qqbar import AA import sage.rings.abc from sage.rings.complex_mpfr import ComplexNumber from sage.rings.real_mpfr import RealNumber as RealNumber diff --git a/src/sage/schemes/elliptic_curves/saturation.py b/src/sage/schemes/elliptic_curves/saturation.py index 9f5b59ac404..57367c515d4 100644 --- a/src/sage/schemes/elliptic_curves/saturation.py +++ b/src/sage/schemes/elliptic_curves/saturation.py @@ -52,7 +52,7 @@ from sage.rings.finite_rings.finite_field_constructor import GF from sage.rings.integer_ring import ZZ -from sage.arith.all import kronecker_symbol as kro +from sage.arith.misc import kronecker as kro from sage.structure.sage_object import SageObject def reduce_mod_q(x,amodq): diff --git a/src/sage/schemes/elliptic_curves/sha_tate.py b/src/sage/schemes/elliptic_curves/sha_tate.py index bf8eb3e060e..f1b86b0d48f 100644 --- a/src/sage/schemes/elliptic_curves/sha_tate.py +++ b/src/sage/schemes/elliptic_curves/sha_tate.py @@ -80,12 +80,11 @@ # **************************************************************************** from sage.structure.sage_object import SageObject -from sage.rings.all import ( - Integer, - RealField, - RationalField, - RIF, - ZZ) +from sage.rings.integer import Integer +from sage.rings.real_mpfr import RealField +from sage.rings.rational_field import RationalField +from sage.rings.real_mpfi import RIF +from sage.rings.integer_ring import Z as ZZ from sage.functions.log import log from math import sqrt from sage.misc.verbose import verbose diff --git a/src/sage/schemes/elliptic_curves/weierstrass_morphism.py b/src/sage/schemes/elliptic_curves/weierstrass_morphism.py index b4f7afb1e39..2a87d2ee30b 100644 --- a/src/sage/schemes/elliptic_curves/weierstrass_morphism.py +++ b/src/sage/schemes/elliptic_curves/weierstrass_morphism.py @@ -29,7 +29,8 @@ from sage.schemes.elliptic_curves.hom import EllipticCurveHom from sage.structure.richcmp import (richcmp, richcmp_not_equal, op_EQ, op_NE) from sage.structure.sequence import Sequence -from sage.rings.all import Integer, PolynomialRing +from sage.rings.integer import Integer +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing class baseWI(): r""" diff --git a/src/sage/schemes/generic/spec.py b/src/sage/schemes/generic/spec.py index 261bb899d68..fcbda338c59 100644 --- a/src/sage/schemes/generic/spec.py +++ b/src/sage/schemes/generic/spec.py @@ -98,7 +98,8 @@ def __init__(self, base_ring=None): Spec functor from Category of commutative rings to Category of schemes over Rational Field """ - from sage.categories.all import CommutativeRings, Schemes + from sage.categories.commutative_rings import CommutativeRings + from sage.categories.schemes import Schemes if base_ring is None: domain = CommutativeRings() diff --git a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx index c08bb3cfb53..50730d1081f 100644 --- a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx +++ b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx @@ -38,8 +38,9 @@ from libcpp.vector cimport vector from sage.libs.ntl.ntl_ZZ_pContext import ZZ_pContext_factory from sage.libs.ntl.all import ZZ, ZZX from sage.matrix.constructor import Matrix -from sage.rings.all import Qp, O as big_oh -from sage.arith.all import is_prime +from sage.rings.padics.factory import Qp +from sage.rings.big_oh import O as big_oh +from sage.arith.misc import is_prime from sage.libs.ntl.ntl_ZZ_p cimport ntl_ZZ_p from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py index 7627ce2f307..9f0f5096ffc 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py @@ -48,8 +48,11 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.rings.all import ZZ, RR, QQ, GF -from sage.arith.all import binomial +from sage.rings.integer_ring import Z as ZZ +from sage.rings.real_mpfr import RR +from sage.rings.rational_field import Q as QQ +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF +from sage.arith.misc import binomial from sage.rings.power_series_ring import PowerSeriesRing from . import hyperelliptic_generic from sage.schemes.hyperelliptic_curves.hypellfrob import hypellfrob diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py index a79843c0e99..ba7ee7c8a19 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py @@ -12,8 +12,15 @@ # **************************************************************************** -from sage.rings.all import (PowerSeriesRing, PolynomialRing, ZZ, QQ, - pAdicField, GF, RR, RationalField, Infinity) +from sage.rings.power_series_ring import PowerSeriesRing +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import Q as QQ +from sage.rings.padics.factory import Qp as pAdicField +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF +from sage.rings.real_mpfr import RR +from sage.rings.rational_field import RationalField +from sage.rings.infinity import Infinity from sage.functions.log import log from sage.modules.free_module import VectorSpace from sage.matrix.constructor import matrix diff --git a/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py b/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py index e75a071657f..1f841af40aa 100644 --- a/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +++ b/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py @@ -90,10 +90,14 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.rings.all import QQ, ZZ, PolynomialRing, FiniteField, NumberField +from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import Z as ZZ +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.finite_rings.finite_field_constructor import FiniteField +from sage.rings.number_field.number_field import NumberField from sage.misc.lazy_import import lazy_import from sage.rings.fast_arith import prime_range -from sage.arith.all import gcd +from sage.arith.misc import GCD as gcd lazy_import('sage.interfaces.genus2reduction', ['genus2reduction', 'Genus2reduction']) diff --git a/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py b/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py index c7cdf99a83f..df3ecffe989 100644 --- a/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py +++ b/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py @@ -8,7 +8,8 @@ # http://www.gnu.org/licenses/ # **************************************************************************** -from sage.rings.all import Integer, QQ +from sage.rings.integer import Integer +from sage.rings.rational_field import Q as QQ from sage.misc.lazy_attribute import lazy_attribute from sage.schemes.jacobians.abstract_jacobian import Jacobian_generic from . import jacobian_homset diff --git a/src/sage/schemes/hyperelliptic_curves/kummer_surface.py b/src/sage/schemes/hyperelliptic_curves/kummer_surface.py index 987099f8d4b..dadf1200f01 100644 --- a/src/sage/schemes/hyperelliptic_curves/kummer_surface.py +++ b/src/sage/schemes/hyperelliptic_curves/kummer_surface.py @@ -12,7 +12,7 @@ from sage.schemes.projective.projective_subscheme\ import AlgebraicScheme_subscheme_projective from sage.categories.homset import Hom -from sage.categories.all import Schemes +from sage.categories.schemes import Schemes # The generic genus 2 curve in Weierstrass form: # diff --git a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py index b1f10eb1344..9947a7303de 100644 --- a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +++ b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py @@ -46,7 +46,7 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.arith.all import integer_ceil as ceil +from sage.arith.misc import integer_ceil as ceil from sage.arith.misc import binomial from sage.functions.log import log from sage.matrix.constructor import matrix @@ -58,9 +58,16 @@ from sage.modules.free_module import FreeModule from sage.modules.free_module_element import is_FreeModuleElement from sage.modules.module import Module -from sage.rings.all import (Integers, Integer, PolynomialRing, PowerSeriesRing, - Rationals, Rational, LaurentSeriesRing, QQ, ZZ, - IntegralDomain) +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers +from sage.rings.integer import Integer +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.power_series_ring import PowerSeriesRing +from sage.rings.rational_field import RationalField as Rationals +from sage.rings.rational import Rational +from sage.rings.laurent_series_ring import LaurentSeriesRing +from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import Z as ZZ +from sage.rings.ring import IntegralDomain from sage.rings.infinity import Infinity from sage.rings.laurent_series_ring import is_LaurentSeriesRing from sage.rings.padics.all import pAdicField diff --git a/src/sage/schemes/plane_conics/con_rational_field.py b/src/sage/schemes/plane_conics/con_rational_field.py index 9a75336901f..d7e65a8c40c 100644 --- a/src/sage/schemes/plane_conics/con_rational_field.py +++ b/src/sage/schemes/plane_conics/con_rational_field.py @@ -24,7 +24,9 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.rings.all import (PolynomialRing, ZZ, QQ) +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import Q as QQ import sage.rings.abc @@ -38,7 +40,8 @@ from sage.structure.element import InfinityElement -from sage.arith.all import lcm, hilbert_symbol +from sage.arith.functions import lcm +from sage.arith.misc import hilbert_symbol class ProjectiveConic_rational_field(ProjectiveConic_number_field): diff --git a/src/sage/schemes/plane_conics/con_rational_function_field.py b/src/sage/schemes/plane_conics/con_rational_function_field.py index 0d1d457f085..d90909145e3 100644 --- a/src/sage/schemes/plane_conics/con_rational_function_field.py +++ b/src/sage/schemes/plane_conics/con_rational_function_field.py @@ -42,7 +42,8 @@ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.matrix.constructor import diagonal_matrix, matrix, block_matrix from sage.schemes.plane_conics.con_field import ProjectiveConic_field -from sage.arith.all import lcm, gcd +from sage.arith.functions import lcm +from sage.arith.misc import GCD as gcd from sage.modules.free_module_element import vector from sage.rings.fraction_field import is_FractionField diff --git a/src/sage/schemes/projective/proj_bdd_height.py b/src/sage/schemes/projective/proj_bdd_height.py index 33d5ec1d3bc..94ef3f851e7 100644 --- a/src/sage/schemes/projective/proj_bdd_height.py +++ b/src/sage/schemes/projective/proj_bdd_height.py @@ -23,9 +23,9 @@ from sage.schemes.projective.projective_space import ProjectiveSpace from sage.rings.rational_field import QQ -from sage.rings.all import RealField +from sage.rings.real_mpfr import RealField from sage.rings.number_field.unit_group import UnitGroup -from sage.arith.all import gcd +from sage.arith.misc import GCD as gcd from sage.matrix.constructor import matrix, column_matrix from sage.libs.pari.all import pari from sage.modules.free_module_element import vector diff --git a/src/sage/schemes/projective/projective_morphism.py b/src/sage/schemes/projective/projective_morphism.py index c49dfbf41ca..262647fb098 100644 --- a/src/sage/schemes/projective/projective_morphism.py +++ b/src/sage/schemes/projective/projective_morphism.py @@ -62,7 +62,8 @@ # **************************************************************************** import sys -from sage.arith.all import gcd, lcm +from sage.arith.misc import GCD as gcd +from sage.arith.functions import lcm from sage.interfaces.singular import singular from sage.misc.misc_c import prod from sage.misc.cachefunc import cached_method diff --git a/src/sage/schemes/projective/projective_point.py b/src/sage/schemes/projective/projective_point.py index 0217a943d09..61195601212 100644 --- a/src/sage/schemes/projective/projective_point.py +++ b/src/sage/schemes/projective/projective_point.py @@ -40,7 +40,8 @@ from sage.rings.qqbar import number_field_elements_from_algebraics from sage.rings.quotient_ring import QuotientRing_generic from sage.rings.rational_field import QQ -from sage.arith.all import gcd, lcm +from sage.arith.misc import GCD as gcd +from sage.arith.functions import lcm from sage.misc.misc_c import prod from copy import copy diff --git a/src/sage/schemes/toric/library.py b/src/sage/schemes/toric/library.py index c8ecbf6a587..6f3617f22b6 100644 --- a/src/sage/schemes/toric/library.py +++ b/src/sage/schemes/toric/library.py @@ -40,11 +40,12 @@ from sage.structure.sage_object import SageObject -from sage.matrix.all import matrix, identity_matrix +from sage.matrix.constructor import Matrix as matrix +from sage.matrix.special import identity_matrix from sage.geometry.all import Fan, LatticePolytope, ToricLattice from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ -from sage.arith.all import gcd +from sage.arith.misc import GCD as gcd from sage.schemes.toric.variety import (DEFAULT_PREFIX, ToricVariety, normalize_names) diff --git a/src/sage/schemes/toric/morphism.py b/src/sage/schemes/toric/morphism.py index c86503bd699..d41c35c5a7b 100644 --- a/src/sage/schemes/toric/morphism.py +++ b/src/sage/schemes/toric/morphism.py @@ -370,7 +370,7 @@ from sage.structure.sequence import Sequence from sage.rings.integer_ring import ZZ -from sage.arith.all import gcd +from sage.arith.misc import GCD as gcd from sage.misc.cachefunc import cached_method from sage.matrix.constructor import matrix, identity_matrix from sage.modules.free_module_element import vector diff --git a/src/sage/schemes/toric/points.py b/src/sage/schemes/toric/points.py index 5da8f26a9c5..1815c4fa6f0 100644 --- a/src/sage/schemes/toric/points.py +++ b/src/sage/schemes/toric/points.py @@ -39,7 +39,7 @@ from sage.misc.misc_c import prod from sage.misc.cachefunc import cached_method -from sage.arith.all import gcd +from sage.arith.misc import GCD as gcd from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.parallel.decorate import Parallel From 4a7bfc169589eef4016b93eeabdc01f7165f1c31 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 29 Jan 2023 18:34:43 -0800 Subject: [PATCH 13/30] git grep -l -E ' (Q as QQ|Z as ZZ)' | xargs sed -i.bak 's/ Q as QQ/ QQ/;s/ Z as ZZ/ ZZ/;' --- src/sage/schemes/elliptic_curves/BSD.py | 2 +- src/sage/schemes/elliptic_curves/cardinality.py | 2 +- src/sage/schemes/elliptic_curves/cm.py | 4 ++-- src/sage/schemes/elliptic_curves/ell_finite_field.py | 2 +- src/sage/schemes/elliptic_curves/ell_point.py | 2 +- src/sage/schemes/elliptic_curves/ell_rational_field.py | 4 ++-- src/sage/schemes/elliptic_curves/gal_reps_number_field.py | 4 ++-- src/sage/schemes/elliptic_curves/heegner.py | 4 ++-- src/sage/schemes/elliptic_curves/modular_parametrization.py | 2 +- src/sage/schemes/elliptic_curves/period_lattice.py | 4 ++-- src/sage/schemes/elliptic_curves/sha_tate.py | 2 +- .../hyperelliptic_curves/hyperelliptic_finite_field.py | 4 ++-- .../schemes/hyperelliptic_curves/hyperelliptic_padic_field.py | 4 ++-- .../hyperelliptic_curves/jacobian_endomorphism_utils.py | 4 ++-- src/sage/schemes/hyperelliptic_curves/jacobian_generic.py | 2 +- src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py | 4 ++-- src/sage/schemes/plane_conics/con_rational_field.py | 4 ++-- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/BSD.py b/src/sage/schemes/elliptic_curves/BSD.py index 994e397a2f3..b44ef5d9c16 100644 --- a/src/sage/schemes/elliptic_curves/BSD.py +++ b/src/sage/schemes/elliptic_curves/BSD.py @@ -2,7 +2,7 @@ "Birch and Swinnerton-Dyer formulas" from sage.arith.misc import prime_divisors -from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import ZZ from sage.rings.infinity import Infinity from sage.rings.number_field.number_field import QuadraticField from sage.functions.other import ceil diff --git a/src/sage/schemes/elliptic_curves/cardinality.py b/src/sage/schemes/elliptic_curves/cardinality.py index 7b86027b69e..345b0e761d4 100644 --- a/src/sage/schemes/elliptic_curves/cardinality.py +++ b/src/sage/schemes/elliptic_curves/cardinality.py @@ -22,7 +22,7 @@ from .constructor import EllipticCurve, EllipticCurve_from_j from sage.schemes.curves.projective_curve import Hasse_bounds from sage.rings.integer import Integer -from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import ZZ from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.rings.polynomial.polynomial_ring import polygen from sage.groups.generic import order_from_bounds diff --git a/src/sage/schemes/elliptic_curves/cm.py b/src/sage/schemes/elliptic_curves/cm.py index 72910220d76..9bb1552b68e 100644 --- a/src/sage/schemes/elliptic_curves/cm.py +++ b/src/sage/schemes/elliptic_curves/cm.py @@ -35,8 +35,8 @@ from sage.interfaces.magma import magma from sage.rings.integer import Integer -from sage.rings.rational_field import Q as QQ -from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import QQ +from sage.rings.integer_ring import ZZ from sage.rings.integer_ring import IntegerRing from sage.rings.number_field.number_field import is_fundamental_discriminant from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing diff --git a/src/sage/schemes/elliptic_curves/ell_finite_field.py b/src/sage/schemes/elliptic_curves/ell_finite_field.py index 6573319bc3e..c607b460603 100644 --- a/src/sage/schemes/elliptic_curves/ell_finite_field.py +++ b/src/sage/schemes/elliptic_curves/ell_finite_field.py @@ -29,7 +29,7 @@ from .constructor import EllipticCurve from sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field import HyperellipticCurve_finite_field from sage.rings.integer import Integer -from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import ZZ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.rings.polynomial.polynomial_ring import polygen diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index 53b83b3884f..07d7a3c18be 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -3261,7 +3261,7 @@ def elliptic_logarithm(self, embedding=None, precision=100, from sage.rings.number_field.number_field import refine_embedding from sage.rings.real_mpfr import RealField from sage.rings.complex_mpfr import ComplexField - from sage.rings.rational_field import Q as QQ + from sage.rings.rational_field import QQ # Check the trivial case: diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index 8e63a80730e..f2e7c1e3573 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -76,8 +76,8 @@ import sage.rings.all as rings from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.infinity import Infinity as oo -from sage.rings.integer_ring import Z as ZZ -from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import ZZ +from sage.rings.rational_field import QQ from sage.rings.integer import Integer from sage.rings.integer_ring import IntegerRing from sage.rings.real_mpfr import RealField diff --git a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py index 7b58417c624..6919e1a992e 100644 --- a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py +++ b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py @@ -54,8 +54,8 @@ from sage.arith.misc import primes from sage.sets.set import Set from sage.rings.integer import Integer -from sage.rings.integer_ring import Z as ZZ -from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import ZZ +from sage.rings.rational_field import QQ from sage.rings.infinity import Infinity diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index 4e2a329fc24..c23e6bb5a46 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -105,9 +105,9 @@ import sage.rings.number_field.number_field_element import sage.rings.number_field.number_field as number_field import sage.rings.all as rings -from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import ZZ from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF -from sage.rings.rational_field import Q as QQ +from sage.rings.rational_field import QQ from sage.rings.complex_double import CDF from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers from sage.rings.real_mpfr import RealField diff --git a/src/sage/schemes/elliptic_curves/modular_parametrization.py b/src/sage/schemes/elliptic_curves/modular_parametrization.py index 43bb52678a7..57a90190fe5 100644 --- a/src/sage/schemes/elliptic_curves/modular_parametrization.py +++ b/src/sage/schemes/elliptic_curves/modular_parametrization.py @@ -47,7 +47,7 @@ from sage.rings.laurent_series_ring import LaurentSeriesRing from sage.rings.rational_field import RationalField from sage.rings.complex_mpfr import ComplexField -from sage.rings.rational_field import Q as QQ +from sage.rings.rational_field import QQ class ModularParameterization: diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index 260bdda608b..cc75366a917 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -97,8 +97,8 @@ """ from sage.modules.free_module import FreeModule_generic_pid -from sage.rings.integer_ring import Z as ZZ -from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import ZZ +from sage.rings.rational_field import QQ from sage.rings.real_mpfr import RealField from sage.rings.complex_mpfr import ComplexField from sage.rings.qqbar import QQbar diff --git a/src/sage/schemes/elliptic_curves/sha_tate.py b/src/sage/schemes/elliptic_curves/sha_tate.py index f1b86b0d48f..1e4fe251ff6 100644 --- a/src/sage/schemes/elliptic_curves/sha_tate.py +++ b/src/sage/schemes/elliptic_curves/sha_tate.py @@ -84,7 +84,7 @@ from sage.rings.real_mpfr import RealField from sage.rings.rational_field import RationalField from sage.rings.real_mpfi import RIF -from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import ZZ from sage.functions.log import log from math import sqrt from sage.misc.verbose import verbose diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py index 9f0f5096ffc..97d660ea2ed 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py @@ -48,9 +48,9 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.rings.integer_ring import Z as ZZ +from sage.rings.integer_ring import ZZ from sage.rings.real_mpfr import RR -from sage.rings.rational_field import Q as QQ +from sage.rings.rational_field import QQ from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.arith.misc import binomial from sage.rings.power_series_ring import PowerSeriesRing diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py index ba7ee7c8a19..030d8dab2e7 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py @@ -14,8 +14,8 @@ from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -from sage.rings.integer_ring import Z as ZZ -from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import ZZ +from sage.rings.rational_field import QQ from sage.rings.padics.factory import Qp as pAdicField from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.rings.real_mpfr import RR diff --git a/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py b/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py index 1f841af40aa..5c7c4b22c5c 100644 --- a/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +++ b/src/sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py @@ -90,8 +90,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.rings.rational_field import Q as QQ -from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import QQ +from sage.rings.integer_ring import ZZ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.finite_rings.finite_field_constructor import FiniteField from sage.rings.number_field.number_field import NumberField diff --git a/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py b/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py index df3ecffe989..21de152a878 100644 --- a/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py +++ b/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py @@ -9,7 +9,7 @@ # **************************************************************************** from sage.rings.integer import Integer -from sage.rings.rational_field import Q as QQ +from sage.rings.rational_field import QQ from sage.misc.lazy_attribute import lazy_attribute from sage.schemes.jacobians.abstract_jacobian import Jacobian_generic from . import jacobian_homset diff --git a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py index 9947a7303de..f5599b2c7ea 100644 --- a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +++ b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py @@ -65,8 +65,8 @@ from sage.rings.rational_field import RationalField as Rationals from sage.rings.rational import Rational from sage.rings.laurent_series_ring import LaurentSeriesRing -from sage.rings.rational_field import Q as QQ -from sage.rings.integer_ring import Z as ZZ +from sage.rings.rational_field import QQ +from sage.rings.integer_ring import ZZ from sage.rings.ring import IntegralDomain from sage.rings.infinity import Infinity from sage.rings.laurent_series_ring import is_LaurentSeriesRing diff --git a/src/sage/schemes/plane_conics/con_rational_field.py b/src/sage/schemes/plane_conics/con_rational_field.py index d7e65a8c40c..8e14d1e2ba7 100644 --- a/src/sage/schemes/plane_conics/con_rational_field.py +++ b/src/sage/schemes/plane_conics/con_rational_field.py @@ -25,8 +25,8 @@ # **************************************************************************** from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -from sage.rings.integer_ring import Z as ZZ -from sage.rings.rational_field import Q as QQ +from sage.rings.integer_ring import ZZ +from sage.rings.rational_field import QQ import sage.rings.abc From acf17b6cfc29e31ed8b0d84a6fdefd1891b7c2a7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 29 Jan 2023 18:50:21 -0800 Subject: [PATCH 14/30] sage.schemes: Consolidate imports from the same module --- .../elliptic_curves/ell_finite_field.py | 26 +++++------ .../elliptic_curves/ell_modular_symbols.py | 20 ++++---- .../elliptic_curves/ell_rational_field.py | 3 +- .../elliptic_curves/gal_reps_number_field.py | 13 +++--- src/sage/schemes/elliptic_curves/heegner.py | 45 ++++++++---------- .../schemes/elliptic_curves/hom_velusqrt.py | 20 ++++---- .../schemes/elliptic_curves/mod_sym_num.pyx | 12 ++--- .../schemes/elliptic_curves/padic_lseries.py | 46 +++++++++---------- src/sage/schemes/elliptic_curves/padics.py | 27 ++++++----- .../schemes/elliptic_curves/period_lattice.py | 18 ++++---- 10 files changed, 108 insertions(+), 122 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_finite_field.py b/src/sage/schemes/elliptic_curves/ell_finite_field.py index c607b460603..dc13b954ced 100644 --- a/src/sage/schemes/elliptic_curves/ell_finite_field.py +++ b/src/sage/schemes/elliptic_curves/ell_finite_field.py @@ -23,24 +23,24 @@ # https://www.gnu.org/licenses/ # **************************************************************************** +import sage.groups.generic as generic -from sage.schemes.curves.projective_curve import Hasse_bounds -from .ell_field import EllipticCurve_field -from .constructor import EllipticCurve -from sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field import HyperellipticCurve_finite_field +from sage.arith.functions import lcm +from sage.arith.misc import binomial, GCD as gcd +from sage.groups.additive_abelian.additive_abelian_wrapper import AdditiveAbelianGroupWrapper +from sage.misc.cachefunc import cached_method +from sage.rings.finite_rings.element_base import is_FiniteFieldElement +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ -from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.rings.polynomial.polynomial_ring import polygen -from sage.rings.finite_rings.element_base import is_FiniteFieldElement -import sage.groups.generic as generic +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.schemes.curves.projective_curve import Hasse_bounds +from sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field import HyperellipticCurve_finite_field + from . import ell_point -from sage.arith.misc import GCD as gcd -from sage.arith.functions import lcm -from sage.arith.misc import binomial -from sage.misc.cachefunc import cached_method -from sage.groups.additive_abelian.additive_abelian_wrapper import AdditiveAbelianGroupWrapper +from .constructor import EllipticCurve +from .ell_field import EllipticCurve_field class EllipticCurve_finite_field(EllipticCurve_field, HyperellipticCurve_finite_field): diff --git a/src/sage/schemes/elliptic_curves/ell_modular_symbols.py b/src/sage/schemes/elliptic_curves/ell_modular_symbols.py index af294cae2fe..b31f7dfe46c 100644 --- a/src/sage/schemes/elliptic_curves/ell_modular_symbols.py +++ b/src/sage/schemes/elliptic_curves/ell_modular_symbols.py @@ -87,22 +87,22 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -from sage.structure.sage_object import SageObject -from sage.modular.modsym.all import ModularSymbols +from sage.arith.misc import (kronecker as kronecker_symbol, + next_prime, + prime_divisors, + valuation) from sage.databases.cremona import parse_cremona_label - -from sage.arith.misc import next_prime -from sage.arith.misc import kronecker as kronecker_symbol -from sage.arith.misc import prime_divisors -from sage.arith.misc import valuation +from sage.misc.verbose import verbose +from sage.modular.cusps import Cusps +from sage.modular.modsym.all import ModularSymbols from sage.rings.infinity import unsigned_infinity as infinity from sage.rings.integer import Integer -from sage.modular.cusps import Cusps from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ -from sage.misc.verbose import verbose +from sage.structure.sage_object import SageObject + +from .constructor import EllipticCurve -from sage.schemes.elliptic_curves.constructor import EllipticCurve oo = Cusps(infinity) zero = Integer(0) diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index f2e7c1e3573..f1b7d937748 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -76,10 +76,9 @@ import sage.rings.all as rings from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.infinity import Infinity as oo -from sage.rings.integer_ring import ZZ +from sage.rings.integer_ring import ZZ, IntegerRing from sage.rings.rational_field import QQ from sage.rings.integer import Integer -from sage.rings.integer_ring import IntegerRing from sage.rings.real_mpfr import RealField from sage.rings.complex_mpfr import ComplexField from sage.rings.rational_field import RationalField diff --git a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py index 6919e1a992e..82127860fd3 100644 --- a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py +++ b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py @@ -45,18 +45,17 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.structure.sage_object import SageObject -from sage.rings.number_field.number_field import NumberField +from sage.arith.misc import legendre_symbol, primes +from sage.misc.functional import cyclotomic_polynomial from sage.modules.free_module import VectorSpace from sage.rings.finite_rings.finite_field_constructor import GF -from sage.misc.functional import cyclotomic_polynomial -from sage.arith.misc import legendre_symbol -from sage.arith.misc import primes -from sage.sets.set import Set +from sage.rings.infinity import Infinity from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ +from sage.rings.number_field.number_field import NumberField from sage.rings.rational_field import QQ -from sage.rings.infinity import Infinity +from sage.sets.set import Set +from sage.structure.sage_object import SageObject class GaloisRepresentation(SageObject): diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index c23e6bb5a46..f9b752f9533 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -92,41 +92,34 @@ # https://www.gnu.org/licenses/ # **************************************************************************** - -from sage.misc.misc_c import prod -from sage.misc.verbose import verbose -from sage.misc.cachefunc import cached_method - -from sage.structure.sage_object import SageObject -from sage.structure.richcmp import (richcmp_method, richcmp, - richcmp_not_equal, rich_to_bool) - import sage.rings.abc import sage.rings.number_field.number_field_element import sage.rings.number_field.number_field as number_field import sage.rings.all as rings -from sage.rings.integer_ring import ZZ -from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF -from sage.rings.rational_field import QQ + +from sage.arith.functions import lcm +from sage.arith.misc import (binomial, factorial, prime_divisors, + GCD as gcd, XGCD as xgcd) +from sage.matrix.constructor import Matrix as matrix +from sage.matrix.matrix_space import MatrixSpace +from sage.misc.cachefunc import cached_method +from sage.misc.misc_c import prod +from sage.misc.verbose import verbose +from sage.modular.modsym.p1list import P1List from sage.rings.complex_double import CDF -from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers -from sage.rings.real_mpfr import RealField from sage.rings.complex_mpfr import ComplexField -from sage.rings.number_field.number_field import QuadraticField -from sage.arith.misc import GCD as gcd -from sage.arith.misc import XGCD as xgcd -from sage.arith.functions import lcm -from sage.arith.misc import prime_divisors -from sage.arith.misc import factorial -from sage.arith.misc import binomial from sage.rings.factorint import factor_trial_division +from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers +from sage.rings.integer_ring import ZZ +from sage.rings.number_field.number_field import QuadraticField +from sage.rings.rational_field import QQ +from sage.rings.real_mpfr import RealField from sage.quadratic_forms.all import (BinaryQF, BinaryQF_reduced_representatives) -from sage.matrix.matrix_space import MatrixSpace -from sage.matrix.constructor import Matrix as matrix - -from sage.modular.modsym.p1list import P1List - +from sage.structure.sage_object import SageObject +from sage.structure.richcmp import (richcmp_method, richcmp, + richcmp_not_equal, rich_to_bool) ############################################################################### # diff --git a/src/sage/schemes/elliptic_curves/hom_velusqrt.py b/src/sage/schemes/elliptic_curves/hom_velusqrt.py index 8fc63c4ccfb..0f1101e57d2 100644 --- a/src/sage/schemes/elliptic_curves/hom_velusqrt.py +++ b/src/sage/schemes/elliptic_curves/hom_velusqrt.py @@ -122,21 +122,17 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from sage.structure.sequence import Sequence -from sage.structure.all import coercion_model as cm - from sage.misc.cachefunc import cached_method - from sage.misc.misc_c import prod from sage.rings.generic import ProductTree, prod_with_derivative - -from sage.structure.richcmp import op_EQ - from sage.rings.integer import Integer +from sage.structure.all import coercion_model as cm +from sage.structure.richcmp import op_EQ +from sage.structure.sequence import Sequence -from sage.schemes.elliptic_curves.constructor import EllipticCurve -from sage.schemes.elliptic_curves.ell_finite_field import EllipticCurve_finite_field -from sage.schemes.elliptic_curves.hom import EllipticCurveHom, compare_via_evaluation +from .constructor import EllipticCurve +from .ell_finite_field import EllipticCurve_finite_field +from .hom import EllipticCurveHom, compare_via_evaluation def _choose_IJK(n): @@ -1214,11 +1210,11 @@ def _random_example_for_testing(): True """ from sage.rings.fast_arith import prime_range - from sage.misc.prandom import choice - from sage.misc.prandom import randrange + from sage.misc.prandom import choice, randrange from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.arith.functions import lcm from sage.rings.finite_rings.integer_mod import Mod + while True: p = choice(prime_range(2, 100)) e = randrange(1,5) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index 1902dea1c78..369cd98a293 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -164,18 +164,16 @@ AUTHORS: from cysignals.memory cimport sig_malloc, sig_free, sig_realloc from cysignals.signals cimport sig_check +from sage.arith.misc import euler_phi, kronecker as kronecker_symbol from sage.misc.cachefunc import cached_method - +from sage.misc.misc_c import prod +from sage.misc.verbose import verbose from sage.rings.complex_mpfr cimport ComplexNumber from sage.rings.complex_mpfr import ComplexField -from sage.rings.real_mpfr cimport RealNumber, RealField -from sage.rings.rational cimport Rational from sage.rings.integer cimport Integer +from sage.rings.rational cimport Rational +from sage.rings.real_mpfr cimport RealNumber, RealField -from sage.misc.misc_c import prod -from sage.misc.verbose import verbose -from sage.arith.misc import kronecker as kronecker_symbol -from sage.arith.misc import euler_phi cdef extern from "": double log(double) diff --git a/src/sage/schemes/elliptic_curves/padic_lseries.py b/src/sage/schemes/elliptic_curves/padic_lseries.py index e7125d92dfd..875a4113464 100644 --- a/src/sage/schemes/elliptic_curves/padic_lseries.py +++ b/src/sage/schemes/elliptic_curves/padic_lseries.py @@ -61,35 +61,33 @@ # https://www.gnu.org/licenses/ ###################################################################### -from sage.rings.integer_ring import ZZ -from sage.rings.rational_field import QQ -from sage.rings.padics.factory import Qp -from sage.rings.infinity import infinity -from sage.rings.laurent_series_ring import LaurentSeriesRing -from sage.rings.power_series_ring import PowerSeriesRing -from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers - -from sage.rings.integer import Integer -from sage.arith.misc import valuation -from sage.arith.misc import binomial -from sage.arith.misc import kronecker as kronecker_symbol -from sage.arith.misc import GCD as gcd -from sage.arith.misc import prime_divisors -from sage.arith.functions import lcm as LCM - -from sage.structure.sage_object import SageObject -from sage.structure.richcmp import richcmp_method, richcmp - -from sage.misc.functional import denominator -from sage.misc.verbose import verbose, get_verbose - -from sage.modules.free_module_element import vector import sage.matrix.all as matrix import sage.schemes.hyperelliptic_curves.monsky_washnitzer + +from sage.arith.functions import lcm as LCM +from sage.arith.misc import (binomial, + GCD as gcd, + prime_divisors, + kronecker as kronecker_symbol, + valuation) from sage.functions.log import log from sage.functions.other import floor from sage.misc.cachefunc import cached_method +from sage.misc.functional import denominator +from sage.misc.verbose import get_verbose, verbose +from sage.modules.free_module_element import vector +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers +from sage.rings.infinity import infinity +from sage.rings.integer import Integer +from sage.rings.integer_ring import ZZ +from sage.rings.laurent_series_ring import LaurentSeriesRing +from sage.rings.padics.factory import Qp +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.power_series_ring import PowerSeriesRing +from sage.rings.rational_field import QQ +from sage.structure.richcmp import richcmp_method, richcmp +from sage.structure.sage_object import SageObject + @richcmp_method class pAdicLseries(SageObject): diff --git a/src/sage/schemes/elliptic_curves/padics.py b/src/sage/schemes/elliptic_curves/padics.py index 6ba2532fbad..a90a5090fce 100644 --- a/src/sage/schemes/elliptic_curves/padics.py +++ b/src/sage/schemes/elliptic_curves/padics.py @@ -21,25 +21,28 @@ # https://www.gnu.org/licenses/ ###################################################################### +import math -import sage.rings.all as rings -from . import padic_lseries as plseries import sage.arith.all as arith -from sage.rings.padics.factory import Qp -from sage.rings.padics.factory import Zp +import sage.matrix.all as matrix +import sage.misc.misc as misc +import sage.rings.all as rings +import sage.schemes.hyperelliptic_curves.hypellfrob +import sage.schemes.hyperelliptic_curves.monsky_washnitzer + +from sage.misc.cachefunc import cached_method +from sage.rings.big_oh import O from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers from sage.rings.integer import Integer -from sage.rings.big_oh import O -from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.laurent_series_ring import LaurentSeriesRing +from sage.rings.padics.factory import Qp, Zp +from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.rational_field import RationalField -import math -import sage.misc.misc as misc -import sage.matrix.all as matrix + +from . import padic_lseries as plseries + sqrt = math.sqrt -import sage.schemes.hyperelliptic_curves.monsky_washnitzer -import sage.schemes.hyperelliptic_curves.hypellfrob -from sage.misc.cachefunc import cached_method + def __check_padic_hypotheses(self, p): r""" diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index cc75366a917..7224988fc27 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -96,22 +96,22 @@ """ +import sage.rings.abc + +from sage.libs.pari.all import pari +from sage.misc.cachefunc import cached_method from sage.modules.free_module import FreeModule_generic_pid +from sage.rings.complex_mpfr import ComplexField +from sage.rings.complex_mpfr import ComplexNumber +from sage.rings.infinity import Infinity from sage.rings.integer_ring import ZZ +from sage.rings.number_field.number_field import refine_embedding +from sage.rings.qqbar import AA, QQbar from sage.rings.rational_field import QQ from sage.rings.real_mpfr import RealField -from sage.rings.complex_mpfr import ComplexField -from sage.rings.qqbar import QQbar -from sage.rings.qqbar import AA -import sage.rings.abc -from sage.rings.complex_mpfr import ComplexNumber from sage.rings.real_mpfr import RealNumber as RealNumber -from sage.rings.number_field.number_field import refine_embedding -from sage.rings.infinity import Infinity from sage.schemes.elliptic_curves.constructor import EllipticCurve -from sage.misc.cachefunc import cached_method from sage.structure.richcmp import richcmp_method, richcmp, richcmp_not_equal -from sage.libs.pari.all import pari class PeriodLattice(FreeModule_generic_pid): From e0174447a61d186e55e47bca5918108104daafa0 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Tue, 7 Feb 2023 07:33:41 +0100 Subject: [PATCH 15/30] alias the method weight --- src/sage/modular/quasimodform/element.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sage/modular/quasimodform/element.py b/src/sage/modular/quasimodform/element.py index 37f5b51ed7a..26a12f909ed 100644 --- a/src/sage/modular/quasimodform/element.py +++ b/src/sage/modular/quasimodform/element.py @@ -489,7 +489,8 @@ def weight(self): r""" Return the weight of the given quasimodular form. - Note that the given form must be homogeneous. + Note that the given form must be homogeneous. An alias of this method is + ``degree``. EXAMPLES:: @@ -500,6 +501,8 @@ def weight(self): 6 sage: QM(1/2).weight() 0 + sage: (QM.0).degree() + 2 sage: (QM.0 + QM.1).weight() Traceback (most recent call last): ... @@ -510,6 +513,8 @@ def weight(self): else: raise ValueError("the given graded quasiform is not an homogeneous element") + degree = weight # alias + def homogeneous_components(self): r""" Return a dictionary where the values are the homogeneous components of From b1d02c54468512eacb2c80891d6671e9ef060de9 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Tue, 7 Feb 2023 07:37:14 +0100 Subject: [PATCH 16/30] implement __getitem__ and alias --- src/sage/modular/quasimodform/element.py | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/sage/modular/quasimodform/element.py b/src/sage/modular/quasimodform/element.py index 26a12f909ed..1b7052a3cbb 100644 --- a/src/sage/modular/quasimodform/element.py +++ b/src/sage/modular/quasimodform/element.py @@ -24,6 +24,7 @@ from sage.structure.element import ModuleElement from sage.structure.richcmp import richcmp, op_NE, op_EQ +from sage.rings.integer import Integer from sage.rings.polynomial.polynomial_element import Polynomial class QuasiModularFormsElement(ModuleElement): @@ -543,6 +544,49 @@ def homogeneous_components(self): pol_hom_comp = poly_self.homogeneous_components() return {k: QM.from_polynomial(pol) for k, pol in pol_hom_comp.items()} + def __getitem__(self, weight): + r""" + Return the homogeneous component of the given quasimodular form ring + element. + + An alias of this method is ``homogeneous_component``. + + EXAMPLES:: + + sage: QM = QuasiModularForms(1) + sage: E2, E4, E6 = QM.gens() + sage: F = E2 + E4*E6 + E2^3*E6 + sage: F[2] + 1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 + O(q^6) + sage: F[10] + 1 - 264*q - 135432*q^2 - 5196576*q^3 - 69341448*q^4 - 515625264*q^5 + O(q^6) + sage: F[12] + 1 - 576*q + 21168*q^2 + 308736*q^3 - 15034608*q^4 - 39208320*q^5 + O(q^6) + sage: F[4] + 0 + sage: F.homogeneous_component(2) + 1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 + O(q^6) + + TESTS:: + + sage: F[x] + Traceback (most recent call last): + ... + KeyError: 'the weight must be an integer' + sage: F[-1] + Traceback (most recent call last): + ... + ValueError: the weight must be nonnegative + """ + if not isinstance(weight, (int, Integer)): + raise KeyError("the weight must be an integer") + if weight < 0: + raise ValueError("the weight must be nonnegative") + return self.homogeneous_components().get(weight, self.parent().zero()) + + homogeneous_component = __getitem__ # alias + + def serre_derivative(self): r""" Return the Serre derivative of the given quasimodular form. From 4d08c4d36ddb77eb412bfea674ca4b718e96f0f6 Mon Sep 17 00:00:00 2001 From: Marc Mezzarobba Date: Mon, 6 Feb 2023 10:02:55 +0100 Subject: [PATCH 17/30] qqbar.clear_denominators: crude but fast alt algo Fixes #33810. --- src/sage/rings/qqbar.py | 82 ++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 18228844684..468a7fefbb2 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -2230,30 +2230,76 @@ def clear_denominators(poly): (2, x + 3) sage: clear_denominators(x^2 + x/2 + 1/4) (2, x^2 + x + 1) - """ - # This algorithm factors the polynomial denominators. - # We should check the size of the denominators and switch to - # an alternate, less precise algorithm if we decide factoring - # would be too slow. + TESTS:: + + sage: R. = QQ[] + sage: coefficients_as_integer_ratios = [ + ....: (-2774600080567517563395913264491323241652779066919616441429094563840, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (-24216324060414384566983400245979288839929814383090701293489050615808, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (325579773864372490083706670433410006284520887405882567940047555526656, + ....: 180143564412823751787837643000565238870031999674661705128541236331583133845246252269971), + ....: (-86736048492777879473586471630941922517134071457946320753641122078523392, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (-2338058278498910195688689352766977573607428722429118859280880481590329344, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (105830270645785996318880019945503938356315302592627229453391693256551317504, + ....: 1381100660498315430373421929671000164670245330839073072652149478542137359480221267403111), + ....: (1110926147990548796149597141538460730252912439930561079348611699181798425600, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (-89705438380888704653335165590083767769953879654958783855317882966200828559360, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (1151092895747371986483047191334923516591005329489629755485810229546333821625856, + ....: 1381100660498315430373421929671000164670245330839073072652149478542137359480221267403111), + ....: (24725641793859400310483886670136079788266826658111372723121573233077840328938576, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (-31051495080139473677925068000403254349133134904365702868216464107777210775457136, + ....: 153455628944257270041491325519000018296693925648785896961349942060237484386691251933679), + ....: (9431591461895130351865642769482226964622378075329823505708119342634182162193000560, + ....: 4143301981494946291120265789013000494010735992517219217956448435626412078440663802209333), + ....: (1721694880863483428337378731387732043714427651970488363462560317808769716807148992, + ....: 153455628944257270041491325519000018296693925648785896961349942060237484386691251933679), + ....: (255327752077837584624694974814916395144764296822788813014081161094149724325120096, + ....: 27080405107810106477910233915117650287651869232138687699061754481218379597651397400061), + ....: (238105337335596176836773151768694069523377650990453522899627157538495252117232992338, + ....: 27080405107810106477910233915117650287651869232138687699061754481218379597651397400061), + ....: (1255826892296350234297164500548658984205287902407560187136301197703464130999349114638, + ....: 14336685057075938723599535602121108975815695475838128781856222960645024492874269211797), + ....: (1, 1)] + sage: p = R(coefficients_as_integer_ratios) + sage: a = QQbar.polynomial_root( + ....: AA.common_polynomial(p), + ....: CIF(RIF(-RR(0.036151142425748496), -RR(0.036151142425748489)), + ....: RIF(-RR(0.011298617187916445), -RR(0.011298617187916443)))) + sage: a.exactify() + sage: a + -0.03615114242574849? - 0.011298617187916444?*I + """ d = poly.denominator() if d == 1: return d, poly deg = poly.degree() - factors = {} - for i in range(deg): - d = poly[i].denominator() - df = factor(d) - for f, e in df: - oe = 0 - if f in factors: - oe = factors[f] - min_e = (e + (deg - i) - 1) // (deg - i) - factors[f] = max(oe, min_e) - change = 1 - for f, e in factors.items(): - change = change * f**e + denoms = [c.denominator() for c in poly] + if all(d.nbits() < 128 for d in denoms): + # Factor the polynomial denominators. + factors = {} + for i, d in enumerate(denoms): + df = factor(d) + for f, e in df: + oe = 0 + if f in factors: + oe = factors[f] + min_e = (e + (deg - i) - 1) // (deg - i) + factors[f] = max(oe, min_e) + change = 1 + for f, e in factors.items(): + change = change * f**e + else: + # Factoring would be too slow. + change = poly.monic().denominator() poly = poly * (change**deg) poly = poly(poly.parent().gen() / change) return change, poly From 6d2db92b485aa8e26ece5db44db8f132fc812e3c Mon Sep 17 00:00:00 2001 From: David Roe Date: Wed, 8 Feb 2023 14:34:01 +0100 Subject: [PATCH 18/30] Remove upstream urls from checksums.ini that point to trac --- build/pkgs/giac/checksums.ini | 1 - build/pkgs/iml/checksums.ini | 1 - build/pkgs/mathjax/checksums.ini | 1 - build/pkgs/msolve/checksums.ini | 1 - 4 files changed, 4 deletions(-) diff --git a/build/pkgs/giac/checksums.ini b/build/pkgs/giac/checksums.ini index 2fb1d3fdf31..089c15f34b4 100644 --- a/build/pkgs/giac/checksums.ini +++ b/build/pkgs/giac/checksums.ini @@ -2,4 +2,3 @@ tarball=giac-VERSION.tar.bz2 sha1=78c15badd19b49b7d111ac204b611a4378ce3d15 md5=8fbd43a5c60848b6813b7fc8698a0199 cksum=1923149665 -upstream_url=https://trac.sagemath.org/raw-attachment/ticket/31563/giac-VERSION.tar.bz2 diff --git a/build/pkgs/iml/checksums.ini b/build/pkgs/iml/checksums.ini index d876ccb5b53..628d5461e70 100644 --- a/build/pkgs/iml/checksums.ini +++ b/build/pkgs/iml/checksums.ini @@ -2,4 +2,3 @@ tarball=iml-VERSION.tar.bz2 sha1=8aba468a62e6fb0584be9b014350b734663c0670 md5=a8083e70c0c4378f69eb772c1eeed6f0 cksum=2793221462 -upstream_url=https://trac.sagemath.org/raw-attachment/ticket/33195/iml-1.0.4p2.tar.bz2 diff --git a/build/pkgs/mathjax/checksums.ini b/build/pkgs/mathjax/checksums.ini index 76e362f6b28..6a6b233b2ae 100644 --- a/build/pkgs/mathjax/checksums.ini +++ b/build/pkgs/mathjax/checksums.ini @@ -2,4 +2,3 @@ tarball=mathjax-VERSION.tar.gz sha1=3f7abecf8cacd7f5d7f9ae6c3baca7739101c17d md5=ba1a65ab58aaad6c84f39735c619bc34 cksum=1142131398 -upstream_url=https://trac.sagemath.org/raw-attachment/ticket/25833/mathjax-3.2.0.tar.gz diff --git a/build/pkgs/msolve/checksums.ini b/build/pkgs/msolve/checksums.ini index 0b7558afd2b..e357a86bae4 100644 --- a/build/pkgs/msolve/checksums.ini +++ b/build/pkgs/msolve/checksums.ini @@ -2,4 +2,3 @@ tarball=msolve-VERSION.tar.gz sha1=5b227de8b222bfe8d143e1d7ea77ad71cd209dc8 md5=2f34bd9ccb089688ae169201281108dc cksum=941373315 -upstream_url=https://trac.sagemath.org/raw-attachment/ticket/31664/msolve-VERSION.tar.gz From cabd2722711967cfe2870a79258d888d85f9df8a Mon Sep 17 00:00:00 2001 From: Alex J Best Date: Wed, 8 Feb 2023 14:00:21 +0000 Subject: [PATCH 19/30] fix usage of verbose with positional argument --- src/sage/schemes/elliptic_curves/gal_reps.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/gal_reps.py b/src/sage/schemes/elliptic_curves/gal_reps.py index 55d0ac2d352..c1d131e3ad6 100644 --- a/src/sage/schemes/elliptic_curves/gal_reps.py +++ b/src/sage/schemes/elliptic_curves/gal_reps.py @@ -916,14 +916,14 @@ def image_type(self, p): a_ell = self._E.ap(ell) u = k(a_ell)**2 * k(ell)**(-1) if u == 3: - verbose("found an element of order 6",2) + verbose("found an element of order 6", level=2) # found an element of order 6: self.__image_type[p] = non_split_str return self.__image_type[p] if u == 2 and not has_an_el_order_4: # found an element of order 4 - verbose("found an element of order 4",2) + verbose("found an element of order 4", level=2) has_an_el_order_4 = True if has_an_el_order_3: self.__image_type[p] = s4_str @@ -931,13 +931,13 @@ def image_type(self, p): if u == 1 and not has_an_el_order_3: # found an element of order 3 - verbose("found an element of order 3",2) + verbose("found an element of order 3", level=2) has_an_el_order_3 = True if has_an_el_order_4: self.__image_type[p] = s4_str return self.__image_type[p] - verbose("p=5 and we could not determine the image, yet", 2) + verbose("p=5 and we could not determine the image, yet", level=2) # we have not yet determined the image, there are only the following possible subgroups of PGL_2 # (unless we were unlucky and none of the elements of order 6 showed up above, for instance) # A_4 of order 12 with elements of order 2 and 3 @@ -995,15 +995,15 @@ def image_type(self, p): u = k(a_ell)**2 * k(ell)**(-1) if (u not in ex_setp) and could_be_exc == 1: # it can not be in the exceptional - verbose("the image cannot be exceptional, found u=%s"%u,2) + verbose("the image cannot be exceptional, found u=%s"%u, level=2) could_be_exc = 0 if a_ell != 0 and arith.kronecker(a_ell**2 - 4*ell,p) == 1 and could_be_non_split == 1: # it can not be in the normalizer of the non-split Cartan - verbose("the image cannot be non-split, found u=%s"%u,2) + verbose("the image cannot be non-split, found u=%s"%u, level=2) could_be_non_split = 0 if a_ell != 0 and arith.kronecker(a_ell**2 - 4*ell,p) == -1 and could_be_split == 1: # it can not be in the normalizer of the split Cartan - verbose("the image cannot be split, found u=%s"%u,2) + verbose("the image cannot be split, found u=%s"%u, level=2) could_be_split = 0 assert could_be_exc + could_be_split + could_be_non_split > 0, "bug in image_type." @@ -1064,7 +1064,7 @@ def image_type(self, p): K = self._E.division_field(p, 'z') d = K.absolute_degree() - verbose("field of degree %s. try to compute Galois group"%(d),2) + verbose("field of degree %s. try to compute Galois group"%(d), level=2) # If the degree is too big, we have no chance at the Galois # group. K.galois_group calls is_galois which used to rely on # pari's Galois group computations, so degree < 12 From 0d012a2c2d467c5669080aa574566fd5069fed12 Mon Sep 17 00:00:00 2001 From: Alex J Best Date: Wed, 8 Feb 2023 15:11:22 +0000 Subject: [PATCH 20/30] gitignore another (temporary) autoconf file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e62fa805ecd..17376a5d441 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /config.status /configure /conftest* +/confdefs.h /m4/sage_spkg_configures.m4 From 5734d2add8dc0223a612f1e66a50e4690b0ffe23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Wed, 21 Dec 2022 19:43:02 -0300 Subject: [PATCH 21/30] #34995 (trac #23712): support tachyon >= 0.99.2 In tachyon 0.99.2 the keyword `focallength` was changed to `focaldist`. To support it, when running on version >= 0.99.2 we "patch" the model as constructed by class `sage.plot.plot3d.tachyon.Tachyon`. In the future (possibly when tachyon in sage gets upgraded), all the focallength occurences in sage.plot.plot3d.tachyon can be replaced by focaldist for consistency with new tachyon, and the logic here can be reversed (i.e. patch the model when self.version() < '0.99.2') or just drop support for old versions. --- src/sage/interfaces/tachyon.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py index 23671e50892..21cc1db65ac 100644 --- a/src/sage/interfaces/tachyon.py +++ b/src/sage/interfaces/tachyon.py @@ -683,12 +683,14 @@ #***************************************************************************** import os +import re from sage.cpython.string import bytes_to_str from sage.misc.pager import pager from sage.misc.superseded import deprecation from sage.misc.temporary_file import tmp_filename from sage.structure.sage_object import SageObject +from sage.misc.cachefunc import cached_method class TachyonRT(SageObject): @@ -799,6 +801,11 @@ def __call__(self, model, outfile='sage.png', verbose=1, extra_opts=''): Parser failed due to an input file syntax error. Aborting render. """ + if self.version() >= '0.99.2': + # this keyword was changed in 0.99.2 + model = model.replace( + " focallength ", + " focaldist ") modelfile = tmp_filename(ext='.dat') with open(modelfile, 'w') as file: file.write(model) @@ -851,6 +858,22 @@ def usage(self, use_pager=True): else: print(r) + @cached_method + def version(self): + """ + Returns the version of the Tachyon raytracer being used. + + TESTS:: + + sage: tachyon_rt.version() # not tested + 0.98.9 + sage: tachyon_rt.version() >= '0.98.9' + True + """ + with os.popen('tachyon') as f: + r = f.read() + return re.search(r"Version ([\d.]*)", r)[1] + def help(self, use_pager=True): """ Deprecated: type 'sage.interfaces.tachyon?' for help From c55d7d61aa90287a7f2b3f8184f79726739eded7 Mon Sep 17 00:00:00 2001 From: Lorenz Panny Date: Thu, 9 Feb 2023 14:58:24 +0800 Subject: [PATCH 22/30] make _multiple_x_*() methods work for all n --- .../schemes/elliptic_curves/ell_generic.py | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_generic.py b/src/sage/schemes/elliptic_curves/ell_generic.py index d3ca4896b01..e39e7f19ac1 100644 --- a/src/sage/schemes/elliptic_curves/ell_generic.py +++ b/src/sage/schemes/elliptic_curves/ell_generic.py @@ -1991,6 +1991,14 @@ def _multiple_x_numerator(self, n, x=None): EXAMPLES:: + sage: E = EllipticCurve([1,2]) + sage: E._multiple_x_numerator(3) + x^9 - 12*x^7 - 192*x^6 + 30*x^5 - 48*x^4 + 228*x^3 + 96*x^2 + 393*x + 528 + sage: E._multiple_x_numerator(-3) + x^9 - 12*x^7 - 192*x^6 + 30*x^5 - 48*x^4 + 228*x^3 + 96*x^2 + 393*x + 528 + + :: + sage: E = EllipticCurve("37a") sage: P = E.gens()[0] sage: x = P[0] @@ -2043,9 +2051,9 @@ def _multiple_x_numerator(self, n, x=None): sage: E._multiple_x_numerator(5) x^25 + 65037*x^23 + 55137*x^22 + ... + 813*x^2 + 10220*x + 42539 """ - n = rings.Integer(n) - if n < 2: - raise ValueError("n must be at least 2") + n = rings.Integer(n).abs() + if not n: + raise ValueError("n must be nonzero") if x is None: try: @@ -2061,6 +2069,9 @@ def _multiple_x_numerator(self, n, x=None): cache = None xx = x + if n == 1: + return xx + polys = self.division_polynomial_0([-2,-1,n-1,n,n+1], x) if n % 2 == 0: @@ -2101,6 +2112,14 @@ def _multiple_x_denominator(self, n, x=None): EXAMPLES:: + sage: E = EllipticCurve([1,2]) + sage: E._multiple_x_denominator(3) + 9*x^8 + 36*x^6 + 144*x^5 + 30*x^4 + 288*x^3 + 564*x^2 - 48*x + 1 + sage: E._multiple_x_denominator(-3) + 9*x^8 + 36*x^6 + 144*x^5 + 30*x^4 + 288*x^3 + 564*x^2 - 48*x + 1 + + :: + sage: E = EllipticCurve("43a") sage: P = E.gens()[0] sage: x = P[0] @@ -2128,9 +2147,9 @@ def _multiple_x_denominator(self, n, x=None): sage: E._multiple_x_denominator(5) 25*x^24 + 3100*x^22 + 19000*x^21 + ... + 24111*x^2 + 52039*x + 56726 """ - n = rings.Integer(n) - if n < 2: - raise ValueError("n must be at least 2") + n = rings.Integer(n).abs() + if not n: + raise ValueError("n must be nonzero") if x is None: try: From 2252d382ff0662bd3c94d66e71439af40219970c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Wed, 8 Feb 2023 23:34:44 -0300 Subject: [PATCH 23/30] #34995: support debian version of tachyon Debian patches tachyon so it won't report the version. We hardcode '0.99' since that's the version they ship. --- src/sage/interfaces/tachyon.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sage/interfaces/tachyon.py b/src/sage/interfaces/tachyon.py index 21cc1db65ac..ce1d50f71bc 100644 --- a/src/sage/interfaces/tachyon.py +++ b/src/sage/interfaces/tachyon.py @@ -865,14 +865,17 @@ def version(self): TESTS:: - sage: tachyon_rt.version() # not tested + sage: tachyon_rt.version() # random 0.98.9 sage: tachyon_rt.version() >= '0.98.9' True """ with os.popen('tachyon') as f: - r = f.read() - return re.search(r"Version ([\d.]*)", r)[1] + r = f.readline() + res = re.search(r"Version ([\d.]*)", r) + # debian patches tachyon so it won't report the version + # we hardcode '0.99' since that's indeed the version they ship + return res[1] if res else '0.99' def help(self, use_pager=True): """ From 4972c0d52d5f0b4a0dbb20b141cc511e99f9d9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:12:42 +0100 Subject: [PATCH 24/30] Update src/sage/quadratic_forms/quadratic_form.py Co-authored-by: Travis Scrimshaw --- src/sage/quadratic_forms/quadratic_form.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index a9069fd6f0e..f53602f49f3 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -579,11 +579,7 @@ def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_ elif is_Polynomial(R) or is_MPolynomial(R): p = R - if p.is_zero(): - pass - elif p.is_homogeneous() and p.degree() == 2: - pass - else: + if not p.is_zero() and not (p.is_homogeneous() and p.degree() == 2): raise ValueError("polynomial is neither zero nor homogeneous of degree 2") P = p.parent() From 15cea6425bf27916e44aecd5dadd07692e160fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:13:04 +0100 Subject: [PATCH 25/30] Update src/sage/rings/polynomial/polynomial_element.pyx Co-authored-by: Travis Scrimshaw --- src/sage/rings/polynomial/polynomial_element.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 4f4422ba7a5..ea18749d772 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8869,7 +8869,7 @@ cdef class Polynomial(CommutativeAlgebraElement): - ``explain`` -- boolean (default: ``False``); if ``True`` return a tuple whose first element is the boolean result of the test, and the second element is a string describing the reason the test failed, - or ``None`` if the test succeeded. + or ``None`` if the test succeeded EXAMPLES:: From 2a1a9ff4fa0abd4379e6f5c34217a2fa05c4b581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:13:22 +0100 Subject: [PATCH 26/30] Update src/sage/rings/polynomial/multi_polynomial.pyx Co-authored-by: Travis Scrimshaw --- src/sage/rings/polynomial/multi_polynomial.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 4e3d1cd6f54..2238460a60a 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2812,7 +2812,7 @@ def _is_M_convex_(points): n_points = len(points_set) if n_points == 0: return True - elt = list(islice(points_set, 0, 1))[0] + elt = next(islice(points_set, 0, 1))) dim = len(elt) if any(len(p) != dim for p in points_set): raise ValueError("input points are not the same dimension") From 5551337859b6565088386fff2dde129b3ec70810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:13:47 +0100 Subject: [PATCH 27/30] Update src/sage/rings/polynomial/multi_polynomial.pyx Co-authored-by: Travis Scrimshaw --- src/sage/rings/polynomial/multi_polynomial.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 2238460a60a..3490ff3ea73 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2764,7 +2764,7 @@ def _is_M_convex_(points): INPUT: - ``points`` -- iterable for a list of integer lattice points of the - same dimension. + same dimension Examples of M-convex sets include the vertices of a matroid polytope, and the support sets of Schur polynomials. From 6aeb1da08929079645e82683961608c938393009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:15:41 +0100 Subject: [PATCH 28/30] Update src/sage/rings/polynomial/multi_polynomial.pyx Co-authored-by: Travis Scrimshaw --- src/sage/rings/polynomial/multi_polynomial.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 3490ff3ea73..3aa5cd93e1c 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2809,8 +2809,7 @@ def _is_M_convex_(points): See [BrHu2019]_ for a definition of M-convexity. """ points_set = set(map(tuple, points)) - n_points = len(points_set) - if n_points == 0: + if not points_set: return True elt = next(islice(points_set, 0, 1))) dim = len(elt) From 2590c05960dfa87a6a967d895986b416a8e7c0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:35:17 +0100 Subject: [PATCH 29/30] fixes in Lorentzian polynomials --- src/sage/rings/polynomial/multi_polynomial.pyx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 3aa5cd93e1c..f95b3b82f08 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -2701,14 +2701,18 @@ cdef class MPolynomial(CommutativeRingElement): [HMMS2019]_. The second reference gives the characterization of Lorentzian polynomials applied in this implementation explicitly. """ + from sage.rings.imaginary_unit import I + # function to handle return value when reason requested def result(val, explanation=None): - if explain: - return (val, explanation) - else: - return val + return (val, explanation) if explain else val - if not self.base_ring().is_subring(RealField()): + try: + # this would better be handled by a category of RealFields() + self.base_ring()(I) + except (ValueError, TypeError): + pass + else: raise NotImplementedError("is_lorentzian only implemented for real polynomials") if self.is_zero(): @@ -2811,8 +2815,7 @@ def _is_M_convex_(points): points_set = set(map(tuple, points)) if not points_set: return True - elt = next(islice(points_set, 0, 1))) - dim = len(elt) + dim = len(next(iter(points_set))) if any(len(p) != dim for p in points_set): raise ValueError("input points are not the same dimension") if any(entry not in ZZ for p in points_set for entry in p): From 46a6105bc494f44adfc063a3f4a9b392fcb8ea9d Mon Sep 17 00:00:00 2001 From: Release Manager Date: Fri, 3 Mar 2023 00:40:26 +0100 Subject: [PATCH 30/30] Updated SageMath version to 10.0.beta3 --- .zenodo.json | 8 ++++---- VERSION.txt | 2 +- build/pkgs/configure/checksums.ini | 6 +++--- build/pkgs/configure/package-version.txt | 2 +- build/pkgs/sage_conf/install-requires.txt | 2 +- build/pkgs/sage_docbuild/install-requires.txt | 2 +- build/pkgs/sage_setup/install-requires.txt | 2 +- build/pkgs/sage_sws2rst/install-requires.txt | 2 +- build/pkgs/sagelib/install-requires.txt | 2 +- build/pkgs/sagemath_categories/install-requires.txt | 2 +- build/pkgs/sagemath_environment/install-requires.txt | 2 +- build/pkgs/sagemath_objects/install-requires.txt | 2 +- build/pkgs/sagemath_repl/install-requires.txt | 2 +- pkgs/sage-conf/VERSION.txt | 2 +- pkgs/sage-conf_pypi/VERSION.txt | 2 +- pkgs/sage-docbuild/VERSION.txt | 2 +- pkgs/sage-setup/VERSION.txt | 2 +- pkgs/sage-sws2rst/VERSION.txt | 2 +- pkgs/sagemath-categories/VERSION.txt | 2 +- pkgs/sagemath-environment/VERSION.txt | 2 +- pkgs/sagemath-objects/VERSION.txt | 2 +- pkgs/sagemath-repl/VERSION.txt | 2 +- src/VERSION.txt | 2 +- src/bin/sage-version.sh | 6 +++--- src/sage/version.py | 6 +++--- 25 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 165f5ccb2d1..91f308b7b75 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,10 +1,10 @@ { "description": "Mirror of the Sage https://sagemath.org/ source tree", "license": "other-open", - "title": "sagemath/sage: 10.0.beta2", - "version": "10.0.beta2", + "title": "sagemath/sage: 10.0.beta3", + "version": "10.0.beta3", "upload_type": "software", - "publication_date": "2023-02-23", + "publication_date": "2023-03-02", "creators": [ { "affiliation": "SageMath.org", @@ -15,7 +15,7 @@ "related_identifiers": [ { "scheme": "url", - "identifier": "https://github.com/sagemath/sage/tree/10.0.beta2", + "identifier": "https://github.com/sagemath/sage/tree/10.0.beta3", "relation": "isSupplementTo" }, { diff --git a/VERSION.txt b/VERSION.txt index ef59effc672..d3cf4ce44c4 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 10.0.beta2, Release Date: 2023-02-23 +SageMath version 10.0.beta3, Release Date: 2023-03-02 diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index ea09e0a4167..c08ada17ba4 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=a9dd38e83511f7f7911c94366c1c7b9e213cea3e -md5=e341828a3c4d17b37887cd93c298286f -cksum=2811082803 +sha1=b9a6c30f4f1c828ca611527d104643d8c0b89ed9 +md5=37a7a99a528efa8a4eea1beff33985db +cksum=1112286999 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 96ad398eab6..82496e60715 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -bbd91d34c346cbb308e6bfac72ac414b365f190c +a822a2132aa0e85069ec8b6efa48ad6db08cc044 diff --git a/build/pkgs/sage_conf/install-requires.txt b/build/pkgs/sage_conf/install-requires.txt index 460c9d389f2..c1acbf5a6b3 100644 --- a/build/pkgs/sage_conf/install-requires.txt +++ b/build/pkgs/sage_conf/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-conf ~= 10.0b2 +sage-conf ~= 10.0b3 diff --git a/build/pkgs/sage_docbuild/install-requires.txt b/build/pkgs/sage_docbuild/install-requires.txt index f7a958d2a26..4c0503af358 100644 --- a/build/pkgs/sage_docbuild/install-requires.txt +++ b/build/pkgs/sage_docbuild/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-docbuild ~= 10.0b2 +sage-docbuild ~= 10.0b3 diff --git a/build/pkgs/sage_setup/install-requires.txt b/build/pkgs/sage_setup/install-requires.txt index 4fe90492ae9..be67a744301 100644 --- a/build/pkgs/sage_setup/install-requires.txt +++ b/build/pkgs/sage_setup/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-setup ~= 10.0b2 +sage-setup ~= 10.0b3 diff --git a/build/pkgs/sage_sws2rst/install-requires.txt b/build/pkgs/sage_sws2rst/install-requires.txt index 2c538e2d974..b30f48ea38a 100644 --- a/build/pkgs/sage_sws2rst/install-requires.txt +++ b/build/pkgs/sage_sws2rst/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-sws2rst ~= 10.0b2 +sage-sws2rst ~= 10.0b3 diff --git a/build/pkgs/sagelib/install-requires.txt b/build/pkgs/sagelib/install-requires.txt index 1992637fb55..70aefd13369 100644 --- a/build/pkgs/sagelib/install-requires.txt +++ b/build/pkgs/sagelib/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagelib ~= 10.0b2 +sagelib ~= 10.0b3 diff --git a/build/pkgs/sagemath_categories/install-requires.txt b/build/pkgs/sagemath_categories/install-requires.txt index 02b1c5bbdb2..31553eaef51 100644 --- a/build/pkgs/sagemath_categories/install-requires.txt +++ b/build/pkgs/sagemath_categories/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-categories ~= 10.0b2 +sagemath-categories ~= 10.0b3 diff --git a/build/pkgs/sagemath_environment/install-requires.txt b/build/pkgs/sagemath_environment/install-requires.txt index 6c258939a07..bcd541eea0b 100644 --- a/build/pkgs/sagemath_environment/install-requires.txt +++ b/build/pkgs/sagemath_environment/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-environment ~= 10.0b2 +sagemath-environment ~= 10.0b3 diff --git a/build/pkgs/sagemath_objects/install-requires.txt b/build/pkgs/sagemath_objects/install-requires.txt index 0ecdca99435..1da2fc997e0 100644 --- a/build/pkgs/sagemath_objects/install-requires.txt +++ b/build/pkgs/sagemath_objects/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-objects ~= 10.0b2 +sagemath-objects ~= 10.0b3 diff --git a/build/pkgs/sagemath_repl/install-requires.txt b/build/pkgs/sagemath_repl/install-requires.txt index d0525ea50ea..798c25aee10 100644 --- a/build/pkgs/sagemath_repl/install-requires.txt +++ b/build/pkgs/sagemath_repl/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-repl ~= 10.0b2 +sagemath-repl ~= 10.0b3 diff --git a/pkgs/sage-conf/VERSION.txt b/pkgs/sage-conf/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sage-conf/VERSION.txt +++ b/pkgs/sage-conf/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sage-conf_pypi/VERSION.txt +++ b/pkgs/sage-conf_pypi/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sage-docbuild/VERSION.txt b/pkgs/sage-docbuild/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sage-docbuild/VERSION.txt +++ b/pkgs/sage-docbuild/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sage-setup/VERSION.txt b/pkgs/sage-setup/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sage-setup/VERSION.txt +++ b/pkgs/sage-setup/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sage-sws2rst/VERSION.txt b/pkgs/sage-sws2rst/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sage-sws2rst/VERSION.txt +++ b/pkgs/sage-sws2rst/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sagemath-categories/VERSION.txt b/pkgs/sagemath-categories/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sagemath-categories/VERSION.txt +++ b/pkgs/sagemath-categories/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sagemath-environment/VERSION.txt b/pkgs/sagemath-environment/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sagemath-environment/VERSION.txt +++ b/pkgs/sagemath-environment/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sagemath-objects/VERSION.txt b/pkgs/sagemath-objects/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sagemath-objects/VERSION.txt +++ b/pkgs/sagemath-objects/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/pkgs/sagemath-repl/VERSION.txt b/pkgs/sagemath-repl/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/pkgs/sagemath-repl/VERSION.txt +++ b/pkgs/sagemath-repl/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/src/VERSION.txt b/src/VERSION.txt index a29f7140ff6..b3001ec9281 100644 --- a/src/VERSION.txt +++ b/src/VERSION.txt @@ -1 +1 @@ -10.0.beta2 +10.0.beta3 diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index 4d2a5124035..9aab0c0fcc8 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -4,6 +4,6 @@ # which stops "setup.py develop" from rewriting it as a Python file. : # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='10.0.beta2' -SAGE_RELEASE_DATE='2023-02-23' -SAGE_VERSION_BANNER='SageMath version 10.0.beta2, Release Date: 2023-02-23' +SAGE_VERSION='10.0.beta3' +SAGE_RELEASE_DATE='2023-03-02' +SAGE_VERSION_BANNER='SageMath version 10.0.beta3, Release Date: 2023-03-02' diff --git a/src/sage/version.py b/src/sage/version.py index 5eba7e03759..6c86cab5b29 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,5 +1,5 @@ # Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! -version = '10.0.beta2' -date = '2023-02-23' -banner = 'SageMath version 10.0.beta2, Release Date: 2023-02-23' +version = '10.0.beta3' +date = '2023-03-02' +banner = 'SageMath version 10.0.beta3, Release Date: 2023-03-02'