zkit.viz.tdm
Transition-diagram plots from TDSEZ static TDM output.
Two complementary views of the transition-dipole matrices written by the
TDSEZ binary into static/EigenData_<prefix>.h5 (see zkit.io.tdm):
plot_transition_diagram()— a spectroscopic energy-level diagram: one
horizontal line per eigenstate at its energy, with an arrow between every coupled pair whose |μ_ij| exceeds a threshold. Arrow width/colour encodes the transition strength (|μ| or oscillator strength f_ij), and the dominant selection-rule resonances are read off directly.
plot_tdm_matrix()— a colour-grid heatmap of the |μ_ij| matrix (axes =
eigenstate index, optionally annotated with the energy on the side), the compact way to scan which states couple.
Both are pure matplotlib (already a zkit dependency) and write to a file.
- zkit.viz.tdm.plot_transition_diagram(path, outfile='tdm_diagram.png', *, axes=None, min_mu=0.001, color_by='strength', dpi=150, title=None)
Energy-level spectroscopic diagram with coupling arrows.
- Parameters:
path (str | Path) – EigenData HDF5 path (carries
spectrum+tdm_*).outfile (str | Path) – Output image path.
axes (str | List[str] | None) – Which dipole axes to include (“x”/”y”/”z”/None=all). Strengths from
min_mu (float)
color_by (str)
dpi (int)
title (str | None)
- Return type:
str
several axes are summed in quadrature. :param min_mu: Minimum |μ_ij| (quadrature over requested axes) to draw an arrow. :param color_by: “strength” → colour by |μ|; “f” → colour by oscillator strength f_ij. :param dpi: Standard matplotlib knobs. :param title: Standard matplotlib knobs.
- Returns:
The outfile path written.
- Return type:
str
- Parameters:
path (str | Path)
outfile (str | Path)
axes (str | List[str] | None)
min_mu (float)
color_by (str)
dpi (int)
title (str | None)
- zkit.viz.tdm.plot_tdm_matrix(path, outfile='tdm_matrix.png', *, axes=None, dpi=150, title=None)
Heatmap of the |μ_ij| transition-dipole matrix.
- Parameters:
path (str | Path) – EigenData HDF5 path.
outfile (str | Path) – Output image path.
axes (str | List[str] | None) – Which dipole axes to include (None = all, summed in quadrature).
dpi (int) – Standard matplotlib knobs.
title (str | None) – Standard matplotlib knobs.
- Returns:
The outfile path written.
- Return type:
str
- zkit.viz.tdm.plot_tdm(path, outdir='.', *, axes=None, min_mu=0.001, color_by='strength', dpi=150, prefix='tdm')
Convenience: produce BOTH the transition diagram and the matrix heatmap.
Returns the dict
{"diagram": ..., "matrix": ...}of written paths.- Parameters:
path (str | Path)
outdir (str | Path)
axes (str | List[str] | None)
min_mu (float)
color_by (str)
dpi (int)
prefix (str)
- Return type:
Dict[str, str]