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

Commit

Permalink
use RingExtensionWithBasis for general p-adic extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Sep 12, 2019
1 parent abae222 commit fa57ca1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
15 changes: 13 additions & 2 deletions src/sage/rings/padics/extension_element.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
# -*- coding: utf-8 -*-
"""
Elements of general extensions of p-adic rings and fields; the base ring may also be an extension.
These are implemented as proxy elements, 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 copy import deepcopy
from sage.rings.infinity import infinity
from sage.rings.integer import Integer
from sage.rings.rational import Rational
from sage.rings.morphism import RingHomomorphism
from sage.structure.element import AlgebraFMElement
from sage.rings.ring_extension_element import RingExtensionElement
from .padic_generic_element import pAdicGenericElement

class pAdicGeneralExtensionElement(AlgebraFMElement, pAdicGenericElement):
class pAdicGeneralExtensionElement(RingExtensionElement, pAdicGenericElement):
# We start with the interesting functions; need to port these to two step extensions
def polynomial(self, var='x'):
raise NotImplementedError
Expand Down
8 changes: 5 additions & 3 deletions src/sage/rings/padics/extension_parent.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
r"""
General extensions of p-adic rings and fields; the base ring may also be an
extension.
Expand All @@ -16,17 +17,18 @@
#*****************************************************************************

from sage.misc.cachefunc import cached_method
from .extension_element import pAdicGenericExtensionElement
from .extension_element import pAdicGeneralExtensionElement
from .padic_extension_generic import pAdicExtensionGeneric
from sage.rings.ring_extension import RingExtensionWithBasis

# NotImplementedError: AlgebraFromMorphism shouldn't inherit from UniqueRepresentation
class pAdicGeneralExtension(AlgebraFromMorphism, pAdicExtensionGeneric):
class pAdicGeneralExtension(RingExtensionWithBasis, 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 = 'proxy'
defining_morphism = None # NotImplementedError
AlgebraFromMorphism.__init__(self, defining_morphism, False)
RingExtensionWithBasis.__init__(self, defining_morphism, False)
pAdicGeneric.__init__(self, poly, prec, print_mode, names, pAdicGenericExtensionElement)
# Fix the following
self._gen = None
Expand Down
11 changes: 7 additions & 4 deletions src/sage/rings/padics/factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
r"""
Factory
Expand All @@ -20,6 +21,7 @@
#*****************************************************************************
# Copyright (C) 2007-2013 David Roe <roed.math@gmail.com>
# William Stein <wstein@gmail.com>
# 2019 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
Expand Down Expand Up @@ -57,6 +59,7 @@

from .padic_extension_leaves import *
from .relative_extension_leaves import *
from .extension_parent import pAdicGeneralExtension
from functools import reduce
#This imports all of the classes used in the ext_table below.

Expand All @@ -67,10 +70,10 @@
ext_table['e', pAdicRingFixedMod] = EisensteinExtensionRingFixedMod
#ext_table['e', pAdicRingFloatingPoint] = EisensteinExtensionRingFloatingPoint
#ext_table['e', pAdicFieldFloatingPoint] = EisensteinExtensionFieldFloatingPoint
#ext_table['p', pAdicFieldCappedRelative] = pAdicGeneralExtensionFieldCappedRelative
#ext_table['p', pAdicRingCappedAbsolute] = pAdicGeneralExtensionRingCappedAbsolute
#ext_table['p', pAdicRingCappedRelative] = pAdicGeneralExtensionRingCappedRelative
#ext_table['p', pAdicRingFixedMod] = pAdicGeneralExtensionRingFixedMod
ext_table['p', pAdicFieldCappedRelative] = pAdicGeneralExtension
ext_table['p', pAdicRingCappedAbsolute] = pAdicGeneralExtension
ext_table['p', pAdicRingCappedRelative] = pAdicGeneralExtension
ext_table['p', pAdicRingFixedMod] = pAdicGeneralExtension
ext_table['u', pAdicFieldCappedRelative] = UnramifiedExtensionFieldCappedRelative
ext_table['u', pAdicRingCappedAbsolute] = UnramifiedExtensionRingCappedAbsolute
ext_table['u', pAdicRingCappedRelative] = UnramifiedExtensionRingCappedRelative
Expand Down

0 comments on commit fa57ca1

Please sign in to comment.