This release is a pre-release and may not be stable for production use.
Analysis toolkit for TDSE-Z simulations
Read, reconstruct, validate and visualise the output of the TDSE-Z solver
Z is not the author’s initial. Z is not the third axis.
Z is ⵣ (yaz), the Amazigh sign of the free man and the free people.
zkit is the Python companion of TDSE-Z, a
B-spline (isogeometric) solver for the time-dependent Schrödinger equation in
1D, 2D and 3D. TDSE-Z writes HDF5 files; zkit turns them into spectra,
observables, wavefunctions, transition-dipole diagrams and Wigner
distributions, and validates the solver against exact solutions.
Documentation: https://dahbiz.github.io/zkit/
Installation
zkit needs Python 3.10 or newer, numpy and h5py.
pip install zkit-lib
# the latest main branch
pip install "git+https://github.com/dahbiz/zkit.git"
# or, for development
git clone https://github.com/dahbiz/zkit.git
cd zkit
pip install -e ".[test]"
The distribution name is zkit-lib; the import name and the command are
zkit. Optional extras:
| Extra | Adds |
|---|---|
viz |
plotting (matplotlib) |
vtk |
VTK export of wavefunctions (pyvista) |
physics |
symbolic field expressions (sympy) |
validation |
the zkit validate suite (scipy, sympy) |
mwigner |
Wigner-function analysis (PyTorch, matplotlib) |
docs |
building the documentation (Sphinx) |
Install extras with, for example, pip install -e ".[viz,validation]".
Command-line tool
zkit --run-dir RUN summary <input> # summary of one run (spectrum, time series)
zkit --run-dir RUN batch # summary of every run in RUN/td/
zkit plot-wfs RUN/td/<name>_wfs.h5 # wavefunction snapshot to PNG (--vtk for VTK)
zkit tdm-plot RUN/static/<name>_eigen.h5 # transition-dipole diagram and |mu_ij| map
zkit validate --np 8 # validate a TDSE-Z build against exact solutions
zkit pes RUN/td/<name>_surff.h5 # photoelectron spectrum dP/dE from t-SURFF
zkit --run-dir RUN compare-scid <input> --scid-detail D --scid-pes P --omega W --e0 E
# one-to-one benchmark against SCID-TDSE
examples/scid_benchmark/ holds a complete TDSE-Z vs SCID-TDSE benchmark
(inputs, outputs, figures and metrics) reproduced with compare-scid.
<input> is the name of the TDSE-Z input file, e.g. h2p.inp. Run
zkit <command> --help for the options of each command.
Python API
import numpy as np
import zkit
run = zkit.load("RUN", "h2p.inp") # a TDSE-Z run directory and its input file
E = run.spectrum.values # bound-state energies (a.u.)
t, D = run.time, run.dipoles # time series of td/<name>_observables.h5
ph = run.physics # carrier sign, fields E(t) from the input deck
# B-spline basis of a run: the functions sum to one inside the domain
d = zkit.open_eig("RUN/static/h2p_eigen.h5")
p = int(d["meta"]["SplineDegree"])
kv = zkit.reconstruct_knots(d["knots_x"], p)
xs = np.linspace(kv[0], kv[-1], 201)[1:-1]
assert np.allclose(zkit.partition_of_unity(kv, p, xs), 1.0)
Main modules:
zkit.io: readers for the eigen, time-evolution, wavefunction and transition-dipole files;zkit.simulation: theRunobject for a whole run directory;zkit.physics: carrier sign, field expressions and their integrals and derivatives, read exactly as TDSE-Z reads the input;zkit.validation: analytic references and the validation suite;zkit.viz: wavefunction and transition-dipole plots;zkit.mwigner: Wigner distributions, phase-space currents and covariances.
Validating a TDSE-Z build
export TDSEZ_BINARY=/path/to/tdsez.x
zkit validate --quick # 2D cases, about 20 s
zkit validate --np 8 # all cases
zkit validate --np 8 --reference old/tdsez.x # also compare two builds column by column
The suite runs free wave packets in a field, a driven oscillator (exact coherent state) and position-dependent-mass problems, and checks every column of every output table against exact solutions or exact identities; see the validation page.
Examples
With a TDSE-Z build, the static 1D and 2D harmonic-oscillator examples run in a few seconds:
pip install -e ".[viz]"
python examples/run_quick_examples.py --tdsez /path/to/tdsez.x
Results (HDF5 spectrum, CSV, PNG plot) are written to examples/output/; the
input decks are in examples/inputs/. Larger campaigns are described in the
documentation.
Units
Atomic units throughout (ħ = m_e = e = 1). The mass, charge and fields are those of the TDSE-Z input deck.
License and acknowledgements
BSD 2-Clause, see LICENSE.
zkit includes a pure-Python implementation of the igakit.igalib.bsp
B-spline evaluator interface for wavefunction reconstruction; the upstream
BSD license is in src/igakit/LICENSE.rst.
Zakaria Dahbi
King's College London · zdahbi@outlook.es
Z.D. acknowledges funding from UK Research and Innovation (UKRI) under the UK government's Horizon Europe funding guarantee (Grant No. EP/Z000807/1).
Releases
zkit is published on PyPI as zkit-lib by .github/workflows/publish.yml
(trusted publishing, no stored token). To release, set __version__ in
src/zkit/_version.py, commit, then tag it with the same version:
git tag v0.1.0 && git push origin v0.1.0
The workflow checks that the tag matches __version__, builds the sdist and
wheel, runs the tests against the installed wheel (Python 3.10 and 3.13) and
publishes to PyPI. Running the workflow by hand (Actions > Publish zkit-lib >
Run workflow) publishes to TestPyPI instead. One-time set-up: add a pending
trusted publisher for the project zkit-lib (repository dahbiz/zkit,
workflow publish.yml, environment pypi; on test.pypi.org environment
testpypi) and create the GitHub environments pypi and testpypi.
Metadata
Release files for zkit-lib 0.1.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zkit_lib-0.1.0b1.tar.gz | 118.2 kB | With provenance | Details for zkit_lib-0.1.0b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zkit_lib-0.1.0b1-py3-none-any.whl | Python 3 | none | any | Details for zkit_lib-0.1.0b1-py3-none-any.whl |
Total release size: 239.5 kB
Release files / zkit_lib-0.1.0b1.tar.gz
| Download URL | zkit_lib-0.1.0b1.tar.gz |
|---|---|
| Size | 118.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fcda5e1eef7b680d246f2911840a911ae439d6a3ab7af2484028e8c17c73d857
|
|
BLAKE2b-256 checksum How to use checksums |
de3a7c0796751315672e2544468701039c3eb551a92a8ee6adf4bec135c3e5d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / zkit_lib-0.1.0b1-py3-none-any.whl
| Download URL | zkit_lib-0.1.0b1-py3-none-any.whl |
|---|---|
| Size | 121.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8058c43e84f8e1e2a8d532c9b34d3946a213ba1276ff0089dda1c8647cf60df5
|
|
BLAKE2b-256 checksum How to use checksums |
2aa3effdd724fcec3ee0f47381eca57350b554185feae1055e09267e63b02f41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for zkit-lib 0.1.0b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for zkit_lib-0.1.0b1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.