Tenokonda Low Discrepancy Sequences
Project description
tklds
In this repository, we present the ‘tkrg-a-ap5’ direction numbers for generating Sobol sequences satisfying properties A and A’ as well as a comprehensive set of benchmark test functions from literature that can be used for evaluating low discrepancy sequence quality. The repository accompanies the paper:
The set of direction numbers tkrg-a-ap5 satisfying property A for all 50,000 dimensions and A’ for five adjacent
dimensions can be found in tklds/direction_numbers/tkrgsobol_a_ap5_50000
Quasi Monte Carlo Methods
Monte Carlo methods lie at the heart of many numeric computing tasks ranging from modelling how high velocity ions impinge on an atomic lattice to the pricing of a financial instruments such as stocks and options. While being generic and scaling independently of problem dimension, practical applications of Monte-Carlo suffers from the slow convergence rate imposed by the O(N-1/2) for N samples, thus requiring large numbers of simulations to achieve a desired level of accuracy. Quasi-Monte Carlo integration replaces the pseudo-random sequences with deterministic ‘low discrepancy’ sequences having greater uniformity and produce error convergence rates of order O(N-1) to O(N-3/2) on suitable problem types. While the asymptotically faster convergence rates of QMC methods may at first be appealing, the use of QMC and low discrepancy sequences carry with them a set of caveats and pathologies that if not addressed are likely to lead to incorrect results when applied in practice.
Installing
Install the project from pypi using pip install tklds
Or by cloning this repository and pip installing them:
https://github.com/TENOKONDA/tklds
Clone tklds from github
git clone https://github.com/TENOKONDA/tklds.gitInstall the requirements using
python -m pip install -r requirements.txtfrom the repository folderInstall the project by calling
python -m pip install tkldsfrom the repository folder.
Quickstart
To generate uniform floating point values in the range [0,1] use the following snippet:
>>> from tklds.interface.generators import generate_lds_rvs >>> from tklds.constant import SequenceNum >>> u = generate_lds_rvs(sequence=SequenceNum.TKRG_A_AP5, n=1024, d=5, skip=0)
Here we generate a total of n=1024 points with each point having d=5 dimensions using the
sequence generated by the sequence_name=tkrg-a-ap5 direction numbers, without skipping the first point
(skip=0).
Examples
Some examples can be found in the notebooks folder:
Integral benchmark test functions: notebooks/02_integral.ipynb
Spurious variance: notebooks/05_spurious_variance.ipynb
Brownian motion: notebooks/06_brownian_motion.ipynb
Sobol random generator: notebooks/07_sobol_engine_examples.ipynb
Direction Numbers
Folder tklds/direction_numbers contains the direction numbers used to initialize the Sobol sequences
tkrgsobol_a_ap5_50000
- This set of direction numbers has 50,000 dimensions, satisfying:
Property A for all dimensions
Property A’ for 5 adjacent dimensions
For further details on their generation and the properties A and A’ see:
new-joe-kuo-6.21201
These contain 21,201 dimensions. Their generation is described in:
Joe and F. Y. Kuo, Constructing Sobol sequences with better two-dimensional projections, SIAM J. Sci. Comput. 30, 2635-2654 (2008).
Further details about these direction numbers and an alternative download source is available at:
https://web.maths.unsw.edu.au/~fkuo/sobol/index.html
[Direct download: https://web.maths.unsw.edu.au/~fkuo/sobol/new-joe-kuo-6.21201 ]
File format
Both files follow the same format, the columns of the file:
d - the index of the dimension. Note that the smallest value is 2, as the first dimension is implicit.
s - the degree of the primitive polynomial
a - the primitive polynomial coefficients represented in terms of an integer value
m_i - the direction numbers of the dimension
For a description of the terms and underlying theory of low discrepancy sequences consult the publication:.
Citation
If you use this codebase, please cite our work using the following reference:
Oliva Denis, Andres and Kell, Gregory and Manyakin, Ilya and Papaioannou, Adrien,
On the Generation of Direction Numbers for Sobol Sequences and their Application to Quasi Monte Carlo Methods
(June 02, 2025). Available at SSRN: https://ssrn.com/abstract=5283131 or http://dx.doi.org/10.2139/ssrn.5283131
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tklds-0.1.2.tar.gz.
File metadata
- Download URL: tklds-0.1.2.tar.gz
- Upload date:
- Size: 5.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6520a81a05c46e6da89ca891ede7ea17a7f52bc2c4de67ecb7d16544aa626cce
|
|
| MD5 |
22c0277ae64832ccdd40580f3df99aae
|
|
| BLAKE2b-256 |
90f770909db65baf4663488c4878c72294484ae3319f42bf409cf842874ae072
|
Provenance
The following attestation bundles were made for tklds-0.1.2.tar.gz:
Publisher:
workflow.yml on TENOKONDA/tklds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tklds-0.1.2.tar.gz -
Subject digest:
6520a81a05c46e6da89ca891ede7ea17a7f52bc2c4de67ecb7d16544aa626cce - Sigstore transparency entry: 269995576
- Sigstore integration time:
-
Permalink:
TENOKONDA/tklds@8d75d76d4b1999ad5349ea1527dde790d1acd113 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/TENOKONDA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@8d75d76d4b1999ad5349ea1527dde790d1acd113 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tklds-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tklds-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ec1e11d8f7dcb20380f9b8194cdd00042175f5165e3dd846394b89a08fed160
|
|
| MD5 |
9db0ee0a7208ee55fa85f6a2878a42d3
|
|
| BLAKE2b-256 |
389f0a8a3740152996f56c97c509666b463d79447ee1c599fba4df1adf2c673c
|
Provenance
The following attestation bundles were made for tklds-0.1.2-py3-none-any.whl:
Publisher:
workflow.yml on TENOKONDA/tklds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tklds-0.1.2-py3-none-any.whl -
Subject digest:
2ec1e11d8f7dcb20380f9b8194cdd00042175f5165e3dd846394b89a08fed160 - Sigstore transparency entry: 269995586
- Sigstore integration time:
-
Permalink:
TENOKONDA/tklds@8d75d76d4b1999ad5349ea1527dde790d1acd113 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/TENOKONDA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@8d75d76d4b1999ad5349ea1527dde790d1acd113 -
Trigger Event:
push
-
Statement type: