eprbase is a low-level Python framework for developing custom simulation
routines for continuous-wave electron paramagnetic resonance (cwEPR).
The framework provides CPU and GPU implementations of its modules with compatible interfaces. This allows individual parts of a simulation to be executed on either the CPU or GPU and combined as needed.
The code is fully object-oriented. Classes can be extended or modified through inheritance, making it possible to implement custom functionality for individual simulation requirements.
Currently, the Hamiltonian implementation is limited to radical pairs. Support for arbitrary spin systems will be added in future releases.
- Low-level building blocks for custom cwEPR simulation routines
- CPU and GPU implementations with compatible interfaces
- Flexible hybrid CPU/GPU simulation workflows
- Object-oriented design
- Extensible and modifiable classes through inheritance
- Numerical calculations based on NumPy and SciPy
- GPU acceleration using CuPy
- Current support for radical-pair Hamiltonians
- Planned support for arbitrary spin systems
- Python 3.13 or newer
uv add eprbaseuv add eprbase --extra gpuThe GPU version requires a compatible NVIDIA GPU and CUDA installation.
pip install eprbasepip install eprbase[gpu]The GPU version requires a compatible NVIDIA GPU and CUDA installation.
Clone the repository and install the development dependencies with uv:
git clone https://github.com/florianquintes/eprbase.git
cd eprbase
uv sync --devInstall the optional GPU dependencies:
uv sync --extra gpuRun the tests:
uv run pytestCheck the code formatting and linting:
uv run ruff format --check .
uv run ruff check .Format the code locally:
uv run ruff format .The documentation is available on GitHub Pages.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.