Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Add e() and f() for relative p-adic extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Sep 12, 2019
1 parent 2b29e92 commit e6b9e74
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
48 changes: 45 additions & 3 deletions src/sage/rings/padics/extension_parent.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
"""
General extensions of p-adic rings and fields; the base ring may also be an extension.
r"""
General extensions of p-adic rings and fields; the base ring may also be an
extension.
These are implemented as proxy parents, backed by an absolute extension.
"""
#*****************************************************************************
# Copyright (C) 2019 David Roe <roed.math@gmail.com>
# Julian Rüth <julian.rueth@fsfe.org>
#
# 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.
#
# http://www.gnu.org/licenses/
#*****************************************************************************

from sage.misc.cachefunc import cached_method
from .extension_element import pAdicGenericExtensionElement
Expand All @@ -13,13 +24,44 @@ class pAdicGeneralExtension(AlgebraFromMorphism, pAdicExtensionGeneric):
def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, implementation='FLINT'):
self._exact_modulus = exact_modulus
self._shift_seed = shift_seed
self._implementation = 'General'
self._implementation = 'proxy'
defining_morphism = None # NotImplementedError
AlgebraFromMorphism.__init__(self, defining_morphism, False)
pAdicGeneric.__init__(self, poly, prec, print_mode, names, pAdicGenericExtensionElement)
# Fix the following
self._gen = None

@cached_method
def f(self):
r"""
Return the residual degree of this ring over its base ring.
EXAMPLES::
sage: L.<a> = Qp(2).extension(x^2 + 2*x + 4)
sage: L.f()
2
"""
v = self.base_ring().valuation()
w = v.mac_lane_approximants(self.modulus(), assume_squarefree=True, require_final_EF=True)
if len(w) != 1:
raise ValueError("defining polynomial is not irreducible")
return w[0].F()

def e(self):
r"""
Return the ramification degree of this ring over its base ring.
EXAMPLES::
sage: L.<a> = Qp(2).extension(x^2 + 2*x + 4)
sage: L.e()
1
"""
return self.relative_degree() // self.f()

def teichmuller(self, x, prec=None):
R = self._backend()
x = R(x) if prec is None else R(x, prec)
Expand Down
2 changes: 0 additions & 2 deletions src/sage/rings/padics/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3084,8 +3084,6 @@ def create_object(self, version, key, approx_modulus=None, shift_seed=None):

if show_prec is None:
show_prec = base._printer._show_prec()
if polytype == 'p':
raise NotImplementedError("Extensions by general polynomials not yet supported. Please use an unramified or Eisenstein polynomial.")
T = ext_table[polytype, type(base.ground_ring_of_tower()).__base__]
return T(exact_modulus, approx_modulus, prec,
{'mode': print_mode, 'pos': print_pos, 'sep': print_sep, 'alphabet': print_alphabet,
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/relative_extension_leaves.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
Relative extensions of `p`-adic rings
We represent general extensions of p-adic rings as a two-step extension:
Expand Down

0 comments on commit e6b9e74

Please sign in to comment.