particles.qmc.sobol(N, dim, scrambled=1)[source]

Sobol sequence.

  • N (int) – length of sequence
  • dim (int) – dimension
  • scrambled (int) –

    which scrambling method to use:

    • 0: no scrambling
    • 1: Owen’s scrambling
    • 2: Faure-Tezuka
    • 3: Owen + Faure-Tezuka

Return type:

(N, dim) numpy array.


One of the argument of the underlying Fortran function is the seed for the random generator used for scrambling. We simply generate this seed uniformly (between 0 and 2^32 - 1). There is a very small number of seeds that generate points that are == 0 (This has been reported to the maintainer of randtoolbox). When this happens, we generate a warning and start over (i.e. we re-generate another random seed, and compute a new scrambled Sobol point set.