Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

qlroms

Quantized-local reduced-order models (qlROMs). The state space is partitioned into charts by k-means, each chart gets its own local POD basis, and an exact shared atlas stitches the charts into one global coordinate system. On that geometry, this package advances the local dynamics with qlGalerkin: an intrusive projection of the governing equations, one quadratic reduced system $\dot{\bm{a}} = \bm{b}_k + \mathbf{A}_k\bm{a} + \mathsf{B}_k(\bm{a},\bm{a})$ per chart, plus the transition maps that carry coordinates across chart boundaries. The QLModel adapter wraps a qlROM as a dynamodels Model, so it plugs directly into romda estimators and ntsa analysis.

Install

conda create -n qlroms python=3.11   # >=3.10
conda activate qlroms
pip install qlroms
pip install -e ".[dev]"   # development

Quickstart

import numpy as np
from qlroms import free_run
from qlroms.intrusive_qlroms import ks1d
from qlroms.intrusive_qlroms.utils import build_fom, get_full_trajectory

# A case FOM and its (cached) trajectory: the 1-D KS chaotic regime, short window
fom, cfg = build_fom(ks1d, case="chaotic", overrides={"Ntrain": 20_000, "Ntest": 2_000})
traj = get_full_trajectory(Ntot=cfg["i0"] + cfg["Ntrain"] + cfg["Ntest"], model=fom, i0=cfg["i0"])
Xtrain, x0 = traj[:, :cfg["Ntrain"]], traj[:, cfg["Ntrain"]]

# Charts (k-means + local POD + atlas) and one projected (b, A, B) per chart
rom = ks1d.build_local_model(Xtrain, fom, K=10, r=30, save_dir=".")

# Closed-loop forecast through the shared step(apod) interface
X_rec, cluster_path = free_run(rom, x0, n_steps=500)

# Run it as a dynamodels Model (romda estimators, ntsa analysis)
from qlroms.model import QLModel
model = QLModel(rom, obs_idx=np.arange(0, fom.Nx, 8), psi0=x0)

Building a qlROM from a config

One YAML file per model: which test case and window, which family, how many charts and modes, and what to measure once it is fitted.

python -m qlroms.utils.builder configs/ks1d_chaotic.yml   # [--set rom.K=20] [--set case.params='{"Ntrain": 5000}']
case: {model: ks1d chaos}          # a qlroms.utils.config.CASES name, or ks1d/chaotic
rom:  {kind: qlgalerkin, seed: 0, clustering: {kmeans_method: minibatch}}
check: {n_steps: 1000, compare_global: true}

A case is defined in exactly one place -- its own module's TEST_CASES entry, which holds the physics, the windows it is generated with, the $(K, r)$ its ql-ROMs are built at and the timescales its characterization needs. qlroms.utils.config only maps a readable name onto one of those entries (get_case("ks1d chaos") reads it back live), and a config restates none of it: leave rom.K / rom.r or case.params out and the case's own values stand, set them and this run overrides them. Unknown keys fail loudly, dotted --set beats the file, and both the trajectory and the fitted ROM come from the case's cached pipeline. The run prints a JSON summary: representation error, closed-loop mean error and prediction horizon, against the global ($K=1$) ROM of the same family when compare_global is on.

Theory

Derivations (local POD with the mass-weighted inner product, OpInf regression with $\lambda_1$/$\lambda_2$ regularization, ESN training) live in docs/theory/; full documentation is hosted on the ntsa docs site.

References

If you use this package, please cite the papers the method comes from:

  • Colanera, A., & Magri, L. (2025). Quantized local reduced-order modeling in time (ql-ROM). Computer Methods in Applied Mechanics and Engineering, 447, 118393.
  • Colanera, A., & Magri, L. (2026). Towards extreme event prediction of turbulent flows with quantized local reduced-order models. Journal of Physics: Conference Series, 3230(1), 012003. IOP Publishing.

Download files

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

Source Distribution

qlroms-0.1.0a5.tar.gz (132.1 kB view details)

Uploaded Source

Built Distribution

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

qlroms-0.1.0a5-py3-none-any.whl (132.5 kB view details)

Uploaded Python 3

File details

Details for the file qlroms-0.1.0a5.tar.gz.

File metadata

  • Download URL: qlroms-0.1.0a5.tar.gz
  • Upload date:
  • Size: 132.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qlroms-0.1.0a5.tar.gz
Algorithm Hash digest
SHA256 8e3e492c505fa77190a10b0221147d55248b5de7e5f45f692bd7b5cbf10c1a33
MD5 8a2548d1b7b148296cb1512a7b858046
BLAKE2b-256 c6af6abdf998d5ffb3eb96b5c52eb85c7bfa4ede376f3dae66a129d032cf19c8

See more details on using hashes here.

Provenance

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

Publisher: release.yml on andreanovoa/qlroms

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

File details

Details for the file qlroms-0.1.0a5-py3-none-any.whl.

File metadata

  • Download URL: qlroms-0.1.0a5-py3-none-any.whl
  • Upload date:
  • Size: 132.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qlroms-0.1.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 284abaa4c3719a1ae9be8f58d2b30cf68e16fef651ac93255ce9d9b52cef9a5f
MD5 8f4da532d7b516d61a0e66724eb196e4
BLAKE2b-256 99753db61260a90b6d706092d4864e33e9049ba1c4f2870db16f3845c485bc82

See more details on using hashes here.

Provenance

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

Publisher: release.yml on andreanovoa/qlroms

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

Release history Release notifications | RSS feed

This release

0.1.0a5 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page