Skip to main content

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:

  • numba for array-based propagation.
  • python for the reference implementation.

Select backend behavior with the backend function argument:

  • auto (default): select numba only when both the Hamiltonian and the input state are compatible with the Numba implementation; otherwise fall back to python.
  • 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 to complex128) or qutip.Qobj states.
  • 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 dims and state shape.

Publishing

Before publishing a new version:

  1. Update __version__ in jftools/init.py.
  2. Commit the version bump.
  3. 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

jftools-0.5.0.tar.gz (106.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jftools-0.5.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

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

Hashes for jftools-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4d0d36b277a457103a457d54846ee93ea3d823ea0cbc953f7e4b1044b4312c72
MD5 ec65c9a8029b4157ae472f9b9da7f166
BLAKE2b-256 907918b1b01790eeb8ce1686030809694f2530f901cd5741b4a30d37be68fa26

See more details on using hashes here.

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

Hashes for jftools-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6724469387925b0963e6a6f1cef6ab7e1d2120e05ca92e0d674285da6cf2eb66
MD5 c21ef89b0f5047290c1bee6587fc16ad
BLAKE2b-256 0153c86ed0efdb4c6425ba9f0f0d44ac895e91f342c9ee4da0a0ee77f4df25f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page