espresso
Custom Espresso calculator and template.
Espresso ¶
Espresso(
input_atoms: Atoms | None = None,
preset: str | Path | None = None,
template: EspressoTemplate | None = None,
**kwargs
)
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
preset
has a .yml or .yaml file extension, the path to this file will be used directly. Ifpreset
is 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
–Additional arguments to be passed to the Espresso calculator. Takes all valid ASE calculator arguments, such as
input_data
andkpts
. 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
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 |
|
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
outdir
in 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
Source code in quacc/calculators/espresso/espresso.py
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
–