summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roe <roed.math@gmail.com>2017-08-21 04:49:20 +0000
committerDavid Roe <roed.math@gmail.com>2017-08-21 04:49:20 +0000
commit90a79f74235c9136d6266d221a53f95f91aa7795 (patch)
tree0d6b433322ae87fea36ac4ecb2a33171058329c8
parentUpdated SageMath version to 8.1.beta2 (diff)
parentMerge branch 'u/caruso/lattice_precision' of git://trac.sagemath.org/sage int... (diff)
Merge branch 'u/roed/lattice_precision' of git://trac.sagemath.org/sage into t/23505/lattice_precision
-rw-r--r--src/sage/rings/padics/all.py4
-rw-r--r--src/sage/rings/padics/factory.py368
-rw-r--r--src/sage/rings/padics/lattice_precision.py567
-rw-r--r--src/sage/rings/padics/padic_base_generic.py11
-rw-r--r--src/sage/rings/padics/padic_base_leaves.py206
-rw-r--r--src/sage/rings/padics/padic_lattice_element.py203
-rw-r--r--src/sage/rings/padics/padic_printing.pyx7
7 files changed, 1338 insertions, 28 deletions
diff --git a/src/sage/rings/padics/all.py b/src/sage/rings/padics/all.py
index 809b4aa..0ca7080 100644
--- a/src/sage/rings/padics/all.py
+++ b/src/sage/rings/padics/all.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from .generic_nodes import is_pAdicField, is_pAdicRing
-from .factory import Zp, Zq, Zp as pAdicRing, ZpCR, ZpCA, ZpFM, ZpFP, ZqCR, ZqCA, ZqFM, ZqFP #, ZpL, ZqL
-from .factory import Qp, Qq, Qp as pAdicField, QpCR, QpFP, QqCR, QqFP #, QpL, QqL
+from .factory import Zp, Zq, Zp as pAdicRing, ZpCR, ZpCA, ZpFM, ZpFP, ZpLP, ZqCR, ZqCA, ZqFM, ZqFP #, ZpL, ZqL
+from .factory import Qp, Qq, Qp as pAdicField, QpCR, QpFP, QpLP, QqCR, QqFP #, QpL, QqL
from .factory import pAdicExtension
from .padic_generic import local_print_mode
from .pow_computer import PowComputer
diff --git a/src/sage/rings/padics/factory.py b/src/sage/rings/padics/factory.py
index 6034161..e07d955 100644
--- a/src/sage/rings/padics/factory.py
+++ b/src/sage/rings/padics/factory.py
@@ -31,8 +31,10 @@ from .padic_base_leaves import (pAdicRingCappedRelative,
pAdicRingCappedAbsolute,
pAdicRingFixedMod,
pAdicRingFloatingPoint,
+ pAdicRingLattice,
pAdicFieldCappedRelative,
- pAdicFieldFloatingPoint)
+ pAdicFieldFloatingPoint,
+ pAdicFieldLattice)
from . import padic_printing
######################################################
@@ -95,7 +97,7 @@ def _default_show_prec(type, print_mode):
else:
return False
-def get_key_base(p, prec, type, print_mode, names, ram_name, print_pos, print_sep, print_alphabet, print_max_terms, show_prec, check, valid_non_lazy_types):
+def get_key_base(p, prec, type, print_mode, names, ram_name, print_pos, print_sep, print_alphabet, print_max_terms, show_prec, check, valid_non_lazy_types, label=None):
"""
This implements create_key for Zp and Qp: moving it here prevents code duplication.
@@ -105,9 +107,9 @@ def get_key_base(p, prec, type, print_mode, names, ram_name, print_pos, print_se
sage: from sage.rings.padics.factory import get_key_base
sage: get_key_base(11, 5, 'capped-rel', None, None, None, None, ':', None, None, False, True, ['capped-rel'])
- (11, 5, 'capped-rel', 'series', '11', True, '|', (), -1, False)
+ (11, 5, 'capped-rel', 'series', '11', True, '|', (), -1, False, None)
sage: get_key_base(12, 5, 'capped-rel', 'digits', None, None, None, None, None, None, True, False, ['capped-rel'])
- (12, 5, 'capped-rel', 'digits', '12', True, '|', ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'), -1, True)
+ (12, 5, 'capped-rel', 'digits', '12', True, '|', ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'), -1, True, None)
"""
if prec is None:
prec = DEFAULT_PREC
@@ -186,7 +188,7 @@ def get_key_base(p, prec, type, print_mode, names, ram_name, print_pos, print_se
if show_prec is None:
show_prec = _default_show_prec(type, print_mode)
if type in valid_non_lazy_types:
- key = (p, prec, type, print_mode, name, print_pos, print_sep, tuple(print_alphabet), print_max_terms, show_prec)
+ key = (p, prec, type, print_mode, name, print_pos, print_sep, tuple(print_alphabet), print_max_terms, show_prec, label)
else:
print(type)
raise ValueError("type must be %s"%(", ".join(valid_non_lazy_types)))
@@ -537,7 +539,7 @@ class Qp_class(UniqueFactory):
"""
def create_key(self, p, prec = None, type = 'capped-rel', print_mode = None,
names = None, ram_name = None, print_pos = None,
- print_sep = None, print_alphabet = None, print_max_terms = None, show_prec=None, check = True):
+ print_sep = None, print_alphabet = None, print_max_terms = None, show_prec=None, check = True, label=None):
"""
Creates a key from input parameters for ``Qp``.
<