Papers
Topics
Authors
Recent
Search
2000 character limit reached

KoopLearn: Python Library for Operator Learning

Updated 4 July 2026
  • KoopLearn is a Python library that models complex dynamical systems using linear evolution operators to capture spectral properties.
  • It unifies linear, kernel, and deep-learning estimators to forecast future states, decompose spectra, and build reduced-order models.
  • Built with a scikit-learn API, the toolkit supports both discrete and continuous-time models, offering reproducible benchmarks and versatile applications.

kooplearn is a Python library for learning evolution operators of dynamical systems from data. It is presented as a scikit-learn-compatible toolkit that unifies linear, kernel, and deep-learning estimators for discrete-time Koopman and transfer operators, as well as continuous-time infinitesimal generators. Its central purpose is not merely sequence forecasting in raw coordinates, but the estimation of reusable linear operators and their spectra so that dynamical systems can be analyzed by spectral methods, compressed into reduced-order models, and used to forecast future states and observables (Turri et al., 24 Dec 2025).

1. Conceptual scope and operator-theoretic framing

The library is organized around the operator-theoretic view that nonlinear dynamics may be more tractable when modeled through the evolution of observables rather than direct state transitions. The central object is the evolution operator E\mathsf{E}, defined for an observable ff by

(Ef)(xt)=p(dyxt)f(y)=EyXt+1Xt ⁣[f(y)xt].(\mathsf{E} f)(x_t) = \int p(dy \mid x_t)\, f(y) = \mathbb{E}_{y \sim X_{t+1}\mid X_t}\!\left[f(y)\mid x_t\right].

In the deterministic case this is the Koopman operator; in the stochastic case it is the transfer operator. The defining property is linearity in the observable ff, even when the underlying state dynamics are nonlinear (Turri et al., 24 Dec 2025).

This framing determines the problem kooplearn addresses. The task is to approximate an operator, or its spectral structure, from trajectory data in a form that supports three distinct uses: forecasting future observables or states, spectrally decomposing the dynamics into eigenvalues, eigenfunctions, and modes, and constructing reduced-order models. The paper treats these as distinct but connected objectives. Learning an operator is not the same as learning its spectral decomposition, and neither is identical to downstream use of the learned model.

The library also spans continuous-time dynamics through infinitesimal generators. For time-homogeneous continuous-time systems, the generator L\mathsf{L} is related to the evolution operator by

E=eL,E[f(Xt)x0]=(etLf)(x0).\mathsf{E} = e^{\mathsf{L}}, \qquad \mathbb{E}[f(X_t)\mid x_0] = (e^{t\mathsf{L}} f)(x_0).

The paper emphasizes that generator learning is useful because exponentiation preserves eigenfunctions, so dynamical structure can be recovered under appropriate assumptions from settings that are not restricted to explicit lag-time trajectory pairs.

A finite-dimensional latent approximation is the library’s practical core:

xt  φ  zt,zt+1Ezt.x_t \xmapsto{\;\varphi\;} z_t,\qquad z_{t+1}\approx E z_t.

Here the pair (φ,E)(\varphi,E) approximates the infinite-dimensional operator on the subspace spanned by the components of φ\varphi. This latent-linear viewpoint links kooplearn directly to classical methods such as TICA and DMD while generalizing beyond them (Turri et al., 24 Dec 2025).

2. Estimator families and learning paradigms

kooplearn exposes three main estimator families: linear, kernel, and deep-learning-based methods. This breadth is central to its identity, because the library is designed to cover the broader problem of evolution-operator learning rather than a single DMD lineage (Turri et al., 24 Dec 2025).

The linear estimators assume a fixed finite-dimensional representation φ\varphi and learn a matrix acting on those features. The paper explicitly mentions a Ridge class. In this regime, the model is simple, computationally efficient, and aligned with standard scikit-learn workflows, but it is limited by the quality of the chosen features.

The kernel estimators provide an implicit and potentially infinite-dimensional feature map through an RKHS. The paper gives special emphasis to KernelRidge and to kernel-based Reduced Rank Regression. It states that the reduced-rank kernel estimator provably outperforms traditional kernel DMD methods in approximating the spectrum and, to the authors’ knowledge, that kooplearn is the only open-source implementation of that reduced-rank estimator. Large-scale variants include randomized estimators and Nyström-based estimators, which are intended to make kernel operator learning practical on larger datasets.

The deep-learning estimators learn the representation ff0 itself. The paper states that theoretically grounded losses are implemented in both PyTorch and JAX, allowing users to build representations with structural priors such as graph-based encoders. Two broad deep families are distinguished. Encoder-decoder schemes follow the encoder–linear latent evolution–decoder template associated with the loss of Lusch et al. (2018), while encoder-only schemes optimize directly for dynamical structure through VAMP loss or spectral contrastive loss. The former is suited to reconstruction-aware prediction in state space; the latter is oriented more directly toward invariant, slow, or coherent mode discovery (Turri et al., 24 Dec 2025).

This organization has an important methodological consequence. kooplearn is not tied to a single answer to the observable-design problem. It supports fixed features, implicit RKHS features, and learned features within one framework. That distinguishes it from libraries restricted mainly to hand-crafted observables or to one deep architectural template.

3. Mathematical structure and spectral emphasis

The paper presents kooplearn primarily as a library for operator and spectrum estimation rather than as a forecasting package alone. Spectral decomposition is therefore a first-class concern. In operator-learning language, the aim is to approximate eigenspaces that reveal slow processes, coherent structures, and dynamically meaningful coordinates (Turri et al., 24 Dec 2025).

The latent formulation

ff1

serves two roles simultaneously. First, repeated application of ff2 gives multi-step propagation. Second, the spectrum of ff3 approximates spectral structure of the underlying evolution operator on the span of ff4. The paper highlights this point repeatedly in its discussion of reduced-rank regression, TICA, DMD, VAMPnets, and generator learning.

For continuous-time models, the generator viewpoint extends the same logic. Because the generator and semigroup share eigenfunctions, generator learning can recover slow dynamical modes from static or equilibrium information in certain diffusion settings. The paper specifically notes diffusion processes with Dirichlet boundary conditions and positions this as a sample-complexity advantage relative to purely trajectory-based estimators.

This spectral orientation also clarifies the meaning of “forecasting” in kooplearn. Forecasting is not treated as an isolated supervised-learning task. It is one use of a learned linear dynamical object whose eigenstructure is itself scientifically meaningful. That orientation is especially important in metastable stochastic systems, molecular kinetics, and reduced-order modeling, where the dominant scientific goal may be the recovery of slow modes rather than pointwise prediction accuracy alone (Turri et al., 24 Dec 2025).

4. Library design, API model, and benchmark datasets

A defining design choice is that the interface is compliant with the scikit-learn API. The paper does not enumerate complete method signatures, but it explicitly states that kooplearn provides estimator classes such as Ridge and KernelRidge, along with standard prediction utilities and spectral decomposition utilities. This places operator-learning models inside familiar machine-learning workflows rather than isolating them as bespoke research scripts (Turri et al., 24 Dec 2025).

The software also includes benchmark datasets in kooplearn.datasets. These cover deterministic chaos, stochastic and metastable dynamics, and structured high-dimensional observations. The paper explicitly lists Lorenz-63, Duffing oscillator, and Logistic Map among deterministic systems, and stochastic linear systems, regime-switching models, and Langevin dynamics among stochastic systems. It also includes Ordered MNIST to test high-dimensional structured data settings. Two benchmarks are emphasized for their accessible ground-truth spectral decompositions: the Noisy Logistic Map and Overdamped Langevin Dynamics in a quadruple-well potential.

This dataset module is presented as more than a convenience. Its stated purpose is experimentation, reproducibility, and fair comparison of learning algorithms. That function is important because spectral operator learning is otherwise difficult to compare across papers: many studies use different observables, different lag structures, or benchmark systems without accessible ground-truth spectra. kooplearn’s benchmark suite is intended to mitigate that fragmentation.

The paper states that the software is available at https://github.com/Machine-Learning-Dynamical-Systems/kooplearn, with documentation at https://kooplearn.readthedocs.io/, and installation via pip install kooplearn. It also states that the library has already been employed in multiple studies from 2022 to 2025, which suggests a project beyond a one-off prototype (Turri et al., 24 Dec 2025).

5. Empirical behavior and position in the software landscape

The empirical demonstrations in the paper are focused and selective. One figure compares kernel DMD with Reduced Rank estimators on overdamped Langevin dynamics and reports that the Reduced Rank estimator gives a more accurate approximation of the leading eigenfunctions of the transfer operator. A second figure benchmarks fit time for a Gaussian-kernel model on 5000 observations from Lorenz-63 and is used to support the claim that randomized and Nyström-based kernel implementations substantially improve fitting speed (Turri et al., 24 Dec 2025).

These results reinforce the library’s self-description as spectrally oriented. The key evaluation is not limited to forecasting loss; it includes approximation quality of leading eigenfunctions. That emphasis is consistent with the presence of datasets with known spectral structure and with the library’s explicit concern for reduced-order modeling and slow-mode recovery.

Within the broader Koopman-learning ecosystem, kooplearn is positioned as more general than packages centered mainly on DMD variants. The paper explicitly contrasts it with PyDMD, pykoopman, pykoop, DLKoopman, and KoopmanLab. In this comparison, DLKoopman is a deep autoencoder-based package for learned Koopman embeddings and linear latent dynamics, with separate StatePred and TrajPred workflows and a strong emphasis on representation learning and prediction (Dey et al., 2022). kooplearn, by contrast, places linear, kernel, and deep estimators in one sklearn-style operator-learning framework and extends its scope to transfer operators and infinitesimal generators (Turri et al., 24 Dec 2025).

Related research directions illustrate what sits adjacent to, but not identical with, kooplearn’s core identity. “Koopman Learning with Episodic Memory” augments sliding EDMD with nearest-neighbor retrieval over local Koopman spectra for non-stationary prediction (Redman et al., 2023). “Koopa” uses Koopman predictors inside a deep forecasting architecture for non-stationary time series, combining global and local operators after Fourier-based decomposition (Liu et al., 2023). “Conformal Online Learning of Deep Koopman Linear Embeddings” introduces event-triggered online updates for deep Koopman models using a conformal-style model-consistency criterion (Gao et al., 16 Nov 2025). These works point toward memory-augmented, non-stationary, or online operator learning, whereas kooplearn’s paper centers on a general-purpose library for evolution-operator estimation, spectral decomposition, and benchmarking.

6. Limitations, caveats, and scientific significance

The paper is clear that kooplearn does not claim universal superiority across all settings. Different estimator families suit different problems. Kernel methods can be computationally expensive without sketching or Nyström approximations; deep methods require more modeling choices and reliance on external deep-learning frameworks; generator learning is more specialized, especially for diffusion processes and settings where equilibrium data or physical priors are meaningful (Turri et al., 24 Dec 2025).

A further caveat is documentary rather than algorithmic. The paper is a software overview, so it does not fully print all empirical objectives or API details for methods such as reduced-rank regression, VAMP, or spectral contrastive learning. For full technical depth, the reader must consult the referenced papers and the documentation. The central challenge of Koopman learning also remains intact: performance depends strongly on the quality of observables or learned representation ff5.

The intended audience follows directly from that scope. The paper identifies likely users in dynamical systems, operator theory, scientific machine learning, model reduction, molecular kinetics, metastable stochastic dynamics, and related areas. It also explicitly describes the package as valuable for research, education, rapid prototyping, and exploratory analysis of dynamical systems.

The broader significance of kooplearn lies in its attempt to standardize a fragmented field. A plausible implication is that its greatest contribution is infrastructural as much as algorithmic: it provides a common software layer in which linear, kernel, and deep operator-learning methods can be fitted, benchmarked, and compared under a shared API and shared datasets. In a literature where many Koopman methods appear as specialized implementations tied to one estimator family or one application domain, kooplearn formalizes evolution-operator learning as a reusable machine-learning workflow (Turri et al., 24 Dec 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to kooplearn.