You might read the (very good) documentation and code in
sage/misc/randstate.pyx.
I just noticed that this file has not been converted to rest, so it is
not in the reference manual. Ouch; it has such nice documentation!
Thanks,
Jason
--
Jason Grout
If you look at the sources for the random module in Python you'll see
that this essentially can't be done -- it's all declared static in the C
file creating the "_random" module.
Of course, if it is for some reason *very* important to have the Python
RNG, you could copy&paste the source code from Python. Then you have
full control. (But I think you could probably just as well use another
of Sage's PRNG).
Then there's NumPy's PRNG (yet another one) where you can draw as many
numbers at the time as you wish in an array, then access them afterwards
using Cython's fast array access. Then the Python call is only done once
regardless of N (but you need enough memory...)
randnums = numpy.random.uniform(size=100000000)
--
Dag Sverre