Collection of small useful helper tools for Python by Johannes Feist.
The jftools.short_iterative_lanczos solver now supports backend auto-dispatch for static Hamiltonians:
cythonwhen the Cython extension is built and importable.pythonfor callable Hamiltonians and unsupported formats.
Select backend behavior with the backend function argument:
auto(default): choose the best available backend.python: force the original Python implementation.cython: force Cython backend (requires compiled extension).
Example:
prop = jftools.short_iterative_lanczos.lanczos_timeprop(H, maxsteps=14, target_convg=1e-12, backend="cython")The Cython implementation is in jftools/short_iterative_lanczos_cython.pyx.
It is built automatically during normal installation via meson-python.
Recommended (uv-only) workflow:
uv sync --group dev
uv run python -m pip install -e . --no-build-isolationFor a non-editable local install through uv:
uv run python -m pip install .After building, auto prefers cython.
Short iterative Lanczos targets modern QuTiP (5.x):
- QuTiP Hamiltonians are converted through
H.data.as_scipy()when available. - QuTiP state outputs preserve
dimsand state shape.
Releases are intended to be published through GitHub Actions rather than from a local machine.
Before publishing a new version:
- Update the version in meson.build (the single source of truth; pyproject.toml picks it up automatically).
- Commit and push the version bump.
- Optionally run the
Test release (TestPyPI)workflow to verify the full wheel matrix before publishing. - Create a GitHub Release or run the
Publishworkflow manually.
The publish workflow builds:
- wheels for CPython 3.12, 3.13, and 3.14,
- Linux
x86_64andaarch64, - macOS
x86_64andarm64, - Windows
AMD64, - plus an sdist.
For a dry run against TestPyPI, use the Test release (TestPyPI) workflow.
For a local packaging sanity check on your current machine only:
uv build