2D spin-texture#

This module can be utilized to visualize the constant energy surface spin textures in a given system. This feature is particularly useful in identifying Rashba and Dresselhaus type spin-splitting effects, analyzing the topology of Fermi-surface, and examining Lifshitz transitions. To plot 2D spin texture, we require a 2D \(k\)-grid centered a certain special \(k\)-point in Brillouin zone near which we want to examine the spin-texture in \(k\)-space (see section Example of kmesh_generator regarding generation of 2D \(k\)-mesh).

Usage: To plot \(S_x\) spin component at a constant energy surface \(E = E_{F} + 0.60\,eV\) (spin=1, 2, 3 for \(S_x\), \(S_y\), \(S_z\), respectively):

pyprocar.fermi2D(code='vasp', dirname = 'fermi', st=True, energy=0.60, noarrow=True, spins=[1], )

One could also plot spin texture using arrows instead of a heat map. This can be done by setting the tag: noarrow=False. To set maximum and minimum energy values for color map, one could use vmin and vmax tags.

Translate and Rotate the 2D KPOINT mesh#

For any spin-texture in a 2D K-plane, PyProcar usually treats Z-direction as the normal, and makes plot in the X-Y plane. It works fine when we have a 2D k-mesh in (\(k_x\), \(k_y\), 0) plane, but for other 2D k-meshes (e.g. Y-Z or X-Z), it gives us Value Error or Segmentation Fault.

The solution is to rotate the PROCAR by 90 degrees and make the Z-axis perpendicular to the 2D plane. But we should first translate our mesh to a particular K-point (which is mostly the center of the k-mesh) to define the rotation point, and then decide the rotation axis and rotation angle.

To translate the k-mesh:

translate=[2,2,0]

220 is the index of the \(k\)-point in the 2D \(k\)-mesh to define the rotation point (counting starts from 0).

To define the rotation angle and rotation axis:

rotation=[90,0,1,0]

This defines the rotation angle = 90, and Y-axis as the rotation axis. PyProcar always performs the translation operation first and then does the rotation.

Be careful: Now \(S_x\), \(S_y\) and \(S_z\) all will be rotated according to the user’s choice. \(S_y\) will be same as before but \(S_x\) would now be \(S_z\) and \(S_z\) would be \(-S_x\).

Export plot as a matplotlib.pyplot object#

PyProcar allows the plot to be exported as a matplotlib.pyplot object. This allows for further processing of the plot through options available in matplotlib. This can be enabled by setting exportplt = True. Usage:

import matplotlib.pyplot as plt
import pyprocar

plt = pyprocar.fermi2D(code='vasp', dirname = 'fermi', exportplt=True)
plt.title('Using matplotlib options')
plt.show()
pyprocar.scripts.scriptFermi2D.fermi2D(code: str, dirname: str, mode: str = 'plain', fermi: float | None = None, fermi_shift: float = 0.0, band_indices: List[List] | None = None, band_colors: List[List] | None = None, spins: List[int] | None = None, atoms: List[int] | None = None, orbitals: List[int] | None = None, energy: float | None = None, k_z_plane: float = 0.0, k_z_plane_tol: float = 0.01, rot_symm=1, translate: List[int] = [0, 0, 0], rotation: List[int] = [0, 0, 0, 1], spin_texture: bool = False, exportplt: bool = False, savefig: str | None = None, print_plot_opts: bool = False, **kwargs)[source]#

This function plots the 2d fermi surface in the z = 0 plane

Parameters:
  • code (str,) – This parameter sets the code to parse, by default “vasp”

  • dirname (str, optional) – This parameter is the directory of the calculation, by default ‘’

  • fermi (float, optional) – The fermi energy. If none is given, the fermi energy in the directory will be used, by default None

  • fermi_shift (float, optional) – The fermi energy shift, by default 0.0

  • lobster (bool, optional) – A boolean value to determine to use lobster, by default False

  • band_indices (List[List]) – A list of list that contains band indices for a given spin

  • band_colors (List[List]) – A list of list that contains colors for the band index corresponding the band_indices for a given spin

  • spins (List[int], optional) – List of spins, by default [0]

  • atoms (List[int], optional) – List of atoms, by default None

  • orbitals (List[int], optional) – List of orbitals, by default None

  • energy (float, optional) – The energy to generate the iso surface. When energy is None the 0 is used by default, which is the fermi energy, by default None

  • k_z_plane (float, optional) – Which K_z plane to generate 2d fermi surface, by default 0.0

  • rot_symm (int, optional) – _description_, by default 1

  • translate (List[int], optional) – Matrix to translate the kpoints, by default [0, 0, 0]

  • rotation (List[int], optional) – Matrix to rotate the kpoints, by default [0, 0, 0, 1]

  • savefig (str, optional) – The filename to save the plot as., by default None

  • spin_texture (bool, optional) – Boolean value to determine if spin arrows are plotted, by default False

  • exportplt (bool, optional) – Boolean value where to return the matplotlib.pyplot state plt, by default False

  • print_plot_opts (bool, optional) – Boolean to print the plotting options

Returns:

Returns the matplotlib.pyplot state plt

Return type:

matplotlib.pyplot

Raises:

RuntimeError – invalid option –translate