Metadata-Version: 2.4
Name: quantarhei
Version: 0.0.70
Summary: Quantarhei: Open Quantum System Theory for Molecular Systems
Home-page: https://github.com/tmancal74/quantarhei
Author: Tomas Mancal
Author-email: Tomas Mancal <mancal@karlov.mff.cuni.cz>
License: MIT
Project-URL: Homepage, https://github.com/tmancal74/quantarhei
Keywords: physics,chemistry,quantum mechanics,open quantum systems,spectroscopy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: numpy<3,>=1.24
Requires-Dist: scipy<2,>=1.9
Requires-Dist: matplotlib<4,>=3.5
Requires-Dist: dill<1,>=0.3.6
Requires-Dist: terminaltables<4,>=3.1
Requires-Dist: gherkin-official<5,>=4.1
Requires-Dist: pyyaml<7,>=6.0
Requires-Dist: packaging<27,>=21.0
Provides-Extra: symbolic
Requires-Dist: sympy<2,>=1.12; extra == "symbolic"
Provides-Extra: qutip
Requires-Dist: qutip>=5.0; extra == "qutip"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.16; extra == "docs"
Requires-Dist: numpydoc>=1.6; extra == "docs"
Requires-Dist: myst-parser>=3.0; extra == "docs"
Requires-Dist: myst-nb>=1.0; extra == "docs"
Requires-Dist: ipykernel>=6.0; extra == "docs"
Requires-Dist: papermill>=2.4; extra == "docs"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: coverage>=7.0; extra == "dev"
Requires-Dist: behave>=1.2.6; extra == "dev"
Requires-Dist: pre-commit>=3.0; extra == "dev"
Requires-Dist: ruff>=0.15.12; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: setuptools>=69; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file

[![Build Status](https://github.com/tmancal74/quantarhei/actions/workflows/python-package.yml/badge.svg)](https://github.com/tmancal74/quantarhei)
[![Documentation Status](https://readthedocs.org/projects/quantarhei/badge/?version=latest)](http://quantarhei.readthedocs.io/en/latest/?badge=latest)
[![Coverage](https://img.shields.io/codecov/c/github/tmancal74/quantarhei.svg)](https://codecov.io/gh/tmancal74/quantarhei)
[![Version](https://img.shields.io/pypi/v/quantarhei.svg)](https://pypi.org/project/quantarhei/)
[![Python](https://img.shields.io/pypi/pyversions/quantarhei.svg)](https://pypi.org/project/quantarhei/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tmancal74/quantarhei/master?filepath=examples/notebooks)

# QUANTArhei: Open Quantum System Theory for Molecular Systems

Quantarhei is a molecular open quantum systems simulator written in Python. Its name is derived from the aphorism *"Panta rhei"* of Heraclitus of Ephesus — "Everything flows" — fitting for a package centred on quantum dynamics.

It provides tools for building molecular aggregates, computing linear and non-linear spectra, and simulating excitation energy transfer and open quantum system dynamics.

---

## Installation

**From PyPI (recommended):**

```bash
pip install quantarhei
```

**With [uv](https://github.com/astral-sh/uv):**

```bash
uv add quantarhei
```

**From source:**

```bash
git clone https://github.com/tmancal74/quantarhei.git
cd quantarhei
pip install -e .
```

**Requirements:** Python 3.10 or later, NumPy, SciPy.

---

## Quick start

```python
import quantarhei as qr

# Define two molecules with transition energies (in 1/cm)
with qr.energy_units("1/cm"):
    mol1 = qr.Molecule([0.0, 12000.0])
    mol2 = qr.Molecule([0.0, 12200.0])

    mol1.set_dipole(0, 1, [1.0, 0.0, 0.0])
    mol2.set_dipole(0, 1, [0.0, 1.0, 0.0])

# Build a dimer aggregate with resonance coupling
agg = qr.Aggregate([mol1, mol2])
with qr.energy_units("1/cm"):
    agg.set_resonance_coupling(0, 1, 100.0)

agg.build()

# Calculate absorption spectrum
with qr.energy_units("1/cm"):
    time = qr.TimeAxis(0.0, 1000, 1.0)
    calc = qr.AbsSpectrumCalculator(time, system=agg)
    spec = calc.calculate()
    spec.plot()
```

More examples are in the [`docs/examples/`](docs/examples/) directory and on [Read the Docs](http://quantarhei.readthedocs.io).

---

## Features

- **Molecular aggregates** — multi-molecule systems with arbitrary couplings, vibrational modes (Huang-Rhys factors, intra-molecular modes), vibronic coupling, and system-bath interactions
- **Linear spectroscopy** — absorption, circular dichroism, linear dichroism, and fluorescence spectra for monomers and aggregates
- **2D electronic spectroscopy** — non-linear response with Liouville pathway analysis, Feynman diagrams, and pump-probe spectra
- **Energy transfer theories** — Redfield, modified Redfield, and Förster rate theories; time-dependent and non-equilibrium variants; mixed Redfield-Förster
- **Open quantum system dynamics** — Lindblad and Redfield master equations, density matrix propagation, hierarchical equations of motion (HEOM)
- **Bath modeling** — correlation functions, spectral densities, lineshape functions; pre-built models for photosynthetic pigments
- **Laboratory frame** — realistic optical geometries and pulse field configurations via `LabSetup`
- **Extensible** — pure Python reference implementation; performance-critical routines can be replaced with optimised C/Fortran extensions

---

## Interactive notebooks

Try Quantarhei in your browser — no installation needed:

| Notebook | Topic | Launch |
|---|---|---|
| Molecule & Hamiltonian | Creating molecules, energy levels, vibrational modes | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tmancal74/quantarhei/master?filepath=examples/notebooks/01_molecule_hamiltonian.ipynb) |
| Correlation Functions | Bath correlation functions C(t) and spectral density J(ω) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tmancal74/quantarhei/master?filepath=examples/notebooks/02_correlation_functions.ipynb) |
| Absorption Spectrum | Full workflow: molecule → aggregate → bath → absorption | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tmancal74/quantarhei/master?filepath=examples/notebooks/03_absorption_spectrum.ipynb) |
| Redfield Relaxation | Density matrix propagation and population dynamics | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tmancal74/quantarhei/master?filepath=examples/notebooks/04_redfield_relaxation.ipynb) |
| HEOM Dynamics | Strong-coupling dynamics beyond Redfield | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tmancal74/quantarhei/master?filepath=examples/notebooks/05_heom.ipynb) |

---

## Documentation

Full API reference and tutorials: [quantarhei.readthedocs.io](http://quantarhei.readthedocs.io)

---

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for the full version history.

---

## Acknowledgements

The development of Quantarhei has been supported by:

- [**Neuron Fund for Support of Science**](http://www.nfneuron.cz) — Impuls grant in physics 2014 (2015–2017)
- [**Czech Science Foundation (GACR)**](http://www.gacr.cz) — grants 14-25752S (2014–2016), 17-22160S (2017–2019), 18-18022S (2018–2020)
