zkit.viz.wavefunction

Publication-quality wavefunction plots for TDSEZ.

Thin layer over zkit.io.wfs_field.evaluate_wavefunction() that renders the reconstructed wavefunction with matplotlib. matplotlib is imported lazily so the rest of the package works without it installed (pip install zkit[viz]).

zkit.viz.wavefunction.plot_wavefunction(path, step=0, outdir='.', npoints=200, dpi=150, axes=None, vtk=None)

Render a wavefunction snapshot to PNG (and optionally VTK).

Dispatches on dimensionality:

1D -> two stacked panels (Re/Im psi, |psi|^2) 2D -> three panels (|psi|^2, Re psi, phase arg psi) 3D -> |psi|^2 on the z = z_mid slice

Parameters:
  • vtk (str | None) – If given, also export the evaluated field to a VTK file for ParaView (e.g. "out.vts" or "out.vtu"). Requires the viz extra (pyvista).

  • (or (Returns the absolute path of the written PNG)

  • only (if vtk is the)

  • skipped (output requested and outdir plotting is)

  • path). (the vtk)