forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-37783: various changes about is_field and is_ring
just miscellanous changes about not using `is_ring`, replacing some `is_field` by `in Fields` and having more precise categories in descent algebras also sorting the imports on the way ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#37783 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe, Travis Scrimshaw
- Loading branch information
Showing
7 changed files
with
112 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,32 +32,31 @@ | |
(1 + O(11^5), 2 + O(11^4), 3 + O(11^3), 4 + O(11^2), 5 + O(11)) | ||
""" | ||
# **************************************************************************** | ||
# ************************************************************************* | ||
# Copyright (C) 2012 Robert Pollack <[email protected]> | ||
# | ||
# Distributed under the terms of the GNU General Public License (GPL) | ||
# as published by the Free Software Foundation; either version 2 of | ||
# the License, or (at your option) any later version. | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
# ************************************************************************* | ||
|
||
from sage.categories.fields import Fields | ||
from sage.categories.modules import Modules | ||
from sage.misc.cachefunc import cached_method | ||
from sage.misc.lazy_import import lazy_import | ||
from sage.modules.module import Module | ||
from sage.structure.parent import Parent | ||
from sage.rings.rational_field import QQ | ||
from sage.rings.integer_ring import ZZ | ||
from sage.misc.cachefunc import cached_method | ||
from sage.categories.modules import Modules | ||
from sage.structure.factory import UniqueFactory | ||
|
||
from sage.rings.rational_field import QQ | ||
from sage.rings.ring import Ring | ||
from sage.structure.factory import UniqueFactory | ||
from sage.structure.parent import Parent | ||
from .sigma0 import _default_adjuster | ||
|
||
lazy_import('sage.modular.pollack_stevens.dist', 'get_dist_classes') | ||
lazy_import('sage.rings.padics.factory', ['ZpCA', 'QpCR']) | ||
lazy_import('sage.rings.padics.padic_generic', 'pAdicGeneric') | ||
|
||
from .sigma0 import _default_adjuster | ||
|
||
|
||
class OverconvergentDistributions_factory(UniqueFactory): | ||
""" | ||
|
@@ -284,7 +283,7 @@ def __init__(self, k, p=None, prec_cap=None, base=None, character=None, | |
""" | ||
if not isinstance(base, Ring): | ||
raise TypeError("base must be a ring") | ||
#from sage.rings.padics.pow_computer import PowComputer | ||
# from sage.rings.padics.pow_computer import PowComputer | ||
# should eventually be the PowComputer on ZpCA once that uses longs. | ||
Dist, WeightKAction = get_dist_classes(p, prec_cap, base, | ||
self.is_symk(), implementation) | ||
|
@@ -318,9 +317,9 @@ def _element_constructor_(self, val, **kwargs): | |
sage: v = V([1,2,3,4,5,6,7]); v | ||
(1, 2, 3, 4, 5, 6, 7) | ||
""" | ||
ordp = kwargs.get('ord',0) | ||
check = kwargs.get('check',True) | ||
normalize = kwargs.get('normalize',True) | ||
ordp = kwargs.get('ord', 0) | ||
check = kwargs.get('check', True) | ||
normalize = kwargs.get('normalize', True) | ||
return self.Element(val, self, ordp, check, normalize) | ||
|
||
def _coerce_map_from_(self, other): | ||
|
@@ -410,13 +409,14 @@ def prime(self): | |
|
||
def weight(self): | ||
""" | ||
Return the weight of this distribution space. The standard | ||
caveat applies, namely that the weight of `Sym^k` is | ||
defined to be `k`, not `k+2`. | ||
Return the weight of this distribution space. | ||
The standard caveat applies, namely that the weight of `Sym^k` | ||
is defined to be `k`, not `k+2`. | ||
OUTPUT: | ||
- nonnegative integer | ||
nonnegative integer | ||
EXAMPLES:: | ||
|
@@ -473,7 +473,7 @@ def lift(self, p=None, M=None, new_base_ring=None): | |
""" | ||
if self._character is not None: | ||
if self._character.base_ring() != QQ: | ||
# need to change coefficient ring for character | ||
# need to change coefficient ring for character | ||
raise NotImplementedError | ||
if M is None: | ||
M = self._prec_cap + 1 | ||
|
@@ -690,7 +690,7 @@ def _repr_(self): | |
elif self.base_ring() is ZZ: | ||
V = 'Z^2' | ||
elif isinstance(self.base_ring(), pAdicGeneric) and self.base_ring().degree() == 1: | ||
if self.base_ring().is_field(): | ||
if self.base_ring() in Fields(): | ||
V = 'Q_%s^2' % self._p | ||
else: | ||
V = 'Z_%s^2' % self._p | ||
|
Oops, something went wrong.