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()
-8
sage: R.random_element(5,13)
12
sage: [R.random_element(distribution="1/n") for _ in range(10)]
[0, 1, -1, 2, 1, -95, -1, -2, -12, 0]
zeta()

Return -1.

EXAMPLES:

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