[Numpy-discussion] SFMT (faster mersenne twister)

Robert Kern robert.kern at gmail.com
Fri Sep 5 18:42:09 EDT 2014

On Fri, Sep 5, 2014 at 9:36 PM, Sturla Molden <sturla.molden at gmail.com> wrote:
> On 05/09/14 19:19, Neal Becker wrote:
>  >> It's a variant of the standard MT rather than just an implementation
>  >> of it, so we can't just drop it in. You will need to build the
>  >> infrastructure to support multiple PRNGs first (or rather, build the
>  >> infrastructure to reuse the non-uniform distribution code with
>  >> multiple core PRNGs).
>  >
>  > You mean it's not backward compatible because it won't generate
> exactly the same
>  > sequence of output for a given seed, and therefore we wouldn't want
> to make that
>  > change?
> I thought he meant that the standard MT and SFMT have global states,
> whereas NumPy's randomkit MT does not. Because of this, NumPy allows you
> to use multiple RandomState instances. With a vanilla MT or SFMT there
> would be just one.

No, that is not what I meant. If the SFMT can be made to output the
same bitstream for the same seed, we can use it (modifying it if
necessary to avoid global state if necessary), but it does not look so
to me. I welcome corrections on that count (in PR form, preferably!).

Robert Kern

More information about the NumPy-Discussion mailing list