pymatgen.io.aims.sets package

Submodules

pymatgen.io.aims.sets.base module

Module defining base FHI-aims input set and generator.

class AimsInputGenerator(user_params: dict[str, ~typing.Any] = <factory>, user_kpoints_settings: dict[str, ~typing.Any] = <factory>)[source]

Bases: InputGenerator

A class to generate Aims input sets.

Parameters:
  • user_params (dict[str, Any]) – Updates the default parameters for the FHI-aims calculator

  • user_kpoints_settings (dict[str, Any]) – The settings used to create the k-grid parameters for FHI-aims

d2k(structure: Structure, kptdensity: float | list[float] = 5.0, even: bool = True) Iterable[float][source]

Convert k-point density to Monkhorst-Pack grid size.

inspired by [ase.calculators.calculator.kptdensity2monkhorstpack]

Parameters:
  • structure (Structure) – Contains unit cell and information about boundary conditions.

  • kptdensity (float or list of floats) – Required k-point density. Default value is 5.0 point per Ang^-1.

  • even (bool) – Round up to even numbers.

Return type:

Monkhorst-Pack grid size in all directions

static d2k_recipcell(recipcell: np.ndarray, pbc: Sequence[bool], kptdensity: float | Sequence[float] = 5.0, even: bool = True) Sequence[int][source]

Convert k-point density to Monkhorst-Pack grid size.

Parameters:
  • recipcell (Cell) – The reciprocal cell

  • pbc (Sequence[bool]) – If element of pbc is True then system is periodic in that direction

  • kptdensity (float or list[floats]) – Required k-point density. Default value is 3.5 point per Ang^-1.

  • even (bool) – Round up to even numbers.

Return type:

Monkhorst-Pack grid size in all directions

get_input_set(structure: Structure | Molecule | None = None, prev_dir: str | Path | None = None, properties: list[str] | None = None) AimsInputSet[source]

Generate an AimsInputSet object.

Parameters:
  • structure (Structure or Molecule) – Structure or Molecule to generate the input set for.

  • prev_dir (str or Path) – Path to the previous working directory

  • properties (list[str]) – System properties that are being calculated

Return type:

The input set for the calculation of structure

get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[str, Any][source]

Update the parameters for a given calculation type.

Parameters:
  • structure (Structure or Molecule) – The system to run

  • prev_parameters (dict[str, Any]) – Previous calculation parameters.

Return type:

A dictionary of updates to apply.

k2d(structure: Structure, k_grid: ndarray[int])[source]

Generate the kpoint density in each direction from given k_grid.

Parameters:
  • structure (Structure) – Contains unit cell and information about boundary conditions.

  • k_grid (np.ndarray[int]) – k_grid that was used.

Return type:

Density of kpoints in each direction. result.mean() computes average density

user_kpoints_settings: dict[str, Any][source]
user_params: dict[str, Any][source]
class AimsInputSet(parameters: dict[str, Any], structure: Structure | Molecule, properties: Sequence[str] = ('energy', 'free_energy'))[source]

Bases: InputSet

A class to represent a set of Aims inputs.

Construct the AimsInputSet.

Parameters:
  • parameters (dict[str, Any]) – The ASE parameters object for the calculation

  • structure (Structure or Molecule) – The Structure/Molecule objects to create the inputs for

  • properties (Sequence[str]) – The properties to calculate for the calculation

property control_in: str | slice | InputFile[source]

Get the control.in file contents.

property geometry_in: str | slice | InputFile[source]

Get the geometry.in file contents.

get_input_files() tuple[str, str][source]

Get the input file contents for the calculation.

Returns:

The contents of the control.in and geometry.in file

Return type:

tuple[str, str]

property params_json: str | slice | InputFile[source]

Get the JSON representation of the parameters dict.

remove_parameters(keys: Iterable[str] | str, strict: bool = True) dict[str, Any][source]

Remove the aims parameters listed in keys.

This removes the aims variables from the parameters object.

Parameters:
  • keys (Iterable[str] or str) – string or list of strings with the names of the aims parameters to be removed.

  • strict (bool) – whether to raise a KeyError if one of the aims parameters to be removed is not present.

Returns:

Dictionary with the variables that have been removed.

Return type:

dict[str, Any]

set_parameters(*args, **kwargs) dict[str, Any][source]

Set the parameters object for the AimsTemplate.

This sets the parameters object that is passed to an AimsTemplate and resets the control.in file

One can pass a dictionary mapping the aims variables to their values or the aims variables as keyword arguments. A combination of the two options is also allowed.

Returns:

dictionary with the variables that have been added.

Return type:

dict[str, Any]

set_structure(structure: Structure | Molecule)[source]

Set the structure object for this input set.

Parameters:

structure (Structure or Molecule) – The new Structure or Molecule for the calculation

recursive_update(dct: dict, up: dict) dict[source]

Update a dictionary recursively and return it.

Parameters:
  • (dict) (up) –

  • (dict)

Return type:

The updated dictionary.

Example

d = {‘activate_hybrid’: {“hybrid_functional”: “HSE06”}} u = {‘activate_hybrid’: {“cutoff_radius”: 8}}

yields {‘activate_hybrid’: {“hybrid_functional”: “HSE06”, “cutoff_radius”: 8}}}

pymatgen.io.aims.sets.bs module

Input sets for band structure calculations.

class BandStructureSetGenerator(user_params: dict[str, ~typing.Any] = <factory>, user_kpoints_settings: dict[str, ~typing.Any] = <factory>, calc_type: str = 'bands', k_point_density: float = 20)[source]

Bases: AimsInputGenerator

A generator for the band structure calculation input set.

Parameters:
  • calc_type (str) – The type of calculations

  • k_point_density (float) – The number of k_points per angstrom

calc_type: str = 'bands'[source]
get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[str, Sequence[str]][source]

Get the parameter updates for the calculation.

Parameters:
  • structure (Structure) – The structure to calculate the bands for

  • prev_parameters (Dict[str, Any]) – The previous parameters

Return type:

The updated for the parameters for the output section of FHI-aims

k_point_density: float = 20[source]
class GWSetGenerator(user_params: dict[str, ~typing.Any] = <factory>, user_kpoints_settings: dict[str, ~typing.Any] = <factory>, calc_type: str = 'GW', k_point_density: float = 20)[source]

Bases: AimsInputGenerator

A generator for the input set for calculations employing GW self-energy correction.

Parameters:
  • calc_type (str) – The type of calculations

  • k_point_density (float) – The number of k_points per angstrom

calc_type: str = 'GW'[source]
get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[str, Any][source]

Get the parameter updates for the calculation.

Parameters:
  • structure (Structure or Molecule) – The structure to calculate the bands for

  • prev_parameters (Dict[str, Any]) – The previous parameters

Return type:

The updated for the parameters for the output section of FHI-aims

k_point_density: float = 20[source]
prepare_band_input(structure: Structure, density: float = 20)[source]

Prepare the band information needed for the FHI-aims control.in file.

Parameters:
  • structure (Structure) – The structure for which the band path is calculated

  • density (float) – Number of kpoints per Angstrom.

pymatgen.io.aims.sets.core module

Module defining core FHI-aims input set generators.

class RelaxSetGenerator(user_params: dict[str, ~typing.Any] = <factory>, user_kpoints_settings: dict[str, ~typing.Any] = <factory>, calc_type: str = 'relaxation', relax_cell: bool = True, max_force: float = 0.001, method: str = 'trm')[source]

Bases: AimsInputGenerator

Class to generate FHI-aims relax sets.

I.e., sets for optimization of internal and lattice coordinates.

Parameters:
  • calc_type (str) – The type of calculation

  • relax_cell (bool) – If True then relax the unit cell from the structure

  • max_force (float) – Maximum allowed force in the calculation

  • method (str) – Method used for the geometry optimization

calc_type: str = 'relaxation'[source]
get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[source]

Get the parameter updates for the calculation.

Parameters:
  • structure (Structure or Molecule) – The structure to calculate the bands for

  • prev_parameters (Dict[str, Any]) – The previous parameters

Return type:

The updated for the parameters for the output section of FHI-aims

max_force: float = 0.001[source]
method: str = 'trm'[source]
relax_cell: bool = True[source]
class SocketIOSetGenerator(user_params: dict[str, ~typing.Any] = <factory>, user_kpoints_settings: dict[str, ~typing.Any] = <factory>, calc_type: str = 'multi_scf', host: str = 'localhost', port: int = 12345)[source]

Bases: AimsInputGenerator

Class to generate FHI-aims input sets for running with the socket.

Parameters:
  • calc_type (str) – The type of calculation

  • host (str) – The hostname for the server the socket is on

  • port (int) – The port the socket server is listening on

calc_type: str = 'multi_scf'[source]
get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[source]

Get the parameter updates for the calculation.

Parameters:
  • structure (Structure or Molecule) – The structure to calculate the bands for

  • prev_parameters (Dict[str, Any]) – The previous parameters

Return type:

The updated for the parameters for the output section of FHI-aims

host: str = 'localhost'[source]
port: int = 12345[source]
class StaticSetGenerator(user_params: dict[str, ~typing.Any] = <factory>, user_kpoints_settings: dict[str, ~typing.Any] = <factory>, calc_type: str = 'static')[source]

Bases: AimsInputGenerator

Common class for ground-state generators.

Parameters:

calc_type (str) – The type of calculation

calc_type: str = 'static'[source]
get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[str, Any][source]

Get the parameter updates for the calculation.

Parameters:
  • structure (Structure or Molecule) – The structure to calculate the bands for

  • prev_parameters (Dict[str, Any]) – The previous parameters

Return type:

The updated for the parameters for the output section of FHI-aims