levelsplot#
- torchspin.levelsplot(sys, ori='z', B=None, mwFreq=None, opt=None, *, ax=None)[source]#
Plot energy level diagram.
- Parameters:
sys – Spin system (
SpinSystem).Orientation of the magnetic field in the molecular frame.
String:
'x','y','z','xy','xz','yz','xyz'2-element
[phi, theta](radians)3-element
[phi, theta, chi](radians)
B (list | ndarray | Tensor) – Magnetic field range in mT. Either
[Bmin, Bmax]or a full vector. Default:[0, 1400].mwFreq (float | None) – Microwave frequency in GHz. If given, resonance transitions are plotted.
opt (LevelsPlotOptions | None) – Plot options (see
LevelsPlotOptions).ax – Matplotlib axes to plot on. If
None, a new figure is created.
- Returns:
fig – Matplotlib figure.
ax – Matplotlib axes (or list of axes if stick spectrum is enabled).