Collection of small useful helper tools for Python by Johannes Feist.
Project description
JF Tools
Collection of small useful helper tools for Python by Johannes Feist.
Short Iterative Lanczos Backend Selection
The jftools.short_iterative_lanczos solver provides two backends:
numbafor array-based propagation.pythonfor the reference implementation.
Select backend behavior with the backend function argument:
auto(default): selectnumbaonly when both the Hamiltonian and the input state are compatible with the Numba implementation; otherwise fall back topython.python: force the original Python implementation.numba: force the Numba backend.
Current Numba compatibility is intentionally narrower than the Python backend:
- States must be
numpy.ndarray(converted tocomplex128) orqutip.Qobjstates. - Hamiltonians may be dense NumPy arrays, SciPy CSR matrices/arrays, callable
Hfun(t, phi, Hphi)operators working on array states, or the specialized sum-operator form(H0, (H1, f1), ...).
The Python backend uses the same NumPy/Qobj-style state handling as the reference implementation.
Example:
prop = jftools.short_iterative_lanczos.lanczos_timeprop(H, maxsteps=14, target_convg=1e-12, backend="auto")
Installation
jftools is a pure Python package again. There is no compiled extension build step.
Recommended (uv-only) workflow:
uv sync --group dev
uv run python -m pip install -e .
For a non-editable local install through uv:
uv run python -m pip install .
QuTiP Compatibility
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.
Publishing
Before publishing a new version:
- Update
__version__in jftools/init.py. - Commit the version bump.
- Build locally.
For a local packaging sanity check on your current machine only:
uv build
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jftools-0.5.0.tar.gz.
File metadata
- Download URL: jftools-0.5.0.tar.gz
- Upload date:
- Size: 106.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.33.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d0d36b277a457103a457d54846ee93ea3d823ea0cbc953f7e4b1044b4312c72
|
|
| MD5 |
ec65c9a8029b4157ae472f9b9da7f166
|
|
| BLAKE2b-256 |
907918b1b01790eeb8ce1686030809694f2530f901cd5741b4a30d37be68fa26
|
File details
Details for the file jftools-0.5.0-py3-none-any.whl.
File metadata
- Download URL: jftools-0.5.0-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.33.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6724469387925b0963e6a6f1cef6ab7e1d2120e05ca92e0d674285da6cf2eb66
|
|
| MD5 |
c21ef89b0f5047290c1bee6587fc16ad
|
|
| BLAKE2b-256 |
0153c86ed0efdb4c6425ba9f0f0d44ac895e91f342c9ee4da0a0ee77f4df25f0
|