From f2b44c59183f41753d94065df5b0116a53768a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 13 Jul 2022 11:57:29 +0200 Subject: [PATCH 1/2] rst fixes in rings and interacts --- src/sage/interacts/library.py | 4 +-- src/sage/rings/localization.py | 27 +++++++++---------- .../rings/number_field/number_field_ideal.py | 16 ++++++----- .../rings/padics/padic_lattice_element.py | 18 ++++++------- src/sage/rings/quotient_ring.py | 2 +- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/sage/interacts/library.py b/src/sage/interacts/library.py index a2d952526ac..8166014739d 100644 --- a/src/sage/interacts/library.py +++ b/src/sage/interacts/library.py @@ -91,8 +91,8 @@ def library_interact( INPUT: - ``**widgets`` -- keyword arguments that are passed to the - ``interact`` function to create the widgets. Each value must be a callable that - returns a widget. + ``interact`` function to create the widgets. Each value must + be a callable that returns a widget. EXAMPLES:: diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index 3ffe60192e6..03dbff6cc01 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -1,11 +1,11 @@ -# -*- coding: utf-8 -*- r""" Localization -Localization is an important ring construction tool. Whenever you have to extend a given -integral domain such that it contains the inverses of a finite set of elements but should -allow non injective homomorphic images this construction will be needed. See the example -on Ariki-Koike algebras below for such an application. +Localization is an important ring construction tool. Whenever you have +to extend a given integral domain such that it contains the inverses +of a finite set of elements but should allow non injective homomorphic +images this construction will be needed. See the example on +Ariki-Koike algebras below for such an application. EXAMPLES:: @@ -32,8 +32,8 @@ sage: u = [u0, u1, u2] sage: S = Set(u) sage: I = S.cartesian_product(S) - sage: add_units = u + [q, q+1] + [ui -uj for ui, uj in I if ui != uj]\ - + [q*ui -uj for ui, uj in I if ui != uj] + sage: add_units = u + [q, q+1] + [ui -uj for ui, uj in I if ui != uj] + ....: + [q*ui -uj for ui, uj in I if ui != uj] sage: L = R.localization(tuple(add_units)); L Multivariate Polynomial Ring in u0, u1, u2, q over Integer Ring localized at (q, q + 1, u2, u1, u1 - u2, u0, u0 - u2, u0 - u1, u2*q - u1, u2*q - u0, @@ -42,12 +42,12 @@ Define the representation matrices (of one of the three dimensional irreducible representations):: sage: m1 = matrix(L, [[u1, 0, 0],[0, u0, 0],[0, 0, u0]]) - sage: m2 = matrix(L, [[(u0*q - u0)/(u0 - u1), (u0*q - u1)/(u0 - u1), 0],\ - [(-u1*q + u0)/(u0 - u1), (-u1*q + u1)/(u0 - u1), 0],\ - [0, 0, -1]]) - sage: m3 = matrix(L, [[-1, 0, 0],\ - [0, u0*(1 - q)/(u1*q - u0), q*(u1 - u0)/(u1*q - u0)],\ - [0, (u1*q^2 - u0)/(u1*q - u0), (u1*q^ 2 - u1*q)/(u1*q - u0)]]) + sage: m2 = matrix(L, [[(u0*q - u0)/(u0 - u1), (u0*q - u1)/(u0 - u1), 0], + ....: [(-u1*q + u0)/(u0 - u1), (-u1*q + u1)/(u0 - u1), 0], + ....: [0, 0, -1]]) + sage: m3 = matrix(L, [[-1, 0, 0], + ....: [0, u0*(1 - q)/(u1*q - u0), q*(u1 - u0)/(u1*q - u0)], + ....: [0, (u1*q^2 - u0)/(u1*q - u0), (u1*q^ 2 - u1*q)/(u1*q - u0)]]) sage: m1.base_ring() == L True @@ -100,7 +100,6 @@ [ 0 4 5] [ 0 7 6] - Obtain specializations in characteristic 0:: sage: fQ = L.hom((3,5,7,11), codomain=QQ); fQ diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py index f785f229ef8..357cd8afe7a 100644 --- a/src/sage/rings/number_field/number_field_ideal.py +++ b/src/sage/rings/number_field/number_field_ideal.py @@ -3009,13 +3009,15 @@ def _p_quotient(self, p): computing the quotient of the ring of integers by a prime ideal. INPUT: - p -- a prime number contained in self. + + - ``p`` -- a prime number contained in ``self`` OUTPUT: - V -- a vector space of characteristic p - quo -- a partially defined quotient homomorphism from the - ambient number field to V - lift -- a section of quo. + + - ``V`` -- a vector space of characteristic ``p`` + - ``quo`` -- a partially defined quotient homomorphism from the + ambient number field to ``V`` + - ``lift`` -- a section of ``quo``. EXAMPLES:: @@ -3250,7 +3252,7 @@ def __call__(self, x): return self.__Q( list(w) ) def __repr__(self): - """ + r""" Return a string representation of this QuotientMap. EXAMPLES:: @@ -3315,7 +3317,7 @@ def __call__(self, x): return self.__OK(sum(z[i] * self.__Kgen ** i for i in range(len(z)))) def __repr__(self): - """ + r""" Return a string representation of this QuotientMap. EXAMPLES:: diff --git a/src/sage/rings/padics/padic_lattice_element.py b/src/sage/rings/padics/padic_lattice_element.py index 4cb37b7ebbf..5f679a5ea72 100644 --- a/src/sage/rings/padics/padic_lattice_element.py +++ b/src/sage/rings/padics/padic_lattice_element.py @@ -617,10 +617,10 @@ def _div_(self, other): r""" Return the quotient of this element and ``other``. - NOTE:: + .. NOTE:: - The result of division always lives in the fraction field, - even if the element to be inverted is a unit. + The result of division always lives in the fraction field, + even if the element to be inverted is a unit. EXAMPLES:: @@ -660,10 +660,10 @@ def __invert__(self): r""" Return the multiplicative inverse of this element. - NOTE:: + .. NOTE:: - The result of division always lives in the fraction field, - even if the element to be inverted is a unit. + The result of division always lives in the fraction field, + even if the element to be inverted is a unit. EXAMPLES:: @@ -1278,10 +1278,10 @@ def _is_exact_zero(self): r""" Return ``True`` if this element is exactly zero. - NOTE:: + .. NOTE:: - Since exact zeros are not supported in the precision lattice - model, this function always returns ``False``. + Since exact zeros are not supported in the precision lattice + model, this function always returns ``False``. EXAMPLES:: diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py index 90f177f9694..ad016bfb36e 100644 --- a/src/sage/rings/quotient_ring.py +++ b/src/sage/rings/quotient_ring.py @@ -15,7 +15,7 @@ sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2]) sage: S = R.quotient_ring(I) -.. todo:: +.. TODO:: The following skipped tests should be removed once :trac:`13999` is fixed:: From 4950d2bb19bbecd0311e1317e46ed4a1f1955156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 14 Jul 2022 20:18:49 +0200 Subject: [PATCH 2/2] fix one detail --- src/sage/rings/localization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index 03dbff6cc01..55f3e215ed4 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -32,8 +32,8 @@ sage: u = [u0, u1, u2] sage: S = Set(u) sage: I = S.cartesian_product(S) - sage: add_units = u + [q, q+1] + [ui -uj for ui, uj in I if ui != uj] - ....: + [q*ui -uj for ui, uj in I if ui != uj] + sage: add_units = u + [q, q + 1] + [ui - uj for ui, uj in I if ui != uj] + sage: add_units += [q*ui - uj for ui, uj in I if ui != uj] sage: L = R.localization(tuple(add_units)); L Multivariate Polynomial Ring in u0, u1, u2, q over Integer Ring localized at (q, q + 1, u2, u1, u1 - u2, u0, u0 - u2, u0 - u1, u2*q - u1, u2*q - u0,