Skip to main content

Multilevel quasi-Monte Carlo in Python.

Project description

Tests

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.

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

mlqmcpy-0.1.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlqmcpy-0.1.0-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file mlqmcpy-0.1.0.tar.gz.

File metadata

  • Download URL: mlqmcpy-0.1.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlqmcpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d769f5eed2cde37ee948acc7bb56de5945b7e5deedd860e11453cd671f09aac
MD5 186b32ed12fa8b5ae0156aac617b09da
BLAKE2b-256 fd990bee0862ee16802242ea75c944b8f4d2183583f02e7532695589b43a4b52

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlqmcpy-0.1.0.tar.gz:

Publisher: release.yml on sandialabs/mlqmcpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mlqmcpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mlqmcpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlqmcpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e6a32ae932833a42f4f392068a03b7449a8346d3386160abb6c4c7842c0422f
MD5 20c546caa1c73e70d54836e0a7d07079
BLAKE2b-256 378c4a5a5152d1020bd0cbeb039af5ab63fa99341e224cbd006c01f7b8d5b0bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlqmcpy-0.1.0-py3-none-any.whl:

Publisher: release.yml on sandialabs/mlqmcpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page