Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Dynamical creation of Mersenne twisters

Project Description

This module is a thin Python wrapper over C library dcmt, created by Makoto Matsumoto and Takuji Nishimura, authors of Mersenne twister RNG algorithm. The original library provides functions for creating multiple independent RNGs (which can be used, for example, in parallel Monte-Carlo simulations).

The package contains intact dcmt sources (except for example folder) and exports some functions and structures from its API. For licensing on original library and other information please see the link above, or src/dcmt/README file and sources.

The version of the module corresponds to the version of original library, with the addition of the build number. For example, the wrapper on top of dcmt 0.6.1 may have version like 0.6.1-10. Module documentation can be found here


0.6.1-5 (in development)

  • Fix issues with setuptools/distutils (one of them does not support Cython, other does not support Sphinx)

0.6.1-4 (in development)

  • Fixed bug when mt_range() return ‘common’ parameters dict with non-common parameters included;
  • Fixed bug when DcmtRandomState.rand() returned array instead of Python float;
  • Added raw integer randoms generation to DcmtRandomState;
  • Added ‘inplace’ function to fill provided numpy array with randoms


  • Using slightly optimized random number generation taken from numpy 1.5.1;
  • Module is rewritten using Cython;
  • Exporting analogues of Python standard random.Random and numpy’s numpy.random.mtrand.RandomState;
  • Renamed create_mts to mt_range, which now returns dictionary and numpy array instead of ctypes structures;


  • Shortened function names: create_mts(), init_mt()
  • Removed get_random() and added rand(), which returns numpy array
  • Added create_mts_stripped(), currently as a ‘half-documented’ feature


  • Three basic functions: create_generators(), init_generator() and get_random() (returns integer)
Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dcmt-0.6.1-4.tar.gz (100.7 kB) Copy SHA256 Checksum SHA256 Source May 27, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting