oripotentialplot#

torchspin.oripotentialplot(potential, *, plot_type='potential', angles='alpha_beta', grid_size=40, ax=None, cmap=None, kT=2.0)[source]#

Plot orientational potential on a sphere.

Parameters:
  • potential (ndarray, shape (nTerms, 4)) – Each row is [L, M, K, lambda] where lambda can be complex.

  • plot_type ({'potential', 'population'}) – What to plot: potential energy or Boltzmann population density.

  • angles ({'alpha_beta', 'beta_gamma'}) – Which Euler angle pair to display on the sphere.

  • grid_size (int) – Number of grid knots for the spherical grid.

  • ax (matplotlib Axes3D, optional) – If provided, plot into this axes. Otherwise create a new figure.

  • cmap (str, optional) – Colormap name. Default: ‘parula’-like for potential, reversed gray for population.

  • kT (float) – Boltzmann energy scale (arbitrary units). Default: 2.0.

Returns:

  • fig (matplotlib Figure)

  • ax (matplotlib Axes3D)

  • values (ndarray) – The plotted values at each grid point.

Examples

>>> import numpy as np
>>> from torchspin import oripotentialplot
>>> potential = np.array([[2, 0, 0, 1.5]])
>>> fig, ax, vals = oripotentialplot(potential)