recipes
__all__
module-attribute
¶
__all__ = ['dft_ensemble_analyse', 'dft_ensemble_flow', 'get_final_autoSKZCAM_Hads', 'skzcam_analyse', 'skzcam_eint_flow', 'skzcam_initialise']
dft_ensemble_analyse ¶
dft_ensemble_analyse(calc_dir: Path | str, xc_ensemble: list[str] | dict[str, str], geom_error_xc: str, vib_xc_ensemble: list[str], freeze_surface_vib: bool, temperature: float = 200.0) -> dict[str, list[float]]
Analyses the completed DFT ensemble calculations.
Parameters:
-
calc_dir
(Path or str
) –The directory where the calculations were performed.
-
xc_ensemble
(dict[str, str]
) –A dictionary containing the xc functionals to be used as keys and the corresponding settings as values.
-
geom_error_xc
(str
) –The xc functional to be used for the geometry error calculation.
-
vib_xc_ensemble
(list[str]
) –A list of xc functionals for which the vibrational calculations were performed.
-
freeze_surface_vib
(bool
) –True if the vibrational calculations on the slab should be skipped.
-
temperature
(float
, default:200.0
) –The temperature to get the vibrational contributions to.
Returns:
-
dict[str, list[float]]
–A dictionary containing the relaxation energy (and its geometry error) and DeltaH contributions from the DFT ensemble.
Source code in autoSKZCAM/recipes_dft.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
dft_ensemble_flow ¶
dft_ensemble_flow(xc_ensemble: dict[str, dict[str, Any]], vib_xc_ensemble: list[str] | None = None, geom_error_xc: str | None = None, freeze_surface_vib: bool = True, job_params: dict[str, dict[str, Any]] | None = None, adsorbate: Atoms | None = None, unit_cell: Atoms | None = None, calc_dir: str | Path = './dft_calc_dir', slab_gen_func: Callable[[Atoms], Atoms] | None = None, adsorbate_slab_gen_func: Callable[[Atoms], Atoms] | None = None)
Workflow to perform the DFT ensemble calculations to obtain the geometry error and get the DeltaH contribution. The workflow consists of the following steps:
-
Relax the gas-phase molecule for each functional in the ensemble.
-
Relax the unit cell for each functional in the ensemble.
-
Generate and relax the slab from the relaxed solid for each functional in the ensemble.
-
Generate and relax the adsorbate-slab complex from the relaxed adsorbate and slab for each functional in the ensemble.
-
Perform the vibrational calculation for each functional in the ensemble.
-
Perform the eint calculation on the chosen functional for each functional in the ensemble.
Parameters:
-
xc_ensemble
(dict[str, dict[str, Any]]
) –A dictionary containing the xc functionals to be used as keys and the corresponding settings as values.
-
job_params
(dict[str, dict[str, Any]]
, default:None
) –A dictionary containing the job parameters to be used for each functional in the ensemble. If not provided, the default job parameters will be used.
-
adsorbate
(Atoms
, default:None
) –The adsorbate molecule to be used for the calculations. If not provided, will attempt to read in the adsorbate from the calc_dir.
-
unit_cell
(Atoms
, default:None
) –The unit cell of the solid to be used for the calculations. If not provided, will attempt to read in the unit cell from the calc_dir.
-
calc_dir
(str or Path
, default:'./dft_calc_dir'
) –The directory where the calculations will be performed. Defaults to './calc_dir'.
-
slab_gen_func
(Callable[[Atoms], Atoms]
, default:None
) –The function to generate the slab from the unit cell.
-
adsorbate_slab_gen_func
(Callable[[Atoms], Atoms]
, default:None
) –The function to generate the adsorbate molecule. It is important that the indices of the adsorbates are always the first indices in the Atoms object, followed by the slab Atoms object.
Returns:
-
dict[str, dic[str, VaspSchema]]
–A dictionary containing the results of the DFT ensemble calculations for each functional in the ensemble.
Source code in autoSKZCAM/recipes_dft.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
|
get_final_autoSKZCAM_Hads ¶
get_final_autoSKZCAM_Hads(skzcam_eint_analysis: dict[str, list[float]], dft_ensemble_analysis: dict[str, list[float]]) -> dict[str, list[float]]
Gets the final Hads from the autoSKZCAM workflow after dft_ensemble and skzcam analysis.
Parameters:
-
skzcam_eint_analysis
(dict[str, list[float]]
) –The dictionary of the SKZCAM Eint analysis.
-
dft_ensemble_analysis
(dict[str, list[float]]
) –The dictionary of the DFT ensemble analysis.
Returns:
-
dict[str, list[float]]
–The final Hads dictionary containing the Hads contributions from the DFT ensemble and the SKZCAM calculations.
Source code in autoSKZCAM/recipes.py
skzcam_analyse ¶
skzcam_analyse(calc_dir: str | Path, embedded_cluster_npy_path: Path | str | None = None, OniomInfo: dict[str, OniomLayerInfo] | None = None, EmbeddedCluster: CreateEmbeddedCluster | None = None) -> dict[str, tuple[float, float]]
Analyze the completed SKZCAM calculations and compute the final ONIOM contributions.
Parameters:
-
calc_dir
(str | Path
) –The directory containing the calculations.
-
embedded_cluster_npy_path
(Path | str | None
, default:None
) –The path to the embedded cluster .npy object.
-
EmbeddedCluster
(CreateEmbeddedCluster | None
, default:None
) –The CreateEmbeddedCluster object containing the embedded cluster.
-
OniomInfo
(dict[str, OniomLayerInfo] | None
, default:None
) –A dictionary containing the information about the ONIOM layers.
Returns:
-
dict[str, tuple[float, float]]
–A dictionary containing the ONIOM layer as key and a tuple containing the contribution to the final interaction energy as well as its error.
Source code in autoSKZCAM/recipes_skzcam.py
skzcam_eint_flow ¶
skzcam_eint_flow(EmbeddedCluster: CreateEmbeddedCluster, OniomInfo: dict[str, OniomLayerInfo], capped_ecp: dict[Literal['mrcc', 'orca'], str] | None = None, **kwargs) -> None
The complete SKZCAM protocol to generate the embedded clusters, perform the calculations, and analyze the results.
Parameters:
-
EmbeddedCluster
(CreateEmbeddedCluster
) –The CreateEmbeddedCluster object containing the embedded cluster. This is initialised using the skzcam_initialise() function.
-
OniomInfo
(dict[str, OniomLayerInfo]
) –A dictionary containing the information about the ONIOM layers.
-
**kwargs
–Additional keyword arguments to pass to the skzcam_generate_job() and skzcam_calculate_job() functions.
Returns:
-
None
–
Source code in autoSKZCAM/recipes_skzcam.py
skzcam_initialise ¶
skzcam_initialise(adsorbate_indices: list[int], slab_center_indices: list[int], atom_oxi_states: dict[ElementStr, int], adsorbate_slab_file: str | Path, pun_filepath: str | Path = './ChemShell_EmbeddedCluster.pun', run_chemshell: bool = False, chemsh_radius_active: float = 40.0, chemsh_radius_cluster: float = 60.0, chemsh_bq_layer: float = 6.0, write_xyz_file: bool = False, **kwargs) -> CreateEmbeddedCluster
Parameters to initialise the SKZCAM protocol to generate the embedded clusters.
Parameters:
-
adsorbate_indices
(list[int]
) –The indices of the atoms that make up the adsorbate molecule.
-
slab_center_indices
(list[int]
) –The indices of the atoms that make up the 'center' of the slab right beneath the adsorbate.
-
atom_oxi_states
(dict[ElementStr, int]
) –A dictionary with the element symbol as the key and its oxidation state as the value.
-
adsorbate_slab_file
(str | Path
) –The path to the file containing the adsorbate molecule on the surface slab. It can be in any format that ASE can read.
-
pun_filepath
(str | Path
, default:'./ChemShell_EmbeddedCluster.pun'
) –The path to the .pun file containing the atomic coordinates and charges of the adsorbate-slab complex if it has already been generated by ChemShell. If it is None, then ChemShell will need to be used to create this file.
-
run_chemshell
(bool
, default:False
) –If True, the ChemShell calculations will be run to generate the .pun file.
-
chemsh_radius_active
(float
, default:40.0
) –The radius of the active region in Angstroms. This 'active' region is simply region where the charge fitting is performed to ensure correct Madelung potential; it can be a relatively large value.
-
chemsh_radius_cluster
(float
, default:60.0
) –The radius of the total embedded cluster in Angstroms.
-
chemsh_bq_layer
(float
, default:6.0
) –The height above the surface to place some additional fitting point charges in Angstroms; simply for better reproduction of the electrostatic potential close to the adsorbate.
-
write_xyz_file
(bool
, default:False
) –If True, the .xyz file will be written containing the atomic coordinates of the adsorbate-slab complex.
Returns:
-
CreateEmbeddedCluster
–The CreateEmbeddedCluster object containing the embedded cluster.