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.2.tar.gz (105.7 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.2-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file jftools-0.5.2.tar.gz.

File metadata

  • Download URL: jftools-0.5.2.tar.gz
  • Upload date:
  • Size: 105.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for jftools-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3e974acb5b80ebe75ace3a192fade212a764c89882399ec8d69cbf949d8492bb
MD5 e54bc98018e8d0939e804307dca65f19
BLAKE2b-256 34c1ee6f1968131beaf7af18fdc94a0753bdcec245e500a4912f6df138cb0c10

See more details on using hashes here.

File details

Details for the file jftools-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: jftools-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for jftools-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c56b1ad3eb1f20dda2ba31e7b4e6afd67b2f417dbc02b016b64e129a0330a4d0
MD5 891e47f51208040ae6ed6f0b4f8c0979
BLAKE2b-256 d56a4b8dade64564fcfff3d6582837b13cef5b23a2bc33151466f056bb35af95

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