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.1.tar.gz (105.8 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.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jftools-0.5.1.tar.gz
Algorithm Hash digest
SHA256 15f14bb84b7823ede01ea5c142cfdbcb6250061d7bb5f22f64b8d8b2f8002621
MD5 dd6d8299190873b67b40ab0a5bf67c63
BLAKE2b-256 943e8cb6d675ff4b4d69712f52031f564aa8efaded8d9ac8a866e774ef08068d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for jftools-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44943f369936569f3b29da4b4def27e9273eeafb95195ad987367b71dcc25753
MD5 a288ca5542d0b0da94f87e55a4143d25
BLAKE2b-256 9da4834b07590485d924574a899856b0ffdc16edb8363e768821c15b3cdacd45

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