Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.rings.{padics,valuation}: Modularization fixes, # needs #36052

Merged
12 changes: 6 additions & 6 deletions src/sage/rings/padics/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,10 +975,10 @@ def Qq(q, prec=None, type='capped-rel', modulus=None, names=None,

2. The modulus can also be given as a **symbolic expression**. ::

sage: x = var('x')
sage: X.<a> = Qq(27, modulus = x^3 + 2*x + 1); X.modulus()
sage: x = var('x') # needs sage.symbolic
sage: X.<a> = Qq(27, modulus = x^3 + 2*x + 1); X.modulus() # needs sage.symbolic
(1 + O(3^20))*x^3 + O(3^20)*x^2 + (2 + O(3^20))*x + 1 + O(3^20)
sage: X == R
sage: X == R # needs sage.symbolic
True

By default, the polynomial chosen is the standard lift of the
Expand Down Expand Up @@ -2225,10 +2225,10 @@ def Zq(q, prec=None, type='capped-rel', modulus=None, names=None,

2. The modulus can also be given as a **symbolic expression**. ::

sage: x = var('x')
sage: X.<a> = Zq(27, modulus = x^3 + 2*x + 1); X.modulus()
sage: x = var('x') # needs sage.symbolic
sage: X.<a> = Zq(27, modulus = x^3 + 2*x + 1); X.modulus() # needs sage.symbolic
(1 + O(3^20))*x^3 + O(3^20)*x^2 + (2 + O(3^20))*x + 1 + O(3^20)
sage: X == R
sage: X == R # needs sage.symbolic
True

By default, the polynomial chosen is the standard lift of the
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/local_generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage.doctest: optional - sage.rings.padics
# sage.doctest: needs sage.rings.padics
r"""
Local Generic

Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/local_generic_element.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage.doctest: optional - sage.rings.padics
# sage.doctest: needs sage.rings.padics
"""
Local Generic Element

Expand Down
10 changes: 5 additions & 5 deletions src/sage/rings/padics/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,25 @@ def gauss_sum(a, p, f, prec=20, factored=False, algorithm='pari', parent=None):
In this example, we verify that `g_3(0) = -1`::

sage: from sage.rings.padics.misc import gauss_sum
sage: -gauss_sum(0, 3, 1) # optional - sage.rings.padics
sage: -gauss_sum(0, 3, 1) # needs sage.rings.padics
1 + O(pi^40)

Next, we verify that `g_5(a) g_5(-a) = 5 (-1)^a`::

sage: from sage.rings.padics.misc import gauss_sum
sage: gauss_sum(2,5,1)^2 - 5 # optional - sage.rings.padics
sage: gauss_sum(2,5,1)^2 - 5 # needs sage.rings.padics
O(pi^84)
sage: gauss_sum(1,5,1)*gauss_sum(3,5,1) + 5 # optional - sage.rings.padics
sage: gauss_sum(1,5,1)*gauss_sum(3,5,1) + 5 # needs sage.rings.padics
O(pi^84)

Finally, we compute a non-trivial value::

sage: from sage.rings.padics.misc import gauss_sum
sage: gauss_sum(2,13,2) # optional - sage.rings.padics
sage: gauss_sum(2,13,2) # needs sage.rings.padics
6*pi^2 + 7*pi^14 + 11*pi^26 + 3*pi^62 + 6*pi^74 + 3*pi^86 + 5*pi^98 +
pi^110 + 7*pi^134 + 9*pi^146 + 4*pi^158 + 6*pi^170 + 4*pi^194 +
pi^206 + 6*pi^218 + 9*pi^230 + O(pi^242)
sage: gauss_sum(2,13,2, prec=5, factored=True) # optional - sage.rings.padics
sage: gauss_sum(2,13,2, prec=5, factored=True) # needs sage.rings.padics
(2, 6 + 6*13 + 10*13^2 + O(13^5))

.. SEEALSO::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/padics/padic_base_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ def plot(self, max_points=2500, **args):

EXAMPLES::

sage: Zp(3).plot()
sage: Zp(3).plot() # needs sage.plot
Graphics object consisting of 1 graphics primitive
sage: Zp(5).plot(max_points=625)
sage: Zp(5).plot(max_points=625) # needs sage.plot
Graphics object consisting of 1 graphics primitive
sage: Zp(23).plot(rgbcolor=(1,0,0))
sage: Zp(23).plot(rgbcolor=(1,0,0)) # needs sage.plot
Graphics object consisting of 1 graphics primitive
"""
if 'pointsize' not in args:
Expand Down
7 changes: 5 additions & 2 deletions src/sage/rings/padics/padic_generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage.doctest: optional - sage.rings.padics
# sage.doctest: needs sage.rings.padics
r"""
`p`-adic Generic

Expand Down Expand Up @@ -36,7 +36,6 @@
from sage.rings.ring import PrincipalIdealDomain
from sage.rings.integer import Integer
from sage.rings.infinity import Infinity
from sage.rings.padics.padic_printing import pAdicPrinter
from sage.rings.padics.precision_error import PrecisionError
from sage.misc.cachefunc import cached_method
from sage.structure.richcmp import richcmp_not_equal
Expand All @@ -59,6 +58,8 @@ def __init__(self, base, p, prec, print_mode, names, element_class, category=Non

sage: R = Zp(17) # indirect doctest
"""
from sage.rings.padics.padic_printing import pAdicPrinter

if category is None:
if self.is_field():
category = Fields()
Expand Down Expand Up @@ -1896,6 +1897,8 @@ def local_print_mode(obj, print_options, pos=None, ram_name=None):

For more documentation see :class:`sage.structure.parent_gens.localvars`.
"""
from sage.rings.padics.padic_printing import pAdicPrinter

if isinstance(print_options, str):
print_options = {'mode': print_options}
elif not isinstance(print_options, dict):
Expand Down
9 changes: 5 additions & 4 deletions src/sage/rings/padics/padic_lattice_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
sage: R3 = QpLC(2)
sage: R4 = QpLF(2)

sage: TestSuite(R1).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
sage: TestSuite(R2).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
sage: TestSuite(R3).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
sage: TestSuite(R4).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time
sage: # long time
sage: TestSuite(R1).run(skip=['_test_teichmuller', '_test_matrix_smith'])
sage: TestSuite(R2).run(skip=['_test_teichmuller', '_test_matrix_smith'])
sage: TestSuite(R3).run(skip=['_test_teichmuller', '_test_matrix_smith'])
sage: TestSuite(R4).run(skip=['_test_teichmuller', '_test_matrix_smith'])
"""

# ****************************************************************************
Expand Down
Loading
Loading