diff --git a/src/sage/categories/bimodules.py b/src/sage/categories/bimodules.py index 5d78363039e..c05db937d72 100644 --- a/src/sage/categories/bimodules.py +++ b/src/sage/categories/bimodules.py @@ -107,7 +107,8 @@ def an_instance(cls): sage: Bimodules.an_instance() Category of bimodules over Rational Field on the left and Real Field with 53 bits of precision on the right """ - from sage.rings.all import QQ, RR + from sage.rings.rational_field import QQ + from sage.rings.real_mpfr import RR return cls(QQ, RR) def _repr_object_names(self): diff --git a/src/sage/categories/coalgebras_with_basis.py b/src/sage/categories/coalgebras_with_basis.py index 8ac39c20d38..24505dcf067 100644 --- a/src/sage/categories/coalgebras_with_basis.py +++ b/src/sage/categories/coalgebras_with_basis.py @@ -197,7 +197,7 @@ def coproduct_iterated(self, n=1): if n == 1: return self.coproduct() from sage.functions.all import floor, ceil - from sage.rings.all import Integer + from sage.rings.integer import Integer # Use coassociativity of `\Delta` to perform many coproducts simultaneously. fn = floor(Integer(n-1)/2); cn = ceil(Integer(n-1)/2) diff --git a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py index edb8a5ffbc6..720d0097632 100644 --- a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py +++ b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py @@ -339,7 +339,7 @@ def simple_reflection_orders(self): """ one = self.one() s = self.simple_reflections() - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ def mult_order(x): ct = ZZ.one() diff --git a/src/sage/categories/euclidean_domains.py b/src/sage/categories/euclidean_domains.py index bc3a5a1f321..fa4feb161ad 100644 --- a/src/sage/categories/euclidean_domains.py +++ b/src/sage/categories/euclidean_domains.py @@ -148,7 +148,7 @@ def _test_euclidean_degree(self, **options): min_degree = self.one().euclidean_degree() - from sage.rings.all import NN + from sage.rings.semirings.non_negative_integer_semiring import NN for a in S: tester.assertIn(a.euclidean_degree(), NN) tester.assertGreaterEqual(a.euclidean_degree(), min_degree) diff --git a/src/sage/categories/fields.py b/src/sage/categories/fields.py index aab54c9cbb5..d88743cc17f 100644 --- a/src/sage/categories/fields.py +++ b/src/sage/categories/fields.py @@ -559,7 +559,7 @@ def euclidean_degree(self): """ if self.is_zero(): raise ValueError("euclidean degree not defined for the zero element") - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ return ZZ.zero() def quo_rem(self, other): diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index 82f3800aa62..817b762c2ac 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -324,7 +324,7 @@ def number_of_reflection_hyperplanes(self): sage: W.number_of_reflection_hyperplanes() # optional - gap3 15 """ - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ return ZZ.sum(codeg + 1 for codeg in self.codegrees()) @cached_method @@ -358,7 +358,7 @@ def number_of_reflections(self): sage: W.number_of_reflections() # optional - gap3 15 """ - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ return ZZ.sum(deg - 1 for deg in self.degrees()) @cached_method @@ -413,7 +413,7 @@ def cardinality(self): sage: W.cardinality() # optional - gap3 192 """ - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ return ZZ.prod(self.degrees()) def is_well_generated(self): diff --git a/src/sage/categories/finite_coxeter_groups.py b/src/sage/categories/finite_coxeter_groups.py index 90e301bedef..8e7df277404 100644 --- a/src/sage/categories/finite_coxeter_groups.py +++ b/src/sage/categories/finite_coxeter_groups.py @@ -13,9 +13,6 @@ from sage.misc.lazy_attribute import lazy_attribute from sage.categories.category_with_axiom import CategoryWithAxiom from sage.categories.coxeter_groups import CoxeterGroups -from sage.rings.all import AA, UniversalCyclotomicField, QQbar -from sage.rings.integer_ring import ZZ - class FiniteCoxeterGroups(CategoryWithAxiom): r""" @@ -742,9 +739,12 @@ def permutahedron(self, point=None, base_ring=None): n = self.one().canonical_matrix().rank() weights = self.fundamental_weights() if point is None: + from sage.rings.integer_ring import ZZ point = [ZZ.one()] * n v = sum(point[i-1] * weights[i] for i in weights.keys()) from sage.geometry.polyhedron.constructor import Polyhedron + from sage.rings.qqbar import AA, QQbar + from sage.rings.universal_cyclotomic_field import UniversalCyclotomicField vertices = [v*w for w in self] if base_ring is None and v.base_ring() in [UniversalCyclotomicField(), QQbar]: vertices = [v.change_ring(AA) for v in vertices] diff --git a/src/sage/categories/groups.py b/src/sage/categories/groups.py index 920ea94126a..712edff66bf 100644 --- a/src/sage/categories/groups.py +++ b/src/sage/categories/groups.py @@ -78,7 +78,7 @@ def free(index_set=None, names=None, **kwds): sage: F. = Groups().free(); F Free Group on generators {x, y, z} """ - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ if index_set in ZZ or (index_set is None and names is not None): from sage.groups.free_group import FreeGroup if names is None: diff --git a/src/sage/categories/highest_weight_crystals.py b/src/sage/categories/highest_weight_crystals.py index 4e28a23fb84..dc4441abe46 100644 --- a/src/sage/categories/highest_weight_crystals.py +++ b/src/sage/categories/highest_weight_crystals.py @@ -330,7 +330,7 @@ def q_dimension(self, q=None, prec=None, use_product=False): + 36*q^12 + 44*q^13 + 57*q^14 + 70*q^15 + O(x^16) """ - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ WLR = self.weight_lattice_realization() I = self.index_set() mg = self.highest_weight_vectors() diff --git a/src/sage/categories/lie_algebras.py b/src/sage/categories/lie_algebras.py index 51408b3bd10..b088a9cb39d 100644 --- a/src/sage/categories/lie_algebras.py +++ b/src/sage/categories/lie_algebras.py @@ -166,7 +166,7 @@ def example(self, gens=None): """ if gens is None: from sage.combinat.symmetric_group_algebra import SymmetricGroupAlgebra - from sage.rings.all import QQ + from sage.rings.rational_field import QQ gens = SymmetricGroupAlgebra(QQ, 3).algebra_generators() from sage.categories.examples.lie_algebras import Example return Example(gens) diff --git a/src/sage/categories/loop_crystals.py b/src/sage/categories/loop_crystals.py index 00ba408cc77..8d6aa2821c2 100644 --- a/src/sage/categories/loop_crystals.py +++ b/src/sage/categories/loop_crystals.py @@ -22,8 +22,6 @@ from sage.categories.map import Map from sage.graphs.dot2tex_utils import have_dot2tex from sage.functions.other import ceil -from sage.rings.all import ZZ - class LoopCrystals(Category_singleton): r""" @@ -534,6 +532,7 @@ def is_perfect(self, ell=None): Implement a version for tensor products of KR crystals. """ + from sage.rings.integer_ring import ZZ if ell is None: if (self.cartan_type().dual().type() == 'BC' and self.cartan_type().rank() - 1 == self.r()): @@ -978,6 +977,7 @@ def energy_function(self, algorithm=None): if algorithm == 'definition': # Setup + from sage.rings.integer_ring import ZZ energy = ZZ.zero() R_mats = [[K.R_matrix(Kp) for Kp in self.parent().crystals[i+1:]] for i,K in enumerate(self.parent().crystals)] @@ -1179,6 +1179,7 @@ def __init__(self, B, Bp, normalization=0): sage: [H(x) for x in hw] [0, 1, 2, 1] """ + from sage.rings.integer_ring import ZZ self._B = B self._Bp = Bp self._R_matrix = self._B.R_matrix(self._Bp) diff --git a/src/sage/categories/monoids.py b/src/sage/categories/monoids.py index 395e365a015..42b55b8dda4 100644 --- a/src/sage/categories/monoids.py +++ b/src/sage/categories/monoids.py @@ -102,7 +102,7 @@ def free(index_set=None, names=None, **kwds): """ if names is not None: if isinstance(names, str): - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ if ',' not in names and index_set in ZZ: names = [names + repr(i) for i in range(index_set)] else: @@ -349,7 +349,7 @@ def free(index_set=None, names=None, **kwds): """ if names is not None: if isinstance(names, str): - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ if ',' not in names and index_set in ZZ: names = [names + repr(i) for i in range(index_set)] else: diff --git a/src/sage/categories/regular_crystals.py b/src/sage/categories/regular_crystals.py index 01defa84320..f9466c2fa23 100644 --- a/src/sage/categories/regular_crystals.py +++ b/src/sage/categories/regular_crystals.py @@ -259,7 +259,7 @@ def demazure_subcrystal(self, element, reduced_word, only_support=True): ([[2, 2]], [[1, 2]], 0)] """ from sage.combinat.free_module import CombinatorialFreeModule - from sage.rings.all import QQ + from sage.rings.rational_field import QQ C = CombinatorialFreeModule(QQ, self) D = self.demazure_operator(C(element), reduced_word) if only_support: diff --git a/src/sage/categories/supercrystals.py b/src/sage/categories/supercrystals.py index abd528c1d86..51560ae262d 100644 --- a/src/sage/categories/supercrystals.py +++ b/src/sage/categories/supercrystals.py @@ -257,7 +257,7 @@ def character(self): B[(1, 0, 0, 0, 0)] + B[(0, 1, 0, 0, 0)] + B[(0, 0, 1, 0, 0)] + B[(0, 0, 0, 1, 0)] + B[(0, 0, 0, 0, 1)] """ - from sage.rings.all import ZZ + from sage.rings.integer_ring import ZZ A = self.weight_lattice_realization().algebra(ZZ) return A.sum(A(x.weight()) for x in self)