Skip to main content

Compute jordan canonical (normal) form of (nonlinear / generalized) eigenvalue problem

Project description

Jordan Form

CI Status Documentation Status Test coverage percentage

uv Ruff pre-commit

PyPI Version Supported Python versions License


Documentation: https://jordan-form.readthedocs.io

Source Code: https://github.com/34j/jordan-form


Compute jordan canonical (normal) form of (nonlinear / generalized) eigenvalue problem

Installation

Install this via pip (or your favourite package manager):

pip install jordan-form

Usage

Consider a function

$$ T(\lambda) = \begin{pmatrix} \lambda^2 & -\lambda \ 0 & \lambda^2 \end{pmatrix} $$

which eigenvalue is 0. (Example 1. from Nonlinear Eivenvalue Problems which is from Matrix Polynomials (Computer Science and Applied Mathematics). (1982). Academic Press.)

import numpy as np

from jordan_form import canonical_jordan_chains


def f(
    eigval: float, derv: int
) -> np.ndarray[tuple[int, int], np.dtype[np.number]] | None:
    if derv == 0:
        return np.array([[eigval**2, -eigval], [0, eigval**2]])
    elif derv == 1:
        return np.array([[2 * eigval, -1], [0, 2 * eigval]])
    elif derv == 2:
        return np.array([[2, 0], [0, 2]])
    else:
        return np.zeros((2, 2))


chains = canonical_jordan_chains(
    f, 0, atol_rank=1e-3, rtol_rank=1e-3, atol_norm=1e-3, rtol_norm=1e-3
)
print(chains)
CanonicalJordanChains(eigval=0, chains=[array([[1., 0.],
       [0., 1.],
       [0., 0.]]), array([[0., 1.]])])

CLI Usage

> jordan-form "{{x^2,-x},{0,x^2}}" 0
Algebraic multiplicity: 4
Geometric multiplicity: 2
Dimension of generalized eigenspace: [2 3 4]
Dimension of ith generalized eigenvectors: [2 1 1]
Chain lengths: [3 1]
Chain 0:
[[1. 0.]
 [0. 1.]
 [0. 0.]]
Chain 1:
[[0. 1.]]

References

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

Copier

This package was created with Copier and the browniebroke/pypackage-template project template.

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

jordan_form-1.0.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

jordan_form-1.0.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file jordan_form-1.0.0.tar.gz.

File metadata

  • Download URL: jordan_form-1.0.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jordan_form-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2c7892454d71441d96706ff775e1119486d0426fbd6c0b4f727fb19141e5271f
MD5 0753c1f1023b729d1d4a5f27cc50a94c
BLAKE2b-256 c786120ceb8b48bc57cde6dc4c4aa1b1bb3dd544ddf7d8b6ed61bda642502488

See more details on using hashes here.

Provenance

The following attestation bundles were made for jordan_form-1.0.0.tar.gz:

Publisher: ci.yml on 34j/jordan-form

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

File details

Details for the file jordan_form-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jordan_form-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jordan_form-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96d5dfa89078b06cb09b34ef6af95f30b339fe3b5b64a3092651c9b07280f743
MD5 422b918263afb97a74f56229eb6a343d
BLAKE2b-256 1e7acaf83e4837b4fae0f00f50927fe642a273bb0a98f67f62a5170189da459c

See more details on using hashes here.

Provenance

The following attestation bundles were made for jordan_form-1.0.0-py3-none-any.whl:

Publisher: ci.yml on 34j/jordan-form

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