mlqmcpy
Multilevel (quasi-)Monte Carlo methods in Python.
mlqmcpy provides iterators and example problems for estimating expectations with
Monte Carlo, quasi-Monte Carlo, multilevel Monte Carlo, and multilevel
quasi-Monte Carlo methods.
Installation
pip install mlqmcpy
Quick start
from mlqmcpy import GreedyMLQMCIterator
from mlqmcpy.problems.analytic import analytic
iterator = GreedyMLQMCIterator(2, error_tolerance=1e-2, seed=1234)
for new_samples in iterator:
new_results = {
level: analytic.ml(level, samples)
for level, samples in new_samples.items()
}
iterator.update(new_results)
print(iterator.mean)
print(iterator.standard_error)
Development
This project uses uv for dependency management.
As a library, mlqmcpy does not commit a lockfile; development and CI resolve
from pyproject.toml.
uv sync --group dev --refresh
uv run pytest
uv run ruff check mlqmcpy tests
uv run black --check mlqmcpy tests
uv run isort --check-only mlqmcpy tests
uv build
Releases are published from GitHub Releases through PyPI Trusted Publishing.
Configure the PyPI trusted publisher for repository PieterjanRobbe/mlqmcpy,
workflow .github/workflows/release.yml, and environment pypi.
Metadata
Release files for mlqmcpy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mlqmcpy-0.1.0.tar.gz | 35.3 kB | With provenance | Details for mlqmcpy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mlqmcpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mlqmcpy-0.1.0-py3-none-any.whl |
Total release size: 73.7 kB
Release files / mlqmcpy-0.1.0.tar.gz
| Download URL | mlqmcpy-0.1.0.tar.gz |
|---|---|
| Size | 35.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d769f5eed2cde37ee948acc7bb56de5945b7e5deedd860e11453cd671f09aac
|
|
BLAKE2b-256 checksum How to use checksums |
fd990bee0862ee16802242ea75c944b8f4d2183583f02e7532695589b43a4b52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logRelease files / mlqmcpy-0.1.0-py3-none-any.whl
| Download URL | mlqmcpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 38.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e6a32ae932833a42f4f392068a03b7449a8346d3386160abb6c4c7842c0422f
|
|
BLAKE2b-256 checksum How to use checksums |
378c4a5a5152d1020bd0cbeb039af5ab63fa99341e224cbd006c01f7b8d5b0bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logSecurity for mlqmcpy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mlqmcpy-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.