mpinterfaces.mat2d.electronic_structure package

Submodules

mpinterfaces.mat2d.electronic_structure.analysis module

mpinterfaces.mat2d.electronic_structure.analysis.find_dirac_nodes()[source]

Look for band crossings near (within tol eV) the Fermi level.

Returns:
boolean. Whether or not a band crossing occurs at or near
the fermi level.
mpinterfaces.mat2d.electronic_structure.analysis.get_band_edges()[source]

Calculate the band edge locations relative to the vacuum level for a semiconductor.

Returns:{‘up_cbm’: , ‘up_vbm’: , ‘dn_cbm’: , ‘dn_vbm’: , ‘efermi’}
Return type:edges (dict)
mpinterfaces.mat2d.electronic_structure.analysis.get_effective_mass()[source]

This function is in a beta stage, and its results are not guaranteed to be useful.

Finds effective masses from a band structure, using parabolic fitting to determine the band curvature at the CBM for electrons and at the VBM for holes. This curvature enters the equation m* = (hbar)**2 / (d^2E/dk^2).

To consider anisotropy, the k-space directions to the left and right of the CBM/VBM in the band diagram are returned separately.

NOTE Only works for semiconductors and linemode calculations (non-
spin polarized). >30 k-points per string recommended to obtain reliable curvatures.
NOTE The parabolic fit can be quite sensitive to the number of
k-points fit to, so it might be worthwhile adjusting N_KPTS to obtain some sense of the error bar.
TODO: Warn user if CBM/VBM is at the edge of the diagram, and which
direction (either left or right) was not actually fit to. Until fixed, this (most likely) explains any negative masses returned.
Returns:
Dictionary of the form
{‘electron’: {‘left’: e_m_eff_l, ‘right’: e_m_eff_r},
‘hole’: {‘left’: h_m_eff_l, ‘right’: h_m_eff_r}}

where ‘left’ and ‘right’ indicate the reciprocal directions to the left and right of the extremum in the band structure.

mpinterfaces.mat2d.electronic_structure.analysis.get_fermi_velocities()[source]

Calculates the fermi velocity of each band that crosses the fermi level, according to v_F = dE/(h_bar*dk).

Returns:
fermi_velocities (list). The absolute values of the
adjusted slopes of each band, in Angstroms/s.
mpinterfaces.mat2d.electronic_structure.analysis.plot_band_alignments(directories, run_type='PBE', fmt='pdf')[source]

Plot CBM’s and VBM’s of all compounds together, relative to the band edges of H2O.

Parameters:
  • directories (list) – list of the directory paths for materials to include in the plot.
  • run_type (str) – ‘PBE’ or ‘HSE’, so that the function knows which subdirectory to go into (pbe_bands or hse_bands).
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_band_structure(ylim=(-5, 5), draw_fermi=False, fmt='pdf')[source]

Plot a standard band structure with no projections.

Parameters:
  • ylim (tuple) – minimum and maximum potentials for the plot’s y-axis.
  • draw_fermi (bool) – whether or not to draw a dashed line at E_F.
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_color_projected_bands(ylim=(-5, 5), fmt='pdf')[source]

Plot a single band structure where the color of the band indicates the elemental character of the eigenvalue.

Parameters:
  • ylim (tuple) – minimum and maximum energies for the plot’s y-axis.
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_density_of_states(xlim=(-10, 5), ylim=(-1.5, 1.5), fmt='pdf')[source]

Plots the density of states from the DOSCAR in the cwd. Plots spin up in red, down in green, and the sum in black. Efermi = 0.

Parameters:
  • xlim (tuple) – minimum and maximum energies for the plot’s x-axis.
  • ylim (tuple) – minimum and maximum for the plot’s y-axis.
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_elt_projected_bands(ylim=(-5, 5), fmt='pdf')[source]

Plot separate band structures for each element where the size of the markers indicates the elemental character of the eigenvalue.

Parameters:
  • ylim (tuple) – minimum and maximum energies for the plot’s y-axis.
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_local_potential(axis=2, ylim=(-20, 0), fmt='pdf')[source]

Plot data from the LOCPOT file along any of the 3 primary axes. Useful for determining surface dipole moments and electric potentials on the interior of the material.

Parameters:
  • axis (int) – 0 = x, 1 = y, 2 = z
  • ylim (tuple) – minimum and maximum potentials for the plot’s y-axis.
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_orb_projected_bands(orbitals, fmt='pdf', ylim=(-5, 5))[source]

Plot a separate band structure for each orbital of each element in orbitals.

Parameters:
  • orbitals (dict) – dictionary of the form {element: [orbitals]}, e.g. {‘Mo’: [‘s’, ‘p’, ‘d’], ‘S’: [‘p’]}
  • ylim (tuple) – minimum and maximum energies for the plot’s y-axis.
  • fmt (str) – matplotlib format style. Check the matplotlib docs for options.
mpinterfaces.mat2d.electronic_structure.analysis.plot_spin_texture(inner_index, outer_index, center=(0, 0), fmt='pdf')[source]

Create six plots- one for the spin texture in x, y, and z in each of two bands: an inner band and an outer band. For Rashba spin-splitting, these two bands should be the two that have split.

Parameters:
  • inner_index (int) – indices of the two spin-split bands.
  • outer_index (int) – indices of the two spin-split bands.
  • center (tuple) – coordinates of the center of the splitting (where the bands cross). Defaults to Gamma.
  • fmt – matplotlib format style. Check the matplotlib docs for options.

mpinterfaces.mat2d.electronic_structure.startup module

mpinterfaces.mat2d.electronic_structure.startup.get_2D_hse_kpoints(struct_for_path, ibzkpth)[source]
Parameters:
  • struct_for_path – Structure from which linemode k-points will be generated.
  • ibzkpth
Returns:

the Kpoints file object in the form of a string

ready for execution by MPInterfaces calibrate objects

mpinterfaces.mat2d.electronic_structure.startup.get_2D_incar_hse(incar_dict)[source]

linker function to complete the HSE input deck to MPInterfaces

Parameters:incar_dict (dict) –
Returns:incar dict
Return type:dict
mpinterfaces.mat2d.electronic_structure.startup.get_2D_incar_hse_prep(incar_dict)[source]

linker for prep calculation

Parameters:incar_dict (dict) –
Returns:incar dict
Return type:dict
mpinterfaces.mat2d.electronic_structure.startup.get_markovian_path(points)[source]

Calculates the shortest path connecting an array of 2D points. Returns the points in order on that path.

Parameters:points

Returns:

mpinterfaces.mat2d.electronic_structure.startup.remove_z_kpoints_linemode(output='KPOINTS')[source]

Strips all k-points linemode KPOINTS that include a z-component, since these are not relevant for 2D materials. Then re-computes the markovian path between the remaining 2D points and writes it over the KPOINTS file.

Parameters:output (str) –
mpinterfaces.mat2d.electronic_structure.startup.run_hse_calculation(dim=2, submit=True, force_overwrite=False, destroy_prep_directory=False)[source]

Setup/submit an HSE06 calculation to get an accurate band structure. Requires a previous IBZKPT from a standard DFT run. See http://cms.mpi.univie.ac.at/wiki/index.php/Si_bandstructure for more details.

Parameters:
  • dim (int) – 2 for relaxing a 2D material, 3 for a 3D material.
  • submit (bool) – Whether or not to submit the job.
  • force_overwrite (bool) – Whether or not to overwrite files if an already converged vasprun.xml exists in the directory.
  • destroy_prep_directory (bool) – whether or not to remove (rm -r) the hse_prep directory, if it exists. This can help you to automatically clean up and save space.
mpinterfaces.mat2d.electronic_structure.startup.run_hse_prep_calculation(dim=2, submit=True)[source]

Submits a quick static calculation to calculate the IBZKPT file using a smaller number of k-points (200/atom instead of 1000/atom). The other outputs from this calculation are essentially useless.

Parameters:
  • dim (int) – 2 for relaxing a 2D material, 3 for a 3D material.
  • submit (bool) – Whether or not to submit the job.
mpinterfaces.mat2d.electronic_structure.startup.run_pbe_calculation(dim=2, submit=True, force_overwrite=False)[source]

Setup and submit a normal PBE calculation for band structure along high symmetry k-paths.

Parameters:
  • dim (int) – 2 for relaxing a 2D material, 3 for a 3D material.
  • submit (bool) – Whether or not to submit the job.
  • force_overwrite (bool) – Whether or not to overwrite files if an already converged vasprun.xml exists in the directory.

Module contents