PLUGINS/LOCAL POTENTIAL: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
Line 4: Line 4:
----
----


When {{TAG|PLUGINS/LOCAL_POTENTIAL}}=.TRUE., VASP calls the <code>local_potential</code> Python function. See here for details on how to setup your Python script such that VASP can recognize it.
When {{TAG|PLUGINS/LOCAL_POTENTIAL}}=.TRUE., VASP calls the <code>local_potential</code> Python function.  
See here for details on how to setup your Python script such that VASP can recognize it.


The primary use-case of this tag is to add to the local potential and the total energy of a VASP calculation through a Python plugin.
The primary use-case of this tag is to add a quantity on the real space grid to the local potential and a scalar quantity to the total energy of a VASP calculation through a Python plugin.


==Expected Inputs==
==Expected Inputs==
Line 13: Line 14:
     def local_potential(constants, additions):
     def local_potential(constants, additions):
where <code>constants</code> and <code>additions</code> and [https://docs.python.org/3/library/dataclasses.html Python dataclasses].
where <code>constants</code> and <code>additions</code> and [https://docs.python.org/3/library/dataclasses.html Python dataclasses].
The <code>constants</code> dataclass consists of the following inputs, listed here with their associated [https://numpy.org/doc/stable/user/basics.types.html datatypes]
    ENCUT: float
    NELECT: float
    shape_grid: NDArray[np.int32]
    number_ions: int
    number_ion_types: int
    ion_types: NDArray[np.int32]
    atomic_numbers: NDArray[np.int32]
    lattice_vectors: NDArray[np.float64]
    positions: NDArray[np.float64]
    ZVAL: NDArray[np.float64]
    charge_density: NDArray[np.float64]
    hartree_potential: NDArray[np.float64]
    ion_potential: NDArray[np.float64]
    dipole_moment: NDArray[np.float64]


 
{{NB| mind | The dipole moment is provided only if {{TAG|LDIPOL}}=.TRUE.}}
 
{{NB| mind | Pay attention to ''common pitfall'' and the interplay with {{TAG|MYOTHER}}.}}





Revision as of 07:29, 11 June 2024

PLUGINS/LOCAL_POTENTIAL = .TRUE. | .FALSE. 

Description: PLUGINS/LOCAL_POTENTIAL calls the Python plugin for the local potential interface for each SCF step


When PLUGINS/LOCAL_POTENTIAL=.TRUE., VASP calls the local_potential Python function. See here for details on how to setup your Python script such that VASP can recognize it.

The primary use-case of this tag is to add a quantity on the real space grid to the local potential and a scalar quantity to the total energy of a VASP calculation through a Python plugin.

Expected Inputs

The local_potential Python function expects the following inputs,

   def local_potential(constants, additions):

where constants and additions and Python dataclasses. The constants dataclass consists of the following inputs, listed here with their associated datatypes

   ENCUT: float
   NELECT: float
   shape_grid: NDArray[np.int32]
   number_ions: int
   number_ion_types: int
   ion_types: NDArray[np.int32]
   atomic_numbers: NDArray[np.int32]
   lattice_vectors: NDArray[np.float64]
   positions: NDArray[np.float64]
   ZVAL: NDArray[np.float64]
   charge_density: NDArray[np.float64]
   hartree_potential: NDArray[np.float64]
   ion_potential: NDArray[np.float64]
   dipole_moment: NDArray[np.float64]


Mind: {{{2}}}


If there are many tag options, making each option a heading may pay off. This way, the table of contents provides a good overview. However, for three options, the list below suffices.

Deprecated: This functionality is not supported in VASP version > 5.4.4.
A concise description of this algorithm. A long description deserves an overview article.
A concise description of this algorithm. A long description deserves an overview article.
Warning: Do not combine with ...
You do not need to use a NB template everywhere, and it can be used anywhere before, after, and in between paragraphs.
Tip: Do not combine with ...

Second section

Give details about an issue that can arise here and offer some advice. The paragraph started with an indent. Add your references on Template:Cite and cite using a command like this[1].

where Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Related tags and articles

MYOTHER, MYTHIRD

Examples that use this tag

References


Contents