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 – If given, also export the evaluated field to a VTK file for ParaView
(e.g.
"out.vts"or"out.vtu"). Requires thevizextra (pyvista). :type vtk: str | None :param Returns the absolute path of the written PNG (or: :param ifvtkis the only: :param output requested andoutdirplotting is skipped: :param the vtk path).: