pyprocar package

Subpackages

Submodules

pyprocar.scriptBandGap module

pyprocar.scriptBandGap.bandgap(procar=None, outcar=None, code='vasp', fermi=None, repair=True)[source]
pyprocar.scriptBandGap.getFermi(procar, code, outcar)[source]

pyprocar.scriptBandsDosplot module

Created on May 17 2020 @author: Pedram Tavadze

pyprocar.scriptBandsDosplot.bandsdosplot(bands_file='PROCAR', dos_file='vasprun.xml', dos_dirname=None, bands_dirname=None, outcar='OUTCAR', abinit_output=None, bands_mode='plain', dos_mode='plain', plot_total=True, fermi=None, mask=None, markersize=0.02, marker='o', atoms=None, orbitals=None, bands_spin=0, bands_separate=False, dos_spins=None, dos_labels=None, dos_spin_colors=[(1, 0, 0), (0, 0, 1)], dos_colors=None, dos_items=None, dos_interpolation_factor=None, dlimit=None, elimit=None, vmin=None, vmax=None, cmap='jet', grid=False, kpointsfile='KPOINTS', code='vasp', savefig=None, title=None, kdirect=True, discontinuities=None, plot_color_bar=True, repair=True, show=True)[source]

This function creates plots containing both DOS and bands.

pyprocar.scriptBandsplot module

pyprocar.scriptBandsplot.bandsplot(procar='PROCAR', abinit_output='abinit.out', dirname=None, poscar=None, outcar=None, kpoints=None, elkin='elk.in', code='vasp', mode='plain', spins=None, atoms=None, orbitals=None, items=None, fermi=None, interpolation_factor=1, interpolation_type='cubic', projection_mask=None, vmax=None, vmin=None, kticks=None, knames=None, kdirect=True, elimit=None, ax=None, show=True, savefig=None, old=False, **kwargs)[source]
Parameters
  • procar (TYPE, optional) – DESCRIPTION. The default is “PROCAR”.

  • abinit_output (TYPE, optional) – DESCRIPTION. The default is “abinit.out”.

  • outcar (TYPE, optional) –

    DESCRIPTION. The default is “OUTCAR”.

    kpoints : TYPE, optional

    DESCRIPTION. The default is “KPOINTS”.

  • elkin (TYPE, optional) – DESCRIPTION. The default is “elk.in”.

  • mode (TYPE, optional) – DESCRIPTION. The default is “plain”.

  • spin_mode (TYPE, optional) – plain, magnetization, density, “spin_up”, “spin_down”, “both”, “sx”, “sy”, “sz”, “spin_texture” DESCRIPTION. The default is “plain”.

  • spins (TYPE, optional) – DESCRIPTION.

  • atoms (TYPE, optional) – DESCRIPTION. The default is None.

  • orbitals (TYPE, optional) – DESCRIPTION. The default is None.

  • fermi (TYPE, optional) – DESCRIPTION. The default is None.

  • mask (TYPE, optional) – DESCRIPTION. The default is None.

  • colors (TYPE, optional) – DESCRIPTION.

  • cmap (TYPE, optional) – DESCRIPTION. The default is “jet”.

  • marker (TYPE, optional) – DESCRIPTION. The default is “o”.

  • markersize (TYPE, optional) – DESCRIPTION. The default is 0.02.

  • linewidth (TYPE, optional) – DESCRIPTION. The default is 1.

  • vmax (TYPE, optional) – DESCRIPTION. The default is None.

  • vmin (TYPE, optional) – DESCRIPTION. The default is None.

  • grid (TYPE, optional) – DESCRIPTION. The default is False.

  • kticks (TYPE, optional) – DESCRIPTION. The default is None.

  • knames (TYPE, optional) – DESCRIPTION. The default is None.

  • elimit (TYPE, optional) – DESCRIPTION. The default is None.

  • ax (TYPE, optional) – DESCRIPTION. The default is None.

  • show (TYPE, optional) – DESCRIPTION. The default is True.

  • savefig (TYPE, optional) – DESCRIPTION. The default is None.

  • plot_color_bar (TYPE, optional) – DESCRIPTION. The default is True.

  • title (TYPE, optional) – DESCRIPTION. The default is None.

  • kdirect (TYPE, optional) – DESCRIPTION. The default is True.

  • code (TYPE, optional) – DESCRIPTION. The default is “vasp”.

  • lobstercode (TYPE, optional) – DESCRIPTION. The default is “qe”.

  • verbose (TYPE, optional) – DESCRIPTION. The default is True.

Returns

Return type

None.

pyprocar.scriptBandsplot.parse(code='vasp', dirname='', outcar=None, poscar=None, procar=None, reciprocal_lattice=None, kpoints=None, interpolation_factor=1, fermi=None)[source]

pyprocar.scriptCat module

pyprocar.scriptCat.cat(inFiles=None, outFile='PROCAR_merged', gz=False, mergeparallel=False, fixformat=False, nspin=1, abinit_output=None)[source]

This module concatenates multiple PROCARs. If a list of input PROCAR files is not provided it will merge all the PROCAR_* files in the directory. set mergeparallel = True for merging PROCARs generated from parallel Abinit calculations. Set fixformat = True to fix formatting issues in the Abinit PROCAR file. To detect if the calculation is spin-colinear it checks for the nsppol flag in the Abinit output file as set in abinit_output. If not present, set nspin.

pyprocar.scriptDosplot module

Created on May 17 2020 @author: Pedram Tavadze

pyprocar.scriptDosplot.dosplot(filename='vasprun.xml', dirname=None, mode='plain', interpolation_factor=None, orientation='horizontal', spin_colors=None, colors=None, spins=None, atoms=None, orbitals=None, elimit=None, dos_limit=None, cmap='jet', linewidth=1, vmax=None, vmin=None, grid=False, savefig=None, title=None, plot_total=True, code='vasp', labels=None, items={}, ax=None, plt_show=True, verbose=True)[source]

This function plots the density of states in different formats

Parameters
  • filename (str, optional (default 'vasprun.xml')) –

    The most important argument needed dosplot is filename. filename defines the path to vasprun.xml from the density of states calculation. If plotting is being carried out in the directory of the calculation, one does not need to specify this argument.

    e.g. filename='~/SrVO3/DOS/vasprun.xml'

  • mode (str, optional (default 'plain')) –

    mode defines the mode of the plot. This parameter will be explained in details with exmaples in the tutorial. options are 'plain', 'parametric', 'parametric_line', 'stack', 'stack_orbitals', 'stack_species'.

    e.g. mode='stack'

  • interpolation_factor (int, optional (default None)) –

    Number of points in energy axis is multiplied by this factor and interpolated using cubic spline.

    e.g. interpolation_factor=3

  • orientation (str, optional (default horizontal')) –

    The orientation of the DOS plot. options are 'horizontal', 'vertical'

    e.g. orientation='vertical'

  • spin_colors (list str or tuples, (optional ``spin_colors=[‘blue’,) –

    ‘red’]``) spin_colors represent the colors the different spin ploarizations are going to be represented in the DOS plot. These colors can be chosen from any type of color acceptable by matplotlib(string,rgb,html).

    e.g. spin_colors=['blue','red'], spin_colors=[(0, 0, 1),(1, 0,0 )], spin_colors=['#0000ff','#ff0000']

    Caution

    If the calculation is spin polarized one has to

    provide two colors even if one is plotting one spin. I disregard this cation if using default.

  • colors (list str or tuples, optional (default, optional)) –

    colors defines the color of plots filling the area under the curve of Total density of states. This is only important in the mode=stack, mode=stack_species, mode=stack_orbitals. To have a better sense of this parameter refer to the stack plots of SrVO3. These colors can be chosen from any type of color acceptable by matplotlib(string,rgb,html).

    e.g. colors=['red', 'blue', 'green', 'magenta', 'cyan']

  • spins (list int, optional) –

    spins defines plotting of different spins channels present in the calculation, If the calculation is spin non-polorized the spins will be set by default to spins=[0]. if the calculation is spin polorized this parameter can be set to 0 or 1 or both.

    e.g. spins=[0, 1]

  • atoms (list int, optional) –

    atoms define the projection of the atoms in the Density of States. In other words it selects only the contribution of the atoms provided. Atoms has to be a python list(or numpy array) containing the atom indices. Atom indices has to be order of the input files of DFT package. atoms is only relevant in mode='parametric', mode='parametric_line', mode='stack_orbitals'. keep in mind that python counting starts from zero. e.g. for SrVO3 we are choosing only the oxygen atoms. atoms=[2, 3, 4], keep in mind that python counting starts from zero, for a POSCAR similar to following:

    Sr1 V1 O3
    1.0
    3.900891 0.000000 0.000000
    0.000000 3.900891 0.000000
    0.000000 0.000000 3.900891
    Sr V O
    1 1 3
    direct
    0.500000 0.500000 0.500000 Sr atom 0
    0.000000 0.000000 0.000000 V  atom 1
    0.000000 0.500000 0.000000 O  atom 2
    0.000000 0.000000 0.500000 O  atom 3
    0.500000 0.000000 0.000000 O  atom 4
    

    if nothing is specified this parameter will consider all the atoms present.

  • orbitals (list int, optional) –

    orbitals define the projection of orbitals in the density of States. In other words it selects only the contribution of the orbitals provided. Orbitals has to be a python list(or numpy array) containing the Orbital indices. Orbitals indices has to be order of the input files of DFT package. The following table represents the indecies for different orbitals in VASP.

    s

    py

    pz

    px

    dxy

    dyz

    dz2

    dxz

    x2-y2

    0

    1

    2

    3

    4

    5

    6

    7

    8

    orbitals is only relavent in mode='parametric', mode='parametric_line', mode='stack_species'.

    e.g. orbitals=[1,2,3] will only select the p orbitals while orbitals=[4,5,6,7,8] will select the d orbitals.

    If nothing is specified pyprocar will select all the present orbitals.

  • elimit (list float, optional) –

    Energy window limit asked to plot. elimit has to be a two element python list(or numpy array).

    e.g. elimit=[-2, 2] The default is set to the minimum and maximum of the energy window.

  • dos_limit (list float, optional) –

    dos_limit defines the density of states axis limits on the graph. It is automatically set to select 10% higher than the maximum of density of states in the specified energy window.

    e.g. dos_limit=[0, 30]

  • cmap (str , optional (default 'jet')) –

    The color map used for color coding the projections. cmap is only relevant in mode='parametric'. a full list of color maps in matplotlib are provided in this web page. https://matplotlib.org/2.0.1/users/colormaps.html

    e.g. cmap='plasma'

  • linewidth (str, optional (default 1)) –

    The line width with which the total DOS is ploted

    e.g. linewidth=2

  • vmax (float, optional) –

    The maximum value in the color bar. cmap is only relevant in mode='parametric'.

    e.g. vmax=1.0

  • vmin (float, optional) –

    The maximum value in the color bar. cmap is only relevant in mode='parametric'.

    e.g. vmin=-1.0

  • grid (bool, optional (default Flase)) –

    Defines If a grid is plotted in the plot. The entry should be python boolian.

    e.g. grid=True

  • savefig (str , optional (default None)) –

    savefig defines the file that the plot is going to be saved in. savefig accepts all the formats accepted by matplotlib such as png, pdf, jpg, … If not provided the plot will be shown in the interactive matplotlib mode.

    e.g. savefig='DOS.png', savefig='DOS.pdf'

  • title (str, optional) –

    Defines the plot title asked to be added above the plot. If title is not defined, PyProcar will not add any title.

    e.g. title="Total Density of States SrVO_$3$". One can use LaTex format as well.

  • plot_total (bool, optional (default True)) –

    If the total density of states is plotted as well as other options. The entry should be python boolian.

    e.g. plot_total=True

  • code (str, optional (default 'vasp')) –

    Defines the Density Functional Theory code used for the calculation. The default of this argument is vasp, so if the cal is done in vasp one does not need to define this argumnet.

    e.g. code=vasp, code=elk, code=abinit

  • labels (list str, optional) –

    labels define the legends plotted in defining each spin.

    e.g. labels=['Oxygen-Up','Oxygen-Down'], labels=['Oxygen-'+r'$\uparrow$','Oxygen-'+r'$\downarrow$'] Side means the string will be treated as raw string. This has to be used if LaTex formating is used. No default is used in the mode=plain, mode=parametric, mode=parametric_line. In mode=stack, ack_species`, mode=stack_orbitals the labels are generated automatically based on the other parameters such as atoms and orbitals.

  • items (dict, optional) –

    items is only relavent for mode='stack'. stack will plot the items defined with stacked filled areas under curve. For clarification visit the examples in the tutorial. items need to be provided as a python dictionary, with keys being specific species and values being projections of orbitals. The following examples can clarify the python lingo.

    e.g. items={'Sr':[0],'O':[1,2,3],'V':[4,5,6,7,8]} or items=dict(Sr=[0],O=[1,2,3],V=[4,5,6,7,8]). The two examples are equivalent to each other. This will plot the following curves stacked on top of each other. projection of s orbital in Sr, projection of p orbitals in O and projection of d orbitals in V. The default is set to take every atom and every orbital. Which will be equivalent to mode='stack_species'

  • ax (matplotlib ax object, optional) –

    ax is a matplotlib axes. In case one wants to put plot generated from this plot in a different figure and treat the output as a subplot in a larger plot.

    e.g.

    >>> # Creates a figure with 3 rows and 2 colomuns
    >>> fig, axs = plt.subplots(3, 2)
    >>> x = np.linspace(-np.pi, np.pi, 1000)
    >>> y = np.sin(x)
    >>> axs[0, 0].plot(x, y)
    >>> pyprocar.dosplot(mode='plain',ax=axs[2, 2]),elimit=[-2,2])
    >>> plt.show()
    

  • plt_show (bool, optional (default True)) –

    whether to show the generated plot or skip to the saving.

    e.g. plt_show=True

Returns

  • fig (matplotlib figure) – The generated figure

  • ax (matplotlib ax object) – The generated ax for this density of states. If one chooses plt_show=False, one can modify the plot using this returned object. e.g.

    >>> fig, ax = pyprocar.dosplot(mode='plain', plt_show=False)
    >>> ax.set_ylim(-2,2)
    >>> fig.show()
    

pyprocar.scriptFermi2D module

pyprocar.scriptFermi2D.fermi2D(file, outcar=None, abinit_output=None, spin=0, atoms=None, orbitals=None, energy=None, fermi=None, rec_basis=None, rot_symm=1, translate=[0, 0, 0], rotation=[0, 0, 0, 1], human=False, mask=None, savefig=None, st=False, noarrow=False, exportplt=False, code='vasp', repair=True)[source]

This module plots 2D Fermi surface.

pyprocar.scriptFermi3D module

pyprocar.scriptFermi3D.add_custom_mesh_slice(plotter, mesh, normal='x', generate_triangles=False, widget_color=None, assign_to_axis=None, tubing=False, origin_translation=True, origin=(0, 0, 0), outline_translation=False, implicit=True, normal_rotation=True, **kwargs)[source]
pyprocar.scriptFermi3D.add_mesh_slice_w_cross_sectional_area(plotter, mesh, normal='x', generate_triangles=False, widget_color=None, assign_to_axis=None, tubing=False, origin_translation=True, origin=(0, 0, 0), outline_translation=False, implicit=True, normal_rotation=True, **kwargs)[source]
pyprocar.scriptFermi3D.fermi3D(procar='PROCAR', outcar='OUTCAR', infile='in.bxsf', abinit_output=None, fermi=None, bands=None, interpolation_factor=1, mode='plain', supercell=[1, 1, 1], extended_zone_directions=None, colors=None, background_color='white', save_colors=False, cmap='jet', atoms=None, orbitals=None, fermi_velocity=False, fermi_velocity_vector=False, effective_mass=False, spin=None, spin_texture=False, arrow_color=None, arrow_size=0.015, only_spin=False, fermi_shift=0, projection_accuracy='normal', code='vasp', vmin=0, vmax=1, savegif=None, savemp4=None, save3d=None, save_meshio=False, perspective=True, save2d=False, show_curvature=False, curvature_type='mean', show_slice=False, slice_normal=(1, 0, 0), slice_origin=(0, 0, 0), show_cross_section_area=False, iso_slider=False, iso_range=2, iso_surfaces=10, camera_pos=[1, 1, 1], widget=False, show=True, repair=True)[source]
Parameters
  • procar (str, optional (default 'PROCAR')) – Path to the PROCAR file of the simulation e.g. procar='~/MgB2/fermi/PROCAR'

  • outcar (str, optional (default 'OUTCAR')) – Path to the OUTCAR file of the simulation e.g. outcar='~/MgB2/fermi/OUTCAR'

  • abinit_output (str, optional (default None)) – Path to the Abinit output file e.g. outcar='~/MgB2/abinit.out'

  • infile (str, optional (default infile = in.bxsf')) – This is the path in the input bxsf file e.g. infile = ni_fs.bxsf'

  • fermi (float, optional (default None)) – Fermi energy at which the fermi surface is created. In other words fermi is the isovalue at which the fermi surface is created. If not defined it is read from the OUTCAR file. e.g. fermi=-5.49

  • bands (list int, optional) – Which bands are going to be plotted in the fermi surface. The numbering is based on vasp outputs. If nothing is selected, this function will iterate over all the bands and plots the ones that cross fermi. e.g. bands=[14, 15, 16, 17]

  • interpolation_factor (int, optional) – The kpoints grid will increase by this factor and interpolated at the new points using Fourier interpolation. e.g. If the kgrid is 5x5x5, interpolation_factor=4 will lead to a kgrid of 20x20x20

  • mode (str, optional (default mode='plain')) – Defines If the fermi surface will have any projection using colormaps or is a plotted with a uniform plain color. e.g. mode='plain', mode='parametric'

  • supercell (list int, optional (default [1, 1, 1])) – If one wants plot more than the 1st brillouin zone, this parameter can be used. e.g. supercell=[2, 2, 2]

  • extended_zone_directions (list of list of size 3, optional (default None)) – If one wants plot more than brillouin zones in a particular direection, this parameter can be used. e.g. extended_zone_directions=[[1,0,0],[0,1,0],[0,0,1]]

  • colors (list str, optional) – List of colors for each band. This argument does not work when a 3d file is saved. The colors for when save3d is used, we recomend using qualitative colormaps, as this function will automatically choose colors from the colormaps. e.g. colors=['red', 'blue', 'green']

  • background_color (str, optional (default white)) – Defines the background color. e.g. background_color='gray'

  • save_colors (bool, optional (default False)) – In case the plot is saved in 3D and some property of the material is projected on the fermi surface, this argument allows the projection to be stored in the 3D file. e.g. save_colors=True

  • cmap (str, optional (default jet)) –

    The color map used for color coding the projections. cmap is only relevant in mode='parametric'. A full list of color maps in matplotlib are provided in this web page. https://matplotlib.org/2.0.1/users/colormaps.html

  • atoms (list int, optional) –

    atoms define the projection of the atoms on the fermi surfcae . In other words it selects only the contribution of the atoms provided. Atoms has to be a python list(or numpy array) containing the atom indices. Atom indices has to be order of the input files of DFT package. atoms is only relevant in mode='parametric'. keep in mind that python counting starts from zero. e.g. for SrVO3 we are choosing only the oxygen atoms. atoms=[2, 3, 4], keep in mind that python counting starts from zero, for a POSCAR similar to following:

    Sr1 V1 O3
    1.0
    3.900891 0.000000 0.000000
    0.000000 3.900891 0.000000
    0.000000 0.000000 3.900891
    Sr V O
    1 1 3
    direct
    0.500000 0.500000 0.500000 Sr atom 0
    0.000000 0.000000 0.000000 V  atom 1
    0.000000 0.500000 0.000000 O  atom 2
    0.000000 0.000000 0.500000 O  atom 3
    0.500000 0.000000 0.000000 O  atom 4
    

    if nothing is specified this parameter will consider all the atoms present.

  • orbitals (list int, optional) –

    orbitals define the projection of orbitals on the fermi surface. In other words it selects only the contribution of the orbitals provided. Orbitals has to be a python list(or numpy array) containing the Orbital indices. Orbitals indices has to be order of the input files of DFT package. The following table represents the indecies for different orbitals in VASP.

    s

    py

    pz

    px

    dxy

    dyz

    dz2

    dxz

    x2-y2

    0

    1

    2

    3

    4

    5

    6

    7

    8

    orbitals is only relavent in mode='parametric' e.g. orbitals=[1,2,3] will only select the p orbitals while orbitals=[4,5,6,7,8] will select the d orbitals. If nothing is specified pyprocar will select all the present orbitals.

  • fermi_velocity_vector (bool, optional (default False)) – Boolean value to calculate fermi velocity vectors on the fermi surface. Must be used with mode= “property_projection”. e.g. fermi_velocity_vector=True

  • fermi_velocity (bool, optional (default False)) – Boolean value to calculate magnitude of the fermi velocity on the fermi surface. Must be used with mode= “property_projection”. e.g. fermi_velocity=True

  • effective_mass (bool, optional (default False)) – Boolean value to calculate the harmonic mean of the effective mass on the fermi surface. Must be used with mode= “property_projection”. e.g. effective_mass=True

  • spin (list int, optional) – e.g. spin=[0]

  • spin_texture (bool, optional (default False)) – In non collinear calculation one can choose to plot the spin texture on the fermi surface. e.g. spin_texture=True

  • arrow_color (str, optional) – Defines the color of the arrows when spin_texture=True. The default will select the colors based on the color map specified. If arrow_color is selected, all arrows will have the same color. e.g. arrow_color='red'

  • arrow_size (int, optional) – As the name suggests defines the size of the arrows, when spin texture is selected. e.g. arrow_size=3

  • only_spin (bool, optional) – If only_spin=True is selected, the fermi surface is not plotted and only the spins in the spin texture is plotted.

  • fermi_shift (float, optional) – This parameter is useful when one wants to plot the iso-surface above or belove the fermi level. e.g. fermi_shift=0.6

  • projection_accuracy (str, optional (default 'normal')) – Selected the accuracy of projected properties. 'normal' and 'high' are the only two options. 'normal' uses the fast but rather inaccurate nearest neighbor interpolation, while 'high' uses the more accurate linear interpolation for the projection of the properties. e.g. projection_accuracy='high'

  • code (str, optional (default 'vasp')) – The DFT code in which the calculation is performed with. Also, if you want to read a .bxsf file set code =”bxsf” e.g. code='vasp'

  • vmin (float, optional) – The maximum value in the color bar. cmap is only relevant in mode='parametric'. e.g. vmin=-1.0

  • vmax (float, optional) – The maximum value in the color bar. cmap is only relevant in mode='parametric'. e.g. vmax=1.0

  • savegif (str, optional) – pyprocar can save the fermi surface in a gif format. savegif is the path to which the gif is saved. e.g. savegif='fermi.gif' or savegif='~/MgB2/fermi.gif'

  • savemp4 (str, optional) – pyprocar can save the fermi surface in a mp4 video format. savemp4 is the path to which the video is saved. e.g. savegif='fermi.mp4' or savegif='~/MgB2/fermi.mp4'

  • save3d (str, optional) – pyprocar can save the fermi surface in a 3d file format. pyprocar uses the trimesh to save the 3d file. trimesh can export files with the following formats STL, binary PLY, ASCII OFF, OBJ, GLTF/GLB 2.0, COLLADA. save3d is the path to which the file is saved. e.g. save3d='fermi.glb'

  • save_meshio (bool, optional) – pyprocar can use meshio to save any 3d format supported by it.

  • perspective (bool, optional) – To create the illusion of depth, perspective is used in 2d graphics. One can turn this feature off by perspective=False e.g. perspective=False

  • save2d (str, optional) – The fermi surface can be saved as a 2D image. This parameter turns this feature on and selects the path at which the file is going to be saved. e.g. save2d='fermi.png'

  • show_slice (bool, optional) – Creates a widget which slices the fermi surface

  • slice_origin (tuple, optional) – Origin to put the plane widget

  • slice_normal (bool, optional) – Normal of the plane widget

  • show_cross_section_area (bool, optional) – Shows the largest cross sectional area

  • show_curvature (bool, optional) – plots the curvature of the fermi surface

  • curvature_type (str, optional) – If show_curvature is True, this option chooses the type of curvature availible in Pyvista. (‘mean’, ‘gaussian’, ‘maximum’, ‘minimum’)

  • iso_slider (bool, optional) – plots a slider widget which controls which iso_energy value viewed

  • iso_range (float, optional) – If iso_slider is True, this specifies the energy range around the fermi surface to view

  • iso_surfaces (int, optional) – If iso_slider is True, this specifies how many surfaces to generate in the range specified around the fermi surface

  • camera_pos (list float, optional (default [1, 1, 1])) – This parameter defines the position of the camera where it is looking at the fermi surface. This feature is important when one chooses to use the save2d, savegif or savemp4 option. e.g. camera_pos=[0.5, 1, -1]

  • widget (, optional) –

  • show (bool, optional (default True)) – If set to False it will not show the 3D plot.

Returns

  • s (pyprocar surface object) – The whole fermi surface added bands

  • surfaces (list pyprocar surface objects) – list of fermi surface of each band

pyprocar.scriptFermi3D.find_nearest(array, value)[source]

pyprocar.scriptFilter module

pyprocar.scriptFilter.filter(inFile, outFile, atoms=None, orbitals=None, orbital_names=None, bands=None, spin=None, kpoints=None, human_atoms=False)[source]

This module filters the PROCAR file and re-write a new one.

pyprocar.scriptKmesh2D module

pyprocar.scriptKmesh2D.generate2dkmesh(x1, y1, x2, y2, z, nkx, nky)[source]

This module generates a KPOINTS mesh file for 2D plotting.

pyprocar.scriptKpath module

@author : Uthpala Herath

pyprocar.scriptKpath.kpath(infile=None, outfile='KPOINTS', grid_size=40, with_time_reversal=True, recipe='hpkot', threshold=1e-07, symprec=1e-05, angle_tolerence=- 1.0, supercell_matrix=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]))[source]

This module creates a KPOINTS file for band structure plotting.

Parameters
  • infile (str, optional) –

  • outfile (str, optional) –

  • grid_size (int, optional) –

  • with_time_reversal (bool, optional) –

  • recepie (str, optional) –

  • threshold (float, optional) –

  • symprec (float, optional) –

  • angle_tolerence (float, optional) –

  • supercell_matrix (list, int) –

pyprocar.scriptRepair module

pyprocar.scriptRepair.repair(infile, outfile)[source]

This module calls ProcarRepair to repair the PROCAR file.

pyprocar.scriptSpin_asymmetry module

pyprocar.scriptUnfold module

pyprocar.scriptUnfold.unfold(procar='PROCAR', poscar='POSCAR', outcar='OUTCAR', vaspxml=None, abinit_output='abinit.out', transformation_matrix=array([[2, 0, 0], [0, 2, 0], [0, 0, 2]]), kpoints=None, elkin='elk.in', code='vasp', mode='plain', unfold_mode='both', spins=None, atoms=None, orbitals=None, items=None, projection_mask=None, unfold_mask=None, fermi=None, interpolation_factor=1, interpolation_type='cubic', vmax=None, vmin=None, kticks=None, knames=None, kdirect=True, elimit=None, ax=None, show=True, savefig=None, old=False, savetab='unfold_result.csv', **kwargs)[source]
Parameters
  • fname (PROCAR filename.) –

  • poscar (POSCAR filename) –

  • outcar (OUTCAR filename, for reading fermi energy. You can also use efermi and set outcar=None) –

  • supercell_matrix (supercell matrix from primitive cell to supercell) –

  • ispin (For non-spin polarized system, ispin=None.) – For spin polarized system: ispin=1 is spin up, ispin=2 is spin down.

  • efermi (Fermi energy) –

  • elimit (range of energy to be plotted.) –

  • kticks (the indices of K points which has labels given in knames.) –

  • knames (see kticks) –

  • print_kpts (print all the kpoints to screen. This is to help find the kticks and knames.) –

  • show_band (whether to plot the bands before unfolding.) –

  • width (the width of the unfolded band.) –

  • color (color of the unfoled band.) –

  • savetab (the csv file name of which the table of unfolding result will be written into.) –

  • savefig (the file name of which the figure will be saved.) –

  • exportplt (flag to export plot as matplotlib.pyplot object.) –

pyprocar.scriptVector module

pyprocar.scriptVector.Vector(infile, bands=None, energy=None, fermi=None, atoms=None, orbitals=None, outcar=None, scale=0.1, code='vasp', repair=True)[source]

pyprocar.splash module

pyprocar.splash.welcome()[source]

Module contents