BaseAnharmonicityMaker

class atomate2.common.flows.anharmonicity.BaseAnharmonicityMaker(name='anharmonicity', phonon_maker=None)[source]

Bases: Maker, ABC

Maker to calculate the anharmonicity score of a material.

Calculate sigma^A as defined in doi.org/10.1103/PhysRevMaterials.4.083809, by first calculating the phonons for a material and then generating the one-shot sample and calculating the DFT and harmonic forces.

Parameters:
  • name (str) – Name of the flows produced by this maker.

  • phonon_maker (BasePhononMaker) – The maker to generate the phonon model

make(structure, prev_dir=None, born=None, epsilon_static=None, total_dft_energy_per_formula_unit=None, supercell_matrix=None, temperature=300, one_shot_approx=True, seed=None, element_resolved=False, mode_resolved=False, site_resolved=False, n_samples=1)[source]

Make the anharmonicity calculation flow.

Parameters:
  • structure (Structure) – A pymatgen structure object. Please start with a structure that is nearly fully optimized as the internal optimizers have very strict settings!

  • prev_dir (Optional[str | Path]) – A previous calculation directory to use for copying outputs. Default is None.

  • born (Optional[list[Matrix3D]]) – Instead of recomputing born charges and epsilon, these values can also be provided manually. If born and epsilon_static are provided, the born run will be skipped it can be provided in the VASP convention with information for every atom in unit cell. Please be careful when converting structures within in this workflow as this could lead to errors. The default for this field is None.

  • epsilon_static (Optional[Matrix3D]) – The high-frequency dielectric constant to use instead of recomputing born charges and epsilon. If born, epsilon_static are provided, the born run will be skipped. The default for this field is None.

  • total_dft_energy_per_formula_unit (Optional[float]) – It has to be given per formula unit (as a result in corresponding Doc). Instead of recomputing the energy of the bulk structure every time, this value can also be provided in eV. If it is provided, the static run will be skipped. This energy is the typical output dft energy of the dft workflow. No conversion needed. It is set to 0 by default.

  • supercell_matrix (Optional[Matrix3D]) – Instead of min_length, also a supercell_matrix can be given, e.g. [[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]]. By default, this matrix is set to None.

  • temperature (float) – The temperature for the anharmonicity calculation. The default temp is 300.

  • one_shot_approx (bool) – If true, finds the one shot approximation of sigma^A and if false, finds the full sigma^A. The default is True.

  • seed (Optional[int]) – Seed to use for the random number generator (only used if one_shot_approx == False). Set to None by default.

  • element_resolved (bool) – If true, calculate the atom-resolved sigma^A. This is false by default.

  • mode_resolved (bool) – If true, calculate the mode-resolved sigma^A. This is false by default.

  • site_resolved (bool) – If true, resolve sigma^A to the different sites. Default is false.

  • n_samples (int) – Number of times displaced structures are sampled. Must be >= 1 and cannot be used when one_shot_approx == True. It is set to 1 by default.

Returns:

The workflow for the anharmonicity calculations

Return type:

Flow

make_from_phonon_doc(phonon_doc, prev_dir=None, temperature=300, one_shot_approx=True, seed=None, element_resolved=False, mode_resolved=False, site_resolved=False, n_samples=1)[source]

Create an anharmonicity workflow from a phonon calculation.

Parameters:
  • phonon_doc (PhononBSDOSDoc) – The document to get the anharmonicity for

  • prev_dir (Optional[str | Path]) – A previous calculation directory to use for copying outputs. Default is None.

  • temperature (float) – The temperature for the anharmonicity calculation. Default is 300.

  • one_shot_approx (bool) – If true, finds the one shot approximation of sigma^A and if false, finds the full sigma^A. The default is True.

  • seed (Optional[int]) – Seed to use for the random number generator (only used if one_shot_approx == False). Default is None.

  • element_resolved (bool) – If true, calculate the atom-resolved sigma^A. This is false by default.

  • mode_resolved (bool) – If true, calculate the mode-resolved sigma^A. This is false by default.

  • site_resolved (bool) – If true, resolve sigma^A to the different sites. Default is false.

  • n_samples (int) – Number of times displaced structures are sampled. Must be >= 1 and cannot be used when one_shot_approx == True. It is set to 1 by default.

Returns:

The anharmonicity quantification workflow

Return type:

Flow

abstract property prev_calc_dir_argname: str | None

Name of argument informing static maker of previous calculation directory.

As this differs between different DFT codes (e.g., VASP, CP2K), it has been left as a property to be implemented by the inheriting class.

Note: this is only applicable if a relax_maker is specified; i.e., two calculations are performed for each ordering (relax -> static)