4.13.1.1 pAdicField Objects

class pAdicField
Field Q_p of p-adic numbers.
pAdicField( p)

Instances of class pAdicField have the following methods (in addition to inherited methods and special methods):

characteristic,$  $ is_field,$  $ prime,$  $ print_prec,$  $ random,$  $ residue_characteristic,$  $ residue_class_field

These methods are defined as follows:

characteristic( )
The characteristic of the field Qp, which is always 0.
sage: K = Qp(7)
sage: K.characteristic()
0

is_field( )
This function always returns true, because Qp is a field.
sage: K = Qp(7)
sage: K.is_field()
True

prime( )
The prime p such that this is the field Qp.
sage: K = Qp(7)
sage: K.prime()
7

print_prec( [n=None])

If you call print_prec(n), then printing of elements in this p-adic field is truncated at $ O(p^n)$ . Calling print_prec() with no arguments returns n. This command only affects printing, and does not alter the actual values of elements of this field.

random( [prec=10])
A random integral element of Q_p to precision O(p**prec).

residue_characteristic( )
The characteristic of the residue class field Qp.
sage: K = Qp(7)
sage: K.residue_characteristic()
7

residue_class_field( )
The residue class field of the ring Zp of integers of Qp, i.e., the field Z/pZ.
sage: K = Qp(3)
sage: K.residue_class_field()
Ring of integers modulo 3

See About this document... for information on suggesting changes.