| Home | Trees | Indices | Help |
|---|
|
|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
ext_table =
|
|||
padic_field_cache =
|
|||
twenty = 20
|
|||
forty = 40
|
|||
padic_ring_cache =
|
|||
extension_cache =
|
|||
|
|||
A creation function for p-adic fields.
INPUT:
p -- integer: the p in Q_p
prec -- integer (default: 20) the precision cap of the field. Individual elements keep track of their own precision.
type -- string (default: 'capped-rel') see Notes
print_mode -- string (default: None) the print mode
halt -- currently irrelevant
check -- bool (default True) whether to check if p is prime. Non-prime input may cause seg-faults (but can also be useful for base n expansions for example)
OUTPUT:
the corresponding p-adic field
EXAMPLES:
sage: K = Qp(5); a = K(4); a
4 + O(5^20)
sage: K = Qp(15, check=False); a = K(999); a
9 + 6*15 + 4*15^2 + O(15^20)
NOTES:
values of type:
'capped-rel' -> pAdicFieldCappedRelative. This is the default, considers precision as the precision of the unit part. Tracks precision of individual elements, but bounds the precision of any element with a precision cap.
'lazy' -> pAdicFieldLazy. Uses lazy elements so that additional precision can be requested during a computation. There is some amount of performance penalty because of this ability.
values of print_mode:
Leaving print_mode as None uses the global default print mode. Other allowable values are:
'val-unit' -- elements are displayed as p^k*u
'terse' -- elements are displayed as an integer in base 10 or the quotient of an integer by a power of p (still in base 10)
'series' -- elements are displayed as series in p
'digits' -- elements are displayed as a string of base p digits
'bars' -- elements are displayed as a string of base p digits with separators
For more details and more control, see sage.rings.padics.padic_printing or look at padic_printing.<tab> from the command line.
|
Given a prime power q = p^n, return the unique unramified extension
of Qp of degree n.
Currently, there's no code for unramified field extensions, so
we just return the UnramifiedRingExtension.
values of print_mode:
Leaving print_mode as None uses the global default print mode. Other allowable values are:
'val-unit' -- elements are displayed as p^k*u
'terse' -- elements are displayed as an integer in base 10 or the quotient of an integer by a power of p (still in base 10)
'series' -- elements are displayed as series in p
'digits' -- elements are displayed as a string of base p digits
'bars' -- elements are displayed as a string of base p digits with separators
For more details and more control, see sage.rings.padics.padic_printing or look at padic_printing.<tab> from the command line.
|
Return a model of the $p$-adic integer $\Z_p$.
INPUT:
p -- integer the p in Z_p
prec -- integer (default: 20) the precision cap of the ring.
Except for the fixed modulus case, individual elements keep
track of their own precision.
type -- string (default: 'capped-rel') see notes section below for options.
print_mode -- string (default: series) the print mode; see notes section
below for options.
halt -- integer (default: 40): only applicable for type='lazy'
check -- bool (default: True): wether to verify that the input is valid.
Non-prime p may cause seg-faults (but can also be useful for base n expansions for example)
OUTPUT:
the corresponding p-adic ring
EXAMPLES:
We create rings with various parameters
sage: Zp(7)
7-adic Ring with capped relative precision 20
sage: Zp(9)
Traceback (most recent call last):
...
ValueError: p must be prime
sage: Zp(17, 5)
17-adic Ring with capped relative precision 5
sage: Zp(17, 5)(-1)
16 + 16*17 + 16*17^2 + 16*17^3 + 16*17^4 + O(17^5)
It works even with a fairly huge cap:
sage: Zp(next_prime(10^50), 100000)
100000000000000000000000000000000000000000000000151-adic Ring with capped relative precision 100000
We create each type of ring:
sage: Zp(7, 20, 'capped-rel')
7-adic Ring with capped relative precision 20
sage: Zp(7, 20, 'fixed-mod')
7-adic Ring of fixed modulus 7^20
sage: Zp(7, 20, 'capped-abs')
7-adic Ring with capped absolute precision 20
#sage: Zp(7, 20, 'lazy')
#Lazy 7-adic Ring
We create a capped relative ring with each print mode:
sage: k = Zp(7, 8, print_mode='series'); k
7-adic Ring with capped relative precision 8
sage: k(7*(19))
5*7 + 2*7^2 + O(7^9)
sage: k(7*(-19))
2*7 + 4*7^2 + 6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 + 6*7^7 + 6*7^8 + O(7^9)
sage: k = Zp(7, print_mode='val-unit'); k
7-adic Ring with capped relative precision 20
sage: k(7*(19))
7 * 19 + O(7^21)
sage: k(7*(-19))
7 * 79792266297611982 + O(7^21)
sage: k = Zp(7, print_mode='terse'); k
7-adic Ring with capped relative precision 20
sage: k(7*(19))
133 + O(7^21)
sage: k(7*(-19))
558545864083283874 + O(7^21)
Note that $p$-adic rings are cached (via weak references):
sage: a = Zp(7); b = Zp(7)
sage: a is b
True
We create some elements in various rings:
sage: R = Zp(5); a = R(4); a
4 + O(5^20)
sage: S = Zp(5, 10, type = 'capped-abs'); b = S(2); b
2 + O(5^10)
sage: a + b
1 + 5 + O(5^10)
We allow non-prime p, but only if check = False. Note that some features will not work.
sage: K = Qp(15, check=False); a = K(999); a
9 + 6*15 + 4*15^2 + O(15^20)
NOTES:
type -- string (default: 'capped-rel'), the type of p-adic ring.
'capped-rel' -- pAdicRingCappedRelative. This is the
default, considers precision as the
precision of the unit part. Tracks
precision of individual elements, but
bounds the precision of any element with a
precision cap.
'fixed-mod' -- pAdicRingFixedMod. This is basically a
wrapper around $\Z / p^n \Z$, adding
functions appropriate to p-adics. This is
the fastest option.
'capped-abs' -- pAdicRingCappedAbsolute. The same as
pAdicRingFixedMod, but keeps track of
precision.
'lazy' -- pAdicRingLazy. Uses lazy elements so that
additional precision can be requested during a
computation. There is some amount of performance
penalty because of this ability.
print_mode -- string (default: None)
Leaving print_mode as None uses the global default print mode. Other allowable values are:
'val-unit' -- elements are displayed as p^k*u
'terse' -- elements are displayed as an integer in base 10
'series' -- elements are displayed as series in p
'digits' -- elements are displayed as a string of base p digits
'bars' -- elements are displayed as a string of base p digits with separators
For more details and more control, see sage.rings.padics.padic_printing or look at padic_printing.<tab> from the command line.
|
Return an unramified extension of $\Z_p$.
INPUT:
q -- prime power
prec -- integer (default: 20)
type -- string (default: 'capped-abs'); see the documentation for Zp
modulus -- polynomial (default: None)
names -- tuple
print_mode -- string (default: None); see the documentation for Zp
halt -- integer (default: 40): only applicable for type='lazy'
zp_name -- string (default: None): a name for the underlying Zp's prime
check -- bool (default: True): whether to verify that the input is valid.
OUTPUT:
-- an unramified extension of Z_p
EXAMPLES:
sage: k.<a> = Zq(4); k
Unramified Extension of 2-adic Ring with capped absolute precision 20
in a defined by (1 + O(2^20))*x^2 + (1 + O(2^20))*x + (1 + O(2^20))
sage: k.<a> = Zq(3^10); k
Unramified Extension of 3-adic Ring with capped absolute precision 20 in a
defined by (1 + O(3^20))*x^10 + (2 + O(3^20))*x^6 + (2 + O(3^20))*x^5 +
(2 + O(3^20))*x^4 + (1 + O(3^20))*x + (2 + O(3^20))
|
|
|||
ext_table
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:28 2008 | http://epydoc.sourceforge.net |