espresso
Custom Espresso calculator and template.
Espresso ¶
Espresso(
input_atoms: Atoms | None = None,
preset: str | Path | None = None,
template: EspressoTemplate | None = None,
**kwargs: Any
)
Bases: GenericFileIOCalculator
A wrapper around the ASE Espresso calculator that adjusts input_data parameters and allows for the use of presets. Templates are used to set the binary and input/output file names.
Parameters:
-
input_atoms(Atoms | None, default:None) –The input Atoms object to be used for the calculation.
-
preset(str | Path | None, default:None) –A YAML file containing a list of parameters to use as a "preset" for the calculator. If
presethas a .yml or .yaml file extension, the path to this file will be used directly. Ifpresetis a string without an extension, the corresponding YAML file will be assumed to be in theESPRESSO_PRESET_DIR. Any user-supplied calculator **kwargs will override any corresponding preset values. -
template(EspressoTemplate | None, default:None) –ASE calculator templace which can be used to specify which espresso binary will be used in the calculation. This is taken care of by recipe in most cases.
-
**kwargs(Any, default:{}) –Additional arguments to be passed to the Espresso calculator. Takes all valid ASE calculator arguments, such as
input_dataandkpts. Refer to ase.calculators.espresso.Espresso for details. Note that the full input must be described; use{"system":{"ecutwfc": 60}}and not the{"ecutwfc": 60}short-hand.
Returns:
-
None–
Source code in quacc/calculators/espresso/espresso.py
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 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | |
EspressoTemplate ¶
EspressoTemplate(
binary: str = "pw",
test_run: bool = False,
autorestart: bool = False,
outdir: str | Path | None = None,
)
Bases: EspressoTemplate
A wrapper around the ASE Espresso template that allows for the use of other binaries such as pw.x, ph.x, cp.x, etc.
Parameters:
-
binary(str, default:'pw') –The name of the espresso binary to use. This is used to set the input/output file names. By default we fall back to "pw".
-
test_run(bool, default:False) –If True, a test run is performed to check that the calculation input_data is correct or to generate some files/info if needed.
-
autorestart(bool, default:False) –If True, the calculation will automatically switch to 'restart' if this calculator performs more than one run. (ASE-relax/MD/NEB)
-
outdir(str | Path | None, default:None) –The directory that will be used as
outdirin the input_data. If None, the directory will be set to the current working directory.
Returns:
-
None–
Source code in quacc/calculators/espresso/espresso.py
execute ¶
read_results ¶
The function that should be used instead of the one in ASE EspressoTemplate to read the output file. It calls a customly defined read function. It also adds the "energy" key to the results dictionnary if it is not present. This is needed if the calculation is not made with pw.x.
Parameters:
-
directory(PathLike) –The directory in which to read the output file.
Returns:
-
dict–The results dictionnary
Notes
For projwfc, projwfc_results contains energy in eV and
dos and pdos in states per eV. Energies retain the reference of
the QE output file. For collinear spin-polarized calculations, dos
and pdos are sums over both spin channels, and dos_up,
dos_down, pdos_up, and pdos_down retain the individual
channels without changing their signs. Noncollinear output without
spin-orbit coupling and k-resolved output are not supported.
Source code in quacc/calculators/espresso/espresso.py
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 | |
write_input ¶
write_input(
profile: EspressoProfile,
directory: Path | str,
atoms: Atoms,
parameters: dict[str, Any],
properties: Any,
) -> None
The function that should be used instead of the one in ASE EspressoTemplate to write the input file. It calls a customly defined write function.
Parameters:
-
profile(EspressoProfile) –The profile to use.
-
directory(Path | str) –The directory in which to write the input file.
-
atoms(Atoms) –The atoms object to use.
-
parameters(dict[str, Any]) –The parameters to use.
-
properties(Any) –Special ASE properties
Returns:
-
None–