Skip to content

VASP

Optional dependency

VASPCalculator has no materialsframework extra. It wraps a separately installed, licensed VASP binary, configured via the command argument or the ASE_VASP_COMMAND/VASP_COMMAND/VASP_SCRIPT env vars, plus VASP_PP_PATH for pseudopotentials. See Non-Extra Calculators or ASE's VASP documentation for details.

VASPCalculator

VASPCalculator(
    *,
    command: str | None = None,
    directory: str | None = None,
    prec: str | None = None,
    pp: str | None = None,
    kpts: Any | None = None,
    xc: str | None = None,
    encut: float | None = None,
    ismear: int | None = None,
    sigma: float | None = None,
    ediff: float | None = None,
    ediffg: float | None = None,
    ibrion: int | None = None,
    isif: int | None = None,
    nsw: int | None = None,
    nelm: int | None = None,
    ispin: int | None = None,
    setups: Any | None = None,
    lreal: str | None = None,
    ncore: int | None = None,
    **kwargs: Any,
)

A calculator class for performing material property calculations and relaxations using VASP via ASE.

The VASPCalculator configures INCAR/KPOINTS/POTCAR settings through ASE’s Vasp calculator and exposes a lazy calculator property that constructs the underlying ASE calculator on first use.

Attributes:

Name Type Description
AVAILABLE_PROPERTIES list[str]

Properties this calculator can request/return: "energy", "free_energy", "forces", "dipole", "fermi", "stress", "magmom", "magmoms".

Notes
  • Requires a working, licensed VASP installation.
  • You can pass the VASP launch string via the command argument, or set one of the environment variables ASE_VASP_COMMAND, VASP_COMMAND, or VASP_SCRIPT.
  • ASE expects pseudopotentials under VASP_PP_PATH containing subfolders like potpaw, potpaw_GGA, and potpaw_PBE.
References
  • VASP documentation: https://www.vasp.at/wiki/index.php
  • ASE VASP calculator: https://ase-lib.org/ase/calculators/vasp.html

Initialize the VASPCalculator.

Parameters:

Name Type Description Default
command str | None

Launch string for VASP, e.g. "mpirun -np 8 vasp_std". If omitted, ASE will use $ASE_VASP_COMMAND or $VASP_COMMAND or $VASP_SCRIPT.

None
directory str | None

Working directory for the calculation (where ASE writes inputs and runs VASP).

None
prec str | None

VASP Precision setting, e.g. "Normal", "Accurate", "Single".

None
pp str | None

Pseudopotential set selector (e.g., "PBE", "PW91", "LDA"), which maps to subdirectories under $VASP_PP_PATH (potpaw_PBE/, potpaw_GGA/, potpaw/). You can also pass a specific folder name present on $VASP_PP_PATH.

None
kpts Any | None

K-point sampling. Options: - scalar int/float: VASP “Automatic” scheme via a length cutoff, - sequence [nx, ny, nz]: Monkhorst–Pack mesh (Gamma-centered if gamma=True), - explicit (n, 3) or (n, 4) array of points (optional weights in 4th column).

None
xc str | None

Exchange-correlation functional, e.g. "pbe", "pbesol", "lda", etc.

None
encut float | None

Plane-wave energy cutoff in eV.

None
ismear int | None

Smearing method, e.g., -5 (tetrahedron w/ Blöchl corrections), -1 (Fermi), 0 (Gaussian), 1 (Methfessel-Paxton), etc.

None
sigma float | None

Smearing width (eV) for Gaussian/Methfessel–Paxton.

None
ediff float | None

Electronic (SCF) energy convergence threshold in eV.

None
ediffg float | None

Force convergence criterion in eV/Å.

None
ibrion int | None

Ionic relaxation algorithm, e.g., -1 (no update), 0 (molecular dynamics), 1 (RMM-DIIS), 2 (conjugate gradient), etc.

None
isif int | None

Stress calculation and relaxation settings, e.g., 2 (relax ions, keep cell fixed), 3 (relax ions and cell shape), etc.

None
nsw int | None

Number of ionic steps for relaxation.

None
nelm int | None

Maximum number of electronic steps per SCF loop.

None
ispin int | None

Spin polarization setting, e.g., 1 (non-spin polarized), 2 (spin polarized).

None
setups Any | None

Pseudopotential setups, e.g. "minimal", "recommended", "materialsproject", etc.

None
lreal str | None

Real-space projection setting, e.g. "Auto", "True", "False".

None
ncore int | None

Parallelization knob controlling VASP workload distribution (see VASP manual).

None
**kwargs Any

Additional keyword arguments passed to BaseCalculator and any remaining to ase.calculators.vasp.Vasp. Common VASP/INCAR/KPOINTS options exposed for convenience. Any of these left as None are simply not written—VASP defaults apply. (ASE will only write non-None INCAR keys.)

{}

calculator property

calculator: Vasp

Lazily construct and return the ASE Vasp calculator configured with stored options.

Returns:

Name Type Description
Vasp Vasp

Configured ase.calculators.vasp.Vasp instance.

relax

relax(
    structure: Atoms | Structure | Molecule, **kwargs
) -> dict[str, Any]

Performs relaxation on a structure using VASP via ASE.

Parameters:

Name Type Description Default
structure Atoms | Structure | Molecule

Structure to relax.

required
**kwargs

Additional keyword arguments passed to ase.calculators.vasp.Vasp.

{}

Returns:

Name Type Description
dict dict[str, Any]

A dictionary containing the final relaxed structure and any computed properties listed in AVAILABLE_PROPERTIES.

dict[str, Any]

Keys in the dictionary: - "final_structure" (Structure): The final relaxed structure. - Other keys corresponding to properties in AVAILABLE_PROPERTIES, each containing the respective value from the calculator's results.

calculate

calculate(
    structure: Atoms | Structure | Molecule,
) -> dict[str, Any]

Performs a static calculation.

Parameters:

Name Type Description Default
structure Atoms | Structure | Molecule

Structure to calculate.

required

Returns:

Name Type Description
dict dict[str, Any]

A dictionary containing the final calculated structure and any computed properties listed in

dict[str, Any]

AVAILABLE_PROPERTIES.

dict[str, Any]

Keys in the dictionary:

dict[str, Any]
  • "final_structure" (Structure): The final calculated structure.
dict[str, Any]
  • Other keys corresponding to properties in AVAILABLE_PROPERTIES, each containing the respective value from the calculator's results.