Ring of pari objects

AUTHORS:

  • William Stein (2004): Initial version.

  • Simon King (2011-08-24): Use UniqueRepresentation, element_class and proper initialisation of elements.

class sage.rings.pari_ring.Pari(x, parent=None)

Bases: sage.structure.element.RingElement

Element of Pari pseudo-ring.

class sage.rings.pari_ring.PariRing

Bases: sage.misc.fast_methods.Singleton, sage.rings.ring.Ring

EXAMPLES:

sage: R = PariRing(); R
Pseudoring of all PARI objects.
sage: loads(R.dumps()) is R
True
Element

alias of Pari

characteristic()
is_field(proof=True)
random_element(x=None, y=None, distribution=None)

Return a random integer in Pari.

Note

The given arguments are passed to ZZ.random_element(...).

INPUT:

  • \(x\), \(y\) – optional integers, that are lower and upper bound for the result. If only \(x\) is provided, then the result is between 0 and \(x-1\), inclusive. If both are provided, then the result is between \(x\) and \(y-1\), inclusive.

  • \(distribution\) – optional string, so that ZZ can make sense of it as a probability distribution.

EXAMPLES:

sage: R = PariRing()
sage: R.random_element().parent() is R
True
sage: R(5) <= R.random_element(5,13) < R(13)
True
sage: R.random_element(distribution="1/n").parent() is R
True
zeta()

Return -1.

EXAMPLES:

sage: R = PariRing()
sage: R.zeta()
-1