summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Caruso <xavier.caruso@univ-rennes1.fr>2017-08-02 01:43:20 +0200
committerXavier Caruso <xavier.caruso@univ-rennes1.fr>2017-08-02 01:43:20 +0200
commit858492b4b0cd87dfb63fba0f3ad239801b98cb62 (patch)
tree23edca6d6222719b80a422f9cdd497dd368a78ee
parentFirst more-or-less working implementation (diff)
Second rough implementation of lattice precision
-rw-r--r--src/sage/rings/padics/all.py6
-rw-r--r--src/sage/rings/padics/factory.py393
-rw-r--r--src/sage/rings/padics/lattice_precision.py832
-rw-r--r--src/sage/rings/padics/padic_base_generic.py6
-rw-r--r--src/sage/rings/padics/padic_base_leaves.py191
-rw-r--r--src/sage/rings/padics/padic_lattice_element.py201
-rw-r--r--src/sage/rings/padics/padic_printing.pyx7
7 files changed, 1312 insertions, 324 deletions
diff --git a/src/sage/rings/padics/all.py b/src/sage/rings/padics/all.py
index 9665553..0ca7080 100644
--- a/src/sage/rings/padics/all.py
+++ b/src/sage/rings/padics/all.py
@@ -1,11 +1,9 @@
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
from .pow_computer_ext import PowComputer_ext_maker
from .discrete_value_group import DiscreteValueGroup
-
-from .lattice_precision import ZpLP
diff --git a/src/sage/rings/padics/factory.py b/src/sage/rings/padics/factory.py
index 41fc26b..332bf60 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
######################################################
@@ -70,7 +72,7 @@ ext_table['u', pAdicFieldFloatingPoint] = UnramifiedExtensionFieldFloatingPoint
#ext_table['u', pAdicRingLazy] = UnramifiedExtensionRingLazy
-def get_key_base(p, prec, type, print_mode, halt, names, ram_name, print_pos, print_sep, print_alphabet, print_max_terms, check, valid_non_lazy_types):
+def get_key_base(p, prec, type, print_mode, halt, names, ram_name, print_pos, print_sep, print_alphabet, print_max_terms, check, valid_non_lazy_types, label=None):
"""
This implements create_key for Zp and Qp: moving it here prevents code duplication.
@@ -80,9 +82,18 @@ def get_key_base(p, prec, type, print_mode, halt, names, ram_name, print_pos, pr
sage: from sage.rings.padics.factory import get_key_base
sage: get_key_base(11, 5, 'capped-rel', None, 0, None, None, None, ':', None, None, True, ['capped-rel'])
- (11, 5, 'capped-rel', 'series', '11', True, '|', (), -1)
+ (11, 5, 'capped-rel', 'series', '11', True, '|', (), -1, None)
sage: get_key_base(12, 5, 'capped-rel', 'digits', 0, None, None, None, None, None, None, False, ['capped-rel'])
- (12, 5, 'capped-rel', 'digits', '12', True, '|', ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'), -1)
+ (12,
+ 5,
+ 'capped-rel',
+ 'digits',
+ '12',
+ True,
+ '|',
+ ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'),
+ -1,
+ None)
"""
if check:
if not isinstance(p, Integer):
@@ -157,9 +168,9 @@ def get_key_base(p, prec, type, print_mode, halt, names, ram_name, print_pos, pr
else:
name = str(names)
if type in valid_non_lazy_types:
- key = (p, prec, type, print_mode, name, print_pos, print_sep, tuple(print_alphabet), print_max_terms)
+ key = (p, prec, type, print_mode, name, print_pos, print_sep, tuple(print_alphabet), print_max_terms, label)
elif type == 'lazy':
- key = (p, prec, halt, print_mode, name, print_pos, print_sep, tuple(print_alphabet), print_max_terms)
+ key = (p, prec, halt, print_mode, name, print_pos, print_sep, tuple(print_alphabet), print_max_terms, label)
else:
print(type)
raise ValueError("type must be %s or lazy"%(", ".join(valid_non_lazy_types)))
@@ -471,7 +482,7 @@ class Qp_class(UniqueFactory):
"""
def create_key(self, p, prec = DEFAULT_PREC, type = 'capped-rel', print_mode = None,
halt = DEFAUL