Skip to main content

Continuous and stable tracking of eigendecomposition for parameter-dependent matrices

Project description

EigenpairFlow

eigenpairflow-logo

CI

Continuous and stable tracking of eigendecomposition for parameter-dependent matrices.

Installation

Install from PyPI:

pip install eigenpairflow

Usage

Here is a minimal example of tracking the eigenpairs of a parameter-dependent matrix A(t).

First, define the matrix-valued function A(t) and its derivative dA(t)/dt.

import numpy as np
from eigenpairflow import eigenpairtrack

# Define a matrix function A(t)
def A_func(t):
  return np.array([[3 + np.cos(t), np.sin(t)], [np.sin(t), 3 - np.cos(t)]])

def dA_func(t):
  return np.array([[-np.sin(t), np.cos(t)], [np.cos(t), np.sin(t)]])

Then, call eigenpairtrack to solve the tracking problem over a given time interval.

# Set the time interval and evaluation points
t_start, t_end = 0.0, 3.0
t_eval = np.linspace(t_start, t_end, 10)

# Track the eigenpairs
result = eigenpairtrack(A_func, dA_func, (t_start, t_end), t_eval)

# The results object contains the tracked eigenvalues (result.Lambdas)
# and eigenvectors (result.Qs) at each time point in t_eval.
print(result)
EigenTrackingResults Summary:
success: True
message: The solver successfully reached the end of the integration interval.
  t_eval: np.ndarray with shape (10,)
  Qs: list of 10 np.ndarray(s), first shape: (2, 2)
  Lambdas: list of 10 np.ndarray(s), first shape: (2, 2)

For more detailed examples, please see the demonstration notebooks.

Supported Versions

This project is continuously tested against the following versions to ensure compatibility.

The project's dependencies are managed by Poetry, which resolves the most suitable NumPy v1.x version for each Python interpreter. Forward-compatibility with NumPy v2.x is also explicitly tested on newer Python versions.

Python Version Tested NumPy Series
3.9 1.x
3.10 1.x
3.11 1.x & 2.x
3.12 1.x & 2.x

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

eigenpairflow-0.2.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

eigenpairflow-0.2.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file eigenpairflow-0.2.0.tar.gz.

File metadata

  • Download URL: eigenpairflow-0.2.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/23.6.0

File hashes

Hashes for eigenpairflow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 184dce86d66707ee3f09920d1aebb7e1ef71e6f16b56050677e06048b8e6481a
MD5 7e5460dfdb8931f1c122f64c6c3ab5b4
BLAKE2b-256 6b26cb7a427097f3517054248154cd70fe8f38df5be6af7550cd3a86bb82e5ad

See more details on using hashes here.

File details

Details for the file eigenpairflow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eigenpairflow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/23.6.0

File hashes

Hashes for eigenpairflow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 420603829e374c493b9f4e9af8f16b97a5dac6e8e5997c729b03ebeff8b2edcb
MD5 4e8a7e9b057aea5109f8d4e10f68f480
BLAKE2b-256 8aff7ac7a55f9ae0fe547a00ee2c43e82462908528e7d450ccdbb20f58cca251

See more details on using hashes here.

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