workfunction

py4vasp.calculation.workfunction

(

  • data_context,
  • **kwargs

)

The workfunction describes the energy required to remove an electron to the vacuum.

The workfunction of a material is the minimum energy required to remove an electron from its most loosely bound state and move it to an energy level just outside the material’s surface. In other words, it represents the energy barrier that electrons must overcome to escape the material. The workfunction helps understanding electronic emission phenomena in surface science and materials engineering. In VASP, you can compute the workfunction by setting the IDIPOL flag in the INCAR file. This class provides then the functionality to analyze the resulting potential.

path

Returns the path from which the output is obtained.

plot

(*args, **kwargs)

Almost same as the to_graph() function.

All arguments will be passed to to_graph. If the to_graph() would produce multiple graphs this method will merge them into a single one.

print

()
Print a string representation of this instance.

read

(*args, **kwargs)
Convenient wrapper around to_dict. Check that function for examples and optional arguments.

selections

() → dict

Returns possible alternatives for this particular quantity VASP can produce.

The returned dictionary contains a single item with the name of the quantity mapping to all possible selections. Each of these selection may be passed to other functions of this quantity to select which output of VASP is used. Some quantities provide additional elements which can be passed as selection for other routines.

Returns

dict
The key indicates this quantity and the values possible choices for arguments to other functions of this quantity.

to_csv

(

  • *args,
  • filename: str | Path = None,
  • **kwargs

)

Writes the data to a csv file.

Writes out a csv file for data stored in a dataframe generated with the to_frame() method. Useful for creating external plots for further analysis.

If no filename is provided a default filename is deduced from the name of the class.

Note that the filename must be a keyword argument, i.e., you explicitly need to write filename=”name_of_file” because the arguments are passed on to the to_graph() method. Please check the documentation of that method to learn which arguments are allowed.

Parameters

filename: str | Path = None
Name of the csv file which the data is exported to.

to_dict

() → dict

Reports useful information about the workfunction as a dictionary.

In addition to the vacuum potential, the dictionary contains typical reference energies such as the valence band maximum, the conduction band minimum, and the Fermi energy. Furthermore you obtain the average potential, so you can use a different algorithm to determine the vacuum potential if desired.

Returns

dict
Contains vacuum potential, average potential and relevant reference energies within the surface.

to_frame

(*args, **kwargs) → Dataframe

Convert data to pandas dataframe.

This will first convert use the to_graph() method to convert to a Graph. All arguments are passed to that method. The resulting graph is then converted to a dataframe.

Returns

Dataframe
Pandas dataframe corresponding to data in the graph

to_graph

() → Graph

Plot the average potential along the lattice vector selected by IDIPOL.

Returns

Graph
A plot where the distance in the unit cell along the selected lattice vector is on the x axis and the averaged potential across the plane of the other two lattice vectors is on the y axis.

to_image

(

  • *args,
  • filename = None,
  • **kwargs

)

Read the data and generate an image writing to the given filename.

The filetype is automatically deduced from the filename; possible are common raster (png, jpg) and vector (svg, pdf) formats. If no filename is provided a default filename is deduced from the name of the class and the picture has png format.

Note that the filename must be a keyword argument, i.e., you explicitly need to write filename=”name_of_file” because the arguments are passed on to the to_graph() method. Please check the documentation of that method to learn which arguments are allowed.

to_plotly

(*args, **kwargs)

Produces a graph and convertes it to a plotly figure.

The arguments to this function are passed on to the to_graph() method. Takes the resulting graph and converts it to a plotly figure.