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

Commit

Permalink
Merge branch 't/23331/allow_exact_defining_polynomials_for_p_adic_ext…
Browse files Browse the repository at this point in the history
…ensions' into t/20310/change_precision
  • Loading branch information
saraedum committed Jul 20, 2017
2 parents 39043f1 + 77779ea commit 6e2495f
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 111 deletions.
8 changes: 4 additions & 4 deletions src/sage/rings/padics/padic_extension_generic.py
Expand Up @@ -183,11 +183,11 @@ def defining_polynomial(self):
return self._given_poly

def exact_field(self):
"""
r"""
Return a number field with the same defining polynomial.
Note that this method always returns a field, even for
a p-adic ring.
Note that this method always returns a field, even for a `p`-adic
ring.
EXAMPLES::
Expand All @@ -206,7 +206,7 @@ def exact_field(self):
return self.base_ring().exact_field().extension(self._exact_modulus, self.variable_name())

def modulus(self, exact=False):
"""
r"""
Returns the polynomial defining this extension.
INPUT:
Expand Down
195 changes: 94 additions & 101 deletions src/sage/rings/padics/padic_extension_leaves.py
Expand Up @@ -100,21 +100,21 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Zp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while ``poly`` has coefficients in a `p`-adic ring.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- t polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name,
unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -153,26 +153,26 @@ class UnramifiedExtensionFieldCappedRelative(UnramifiedExtensionGeneric, pAdicCa
sage: TestSuite(R).run(skip='_test_log',max_runs=4)
"""
def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, implementation='FLINT'):
"""
r"""
A representation of Qq.
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Qp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with rational coefficients, for example,
while ``poly`` has coefficients in a `p`-adic field.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name,
unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -217,21 +217,21 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Zp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while poly has coefficients in a `p`-adic ring.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- A dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name,
unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -276,21 +276,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Qp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while ``poly`` has coefficients in a `p`-adic field.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -339,21 +338,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Zp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while ``poly`` has coefficients in Zp.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -388,21 +386,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Qp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with rational coefficients, for example,
while ``poly`` has coefficients in a `p`-adic field.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -439,21 +436,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Zp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while ``poly`` has coefficients in a `p`-adic ring.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -495,21 +491,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Qp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with rational coefficients, for example,
while ``poly`` has coefficients in a `p`-adic field.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -552,21 +547,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Zp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while ``poly`` has coefficients in a `p`-adic ring.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down Expand Up @@ -608,21 +602,20 @@ def __init__(self, exact_modulus, poly, prec, print_mode, shift_seed, names, imp
INPUT:
- exact_modulus -- The original polynomial defining the
extension. This could be a polynomial with integer
coefficients, for example, while poly has coefficients
in Zp.
- ``exact_modulus`` -- the original polynomial defining the extension.
This could be a polynomial with integer coefficients, for example,
while ``poly`` has coefficients in a `p`-adic ring.
- poly -- The polynomial with coefficients in
self.base_ring() defining this extension.
- ``poly`` -- the polynomial with coefficients in :meth:`base_ring`
defining this extension
- prec -- The precision cap of this ring.
- ``prec`` -- the precision cap of this ring
- print_mode -- A dictionary of print options.
- ``print_mode`` -- a dictionary of print options
- shift_seed -- unused
- ``shift_seed`` -- unused
- names -- a 4-tuple, (variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)
- ``names`` -- a 4-tuple, ``(variable_name, residue_name, unramified_subextension_variable_name, uniformizer_name)``
EXAMPLES::
Expand Down
8 changes: 2 additions & 6 deletions src/sage/rings/padics/padic_generic_element.pyx
Expand Up @@ -1495,7 +1495,7 @@ cdef class pAdicGenericElement(LocalGenericElement):

def rational_reconstruction(self):
r"""
Returns a rational approximation to this p-adic number
Returns a rational approximation to this `p`-adic number
This will raise an ArithmeticError if there are no valid
approximations to the unit part with numerator and
Expand All @@ -1505,10 +1505,6 @@ cdef class pAdicGenericElement(LocalGenericElement):
:meth:`_rational_`
INPUT:
- ``self`` -- a p-adic element
OUTPUT:
rational -- an approximation to self
Expand All @@ -1533,7 +1529,7 @@ cdef class pAdicGenericElement(LocalGenericElement):

def _rational_(self):
r"""
Return a rational approximation to this p-adic number.
Return a rational approximation to this `p`-adic number.
If there is no good rational approximation to the unit part,
will just return the integer approximation.
Expand Down

0 comments on commit 6e2495f

Please sign in to comment.