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>, use_structure_charge: bool = False)[source]
Bases:
InputGenerator
A class to generate Aims input sets.
- user_params[source]
Updates the default parameters for the FHI-aims calculator
- Type:
dict[str, Any]
- user_kpoints_settings[source]
The settings used to create the k-grid parameters for FHI-aims
- Type:
dict[str, Any]
- use_structure_charge[source]
If set to True, then the overall charge of the structure (structure.charge) is used to set the charge variable in the control.in. Default is False.
- Type:
bool
- d2k(structure: Structure, kpt_density: float | tuple[float, float, 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.
kpt_density (float | list[float]) – Required k-point density. Default value is 5.0 point per Ang^-1.
even (bool) – Round up to even numbers.
- Returns:
Monkhorst-Pack grid size in all directions
- Return type:
dict
- static d2k_recip_cell(recip_cell: np.ndarray, pbc: Sequence[bool], kpt_density: float | tuple[float, float, float] = 5.0, even: bool = True) Sequence[int] [source]
Convert k-point density to Monkhorst-Pack grid size.
- Parameters:
recip_cell (Cell) – The reciprocal cell
pbc (Sequence[bool]) – If element of pbc is True then system is periodic in that direction
kpt_density (float or list[floats]) – Required k-point density. Default value is 5 points per Ang^-1.
even(bool): Round up to even numbers.
- Returns:
Monkhorst-Pack grid size in all directions
- Return type:
dict
- get_input_set(structure: Structure | Molecule | None = None, prev_dir: PathLike | None = None, properties: list[str] | None = None) AimsInputSet [source]
Generate an AimsInputSet object.
- Parameters:
- Returns:
The input set for the calculation of structure
- Return type:
- get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict[str, Any] [source]
Update the parameters for a given calculation type.
- 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.
- Returns:
Density of kpoints in each direction. result.mean() computes average density
- Return type:
dict
- 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:
- 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]
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]
- recursive_update(dct: dict, up: dict) dict [source]
Update a dictionary recursively and return it.
- Parameters:
dct (dict) – Input dictionary to modify
up (dict) – updates to apply
- Returns:
The updated dictionary.
- Return type:
dict
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, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'bands', k_point_density: float = 20)[source]
Bases:
AimsInputGenerator
A generator for the band structure calculation input set.
- 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
- Returns:
The updated for the parameters for the output section of FHI-aims
- Return type:
dict
- class GWSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, 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.
pymatgen.io.aims.sets.core module
Module defining core FHI-aims input set generators.
- class MDSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'md', ensemble: str = 'nve', ensemble_specs: dict[str, Any] = <factory>, temp: float | None = None, time: float = 5.0, time_step: float = 0.001, init_velocities: bool = True)[source]
Bases:
AimsInputGenerator
A class for generating FHI-aims input sets for molecular dynamics calculations.
- Parameters:
ensemble (str) – Molecular dynamics ensemble to run. Options include nvt, nve, and gle. Default: nve
ensemble_specs (dict[str, Any]) – A dictionary containing the specifications of the molecular dynamics ensemble. Valid keys are type (the ensemble type, valid types are defined in _valid_dynamics dict), and parameter - the control parameter for the thermostat (not used for nve and nve_4th_order).
temp (float | None) – Thermostat temperature. Default: None
time (float) – Simulation time (in picoseconds). Negative value stands for indefinite run. Default: 5 ps
time_step (float) – The time step (in picoseconds) for the simulation. default: 1 fs
**kwargs – Other keyword arguments that will be passed to
AimsInputGenerator
.
- get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict [source]
Get the parameter updates for the calculation.
- Parameters:
Molecule) (structure (Structure or) – The structure to calculate the bands for
(Dict[str (prev_parameters) – The previous parameters
Any]) – The previous parameters
- Returns:
A dictionary of updates to apply.
- Return type:
dict
- class RelaxSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'relaxation', relax_cell: bool = True, max_force: float = 0.001, method: str = 'trm')[source]
Bases:
AimsInputGenerator
Generate FHI-aims relax sets for optimizing internal coordinates and lattice params.
- get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict [source]
Get the parameter updates for the calculation.
prev_parameters (Dict[str, Any]): The previous parameters
- Returns:
The updated for the parameters for the output section of FHI-aims
- Return type:
dict
- class SocketIOSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'multi_scf', host: str = 'localhost', port: int = 12345)[source]
Bases:
AimsInputGenerator
Generate FHI-aims input sets for running with the socket.
- class StaticSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'static')[source]
Bases:
AimsInputGenerator
Common class for ground-state generators.
pymatgen.io.aims.sets.magnetism module
Define the InputSetGenerators for FHI-aims magnetism calculations.
- class MagneticRelaxSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'relaxation', relax_cell: bool = True, max_force: float = 0.001, method: str = 'trm')[source]
Bases:
RelaxSetGenerator
Generate FHI-aims relax sets for optimizing internal coordinates and lattice params.
- get_parameter_updates(structure: Structure | Molecule, prev_parameters: dict[str, Any]) dict [source]
Get the parameter updates for the calculation.
prev_parameters (Dict[str, Any]): The previous parameters
- Returns:
The updated for the parameters for the output section of FHI-aims
- Return type:
dict
- class MagneticStaticSetGenerator(user_params: dict[str, Any] = <factory>, user_kpoints_settings: dict[str, Any] = <factory>, use_structure_charge: bool = False, calc_type: str = 'static')[source]
Bases:
StaticSetGenerator
Common class for ground-state generators.