Metadata-Version: 2.4
Name: pymablock
Version: 2.2.1
Summary: Numerical and symbolic implementation of quasi-degenerate perturbation theory
Project-URL: Documentation, https://pymablock.readthedocs.io/en/latest/
Project-URL: Repository, https://gitlab.kwant-project.org/qt/pymablock
Project-URL: Bug Tracker, https://gitlab.kwant-project.org/qt/pymablock/-/issues
Author: Pymablock developers
License-File: AUTHORS.md
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Requires-Dist: numpy>=2.0
Requires-Dist: packaging>=22.0
Requires-Dist: scipy>=1.13
Requires-Dist: sympy>=1.13
Provides-Extra: docs
Requires-Dist: sphinx-book-theme>=1.1.0; extra == 'docs'
Requires-Dist: sphinx-tippy; extra == 'docs'
Provides-Extra: mumps
Requires-Dist: python-mumps<0.1,>=0.0.1; extra == 'mumps'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-randomly; extra == 'test'
Requires-Dist: pytest-regressions; extra == 'test'
Description-Content-Type: text/markdown

# Pymablock: quasi-degenerate perturbation theory in Python

`Pymablock` (Python matrix block-diagonalization) is a Python package that constructs
effective models using quasi-degenerate perturbation theory.
It handles both numerical and symbolic inputs, and it efficiently
block-diagonalizes Hamiltonians with multivariate perturbations to arbitrary
order.

Building an effective model using Pymablock is a three step process:

* Define a Hamiltonian
* Call `pymablock.block_diagonalize`
* Request the desired order of the effective Hamiltonian

```python
from pymablock import block_diagonalize

# Define perturbation theory
H_tilde, *_ = block_diagonalize([h_0, h_p], subspace_eigenvectors=[vecs_A, vecs_B])

# Request correction to the effective Hamiltonian
H_AA_4 = H_tilde[0, 0, 4]
```

Here is why you should use Pymablock:

* Do not reinvent the wheel

  Pymablock provides a tested reference implementation

* Apply to any problem

  Pymablock supports `numpy` arrays, `scipy` sparse arrays, `sympy` matrices and
  quantum operators

* Speed up your code

  Due to several optimizations, Pymablock can reliably handle both higher orders
  and large Hamiltonians

For more details see the Pymablock [documentation](https://pymablock.readthedocs.io/en/latest/).
