Skip to content

_base

Core recipes for VASP.

run_and_summarize

run_and_summarize(
    atoms: Atoms,
    preset: str | None = None,
    calc_defaults: dict[str, Any] | None = None,
    calc_swaps: dict[str, Any] | None = None,
    report_mp_corrections: bool = False,
    additional_fields: dict[str, Any] | None = None,
    copy_files: (
        SourceDirectory
        | dict[SourceDirectory, Filenames]
        | None
    ) = None,
) -> VaspSchema

Base job function for VASP recipes.

Parameters:

  • atoms (Atoms) –

    Atoms object

  • preset (str | None, default: None ) –

    Preset to use from quacc.calculators.vasp.presets.

  • calc_defaults (dict[str, Any] | None, default: None ) –

    Default parameters for the recipe.

  • calc_swaps (dict[str, Any] | None, default: None ) –

    Dictionary of custom kwargs for the Vasp calculator. Set a value to None to remove a pre-existing key entirely. For a list of available keys, refer to quacc.calculators.vasp.vasp.Vasp.

  • report_mp_corrections (bool, default: False ) –

    Whether to report the Materials Project corrections in the results.

  • additional_fields (dict[str, Any] | None, default: None ) –

    Additional fields to supply to the summarizer.

  • copy_files (SourceDirectory | dict[SourceDirectory, Filenames] | None, default: None ) –

    Files to copy (and decompress) from source to the runtime directory.

Returns:

Source code in quacc/recipes/vasp/_base.py
def run_and_summarize(
    atoms: Atoms,
    preset: str | None = None,
    calc_defaults: dict[str, Any] | None = None,
    calc_swaps: dict[str, Any] | None = None,
    report_mp_corrections: bool = False,
    additional_fields: dict[str, Any] | None = None,
    copy_files: SourceDirectory | dict[SourceDirectory, Filenames] | None = None,
) -> VaspSchema:
    """
    Base job function for VASP recipes.

    Parameters
    ----------
    atoms
        Atoms object
    preset
        Preset to use from `quacc.calculators.vasp.presets`.
    calc_defaults
        Default parameters for the recipe.
    calc_swaps
        Dictionary of custom kwargs for the Vasp calculator. Set a value to
        `None` to remove a pre-existing key entirely. For a list of available
        keys, refer to [quacc.calculators.vasp.vasp.Vasp][].
    report_mp_corrections
        Whether to report the Materials Project corrections in the results.
    additional_fields
        Additional fields to supply to the summarizer.
    copy_files
        Files to copy (and decompress) from source to the runtime directory.

    Returns
    -------
    VaspSchema
        Dictionary of results
    """
    calc_flags = recursive_dict_merge(calc_defaults, calc_swaps)

    atoms.calc = Vasp(atoms, preset=preset, **calc_flags)
    final_atoms = run_calc(atoms, copy_files=copy_files)

    return vasp_summarize_run(
        final_atoms,
        report_mp_corrections=report_mp_corrections,
        additional_fields=additional_fields,
    )

run_and_summarize_opt

run_and_summarize_opt(
    atoms: Atoms,
    preset: str | None = None,
    calc_defaults: dict[str, Any] | None = None,
    calc_swaps: dict[str, Any] | None = None,
    opt_defaults: dict[str, Any] | None = None,
    opt_params: OptParams | None = None,
    report_mp_corrections: bool = False,
    additional_fields: dict[str, Any] | None = None,
    copy_files: (
        SourceDirectory
        | dict[SourceDirectory, Filenames]
        | None
    ) = None,
) -> VaspASEOptSchema

Base job function for VASP recipes with ASE optimizers.

Parameters:

  • atoms (Atoms) –

    Atoms object

  • preset (str | None, default: None ) –

    Preset to use from quacc.calculators.vasp.presets.

  • calc_defaults (dict[str, Any] | None, default: None ) –

    Default parameters for the recipe.

  • calc_swaps (dict[str, Any] | None, default: None ) –

    Dictionary of custom kwargs for the Vasp calculator. Set a value to None to remove a pre-existing key entirely. For a list of available keys, refer to quacc.calculators.vasp.vasp.Vasp.

  • opt_defaults (dict[str, Any] | None, default: None ) –

    Default arguments for the ASE optimizer.

  • opt_params (OptParams | None, default: None ) –

    Dictionary of custom kwargs for quacc.runners.ase.run_opt

  • report_mp_corrections (bool, default: False ) –

    Whether to report the Materials Project corrections in the results.

  • additional_fields (dict[str, Any] | None, default: None ) –

    Additional fields to supply to the summarizer.

  • copy_files (SourceDirectory | dict[SourceDirectory, Filenames] | None, default: None ) –

    Files to copy (and decompress) from source to the runtime directory.

Returns:

Source code in quacc/recipes/vasp/_base.py
def run_and_summarize_opt(
    atoms: Atoms,
    preset: str | None = None,
    calc_defaults: dict[str, Any] | None = None,
    calc_swaps: dict[str, Any] | None = None,
    opt_defaults: dict[str, Any] | None = None,
    opt_params: OptParams | None = None,
    report_mp_corrections: bool = False,
    additional_fields: dict[str, Any] | None = None,
    copy_files: SourceDirectory | dict[SourceDirectory, Filenames] | None = None,
) -> VaspASEOptSchema:
    """
    Base job function for VASP recipes with ASE optimizers.

    Parameters
    ----------
    atoms
        Atoms object
    preset
        Preset to use from `quacc.calculators.vasp.presets`.
    calc_defaults
        Default parameters for the recipe.
    calc_swaps
        Dictionary of custom kwargs for the Vasp calculator. Set a value to
        `None` to remove a pre-existing key entirely. For a list of available
        keys, refer to [quacc.calculators.vasp.vasp.Vasp][].
    opt_defaults
        Default arguments for the ASE optimizer.
    opt_params
        Dictionary of custom kwargs for [quacc.runners.ase.run_opt][]
    report_mp_corrections
        Whether to report the Materials Project corrections in the results.
    additional_fields
        Additional fields to supply to the summarizer.
    copy_files
        Files to copy (and decompress) from source to the runtime directory.

    Returns
    -------
    VaspASEOptSchema
        Dictionary of results
    """
    calc_flags = recursive_dict_merge(calc_defaults, calc_swaps)
    opt_flags = recursive_dict_merge(opt_defaults, opt_params)

    atoms.calc = Vasp(atoms, preset=preset, **calc_flags)
    dyn = run_opt(atoms, copy_files=copy_files, **opt_flags)

    return summarize_vasp_opt_run(
        dyn,
        report_mp_corrections=report_mp_corrections,
        additional_fields=additional_fields,
    )