[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Operations on Structures

The following are a collection of functions which apply to p-adic rings and most apply to fields.

AssignNames(~P, S) : RngLoc, SeqEnum ->
AssignNames(~P, S) : FldLoc, SeqEnum ->
Assign names to the generators of P. The sequence can have at most two elements which must be strings. The first of these is assigned to the name of the prime. The second is effectively ignored (applicable only to local rings and fields).
Characteristic(P) : RngLoc -> RngIntElt
Characteristic(P) : FldLoc -> RngIntElt
The characteristic of the p-adic ring or field P.
#P : RngLoc -> RngIntElt
The number of elements in P if P is a finite precision ring. The cardinality of a p-adic field is infinite regardless of whether the field has finite precision.

Iterating over the elements of a p-adic ring is possible but it will take time in proportion to the cardinality of P. It is recommended only for "small" p-adic rings (precision must be very small for such a ring).

Name(P, k) : RngLoc, RngIntElt -> RngLocElt
Name(P, k) : FldLoc, RngIntElt -> FldLocElt
Return the kth generator of P.
ChangePrecision(P, r) : RngLoc, RngIntElt -> RngLoc
ChangePrecision(~P, r) : RngLoc, RngIntElt -> RngLoc
ChangePrecision(P, r) : FldLoc, RngIntElt -> FldLoc
ChangePrecision(~P, r) : FldLoc, RngIntElt -> FldLoc
Changes the maximum precision with which elements can be created to be r. The precision can be set to be infinite to gain a floating structure.
P1 eq P2 : RngLoc, RngLoc -> BoolElt
P1 eq P2 : FldLoc, FldLoc -> BoolElt
Returns whether or not the p-adic rings or fields are the same.
P1 ne P2 : RngLoc, RngLoc -> BoolElt
P1 ne P2 : FldLoc, FldLoc -> BoolElt
Returns whether or not the p-adic rings or fields are not the same.

Example RngPad_strop (H42E3)

In this example the same variables are used as for the previous example.

> ChangePrecision(Zp, Infinity());
5-adic Ring
> Zp;
5-adic Ring mod p^20
> #Zp;
95367431640625
> ChangePrecision( Zp, Infinity());
> AssignNames( Zp, ["pi"]);
> Zp.1;
5
> Zp`SeriesPrinting := true;
> Zp.1;
pi
> p;
p
> Zp eq ChangePrecision(Zp, 10);
false
> RingOfIntegers(FieldOfFractions(Zp)) ne Zp;
false
Note that p is an element of the original Zp with precision 20 which is why it retains its name to print with.
 [Next][Prev] [Right] [Left] [Up] [Index] [Root]