matador.workflows.castep package¶
The workflows.castep submodule contains any workflows that rely on CASTEP-specific implementation, for example electronic spectropscopy or phonons.
- matador.workflows.castep.castep_full_phonon(computer, calc_doc, seed, **kwargs)[source]¶
Perform a “full” phonon calculation on a system, i.e. first perform a relaxation in a standardised unit cell, then compute the dynamical matrix, then finally interpolate that dynamical matrix into dispersion curves and DOS. This function is a wrapper for the
CastepPhononWorkflow
class.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- matador.workflows.castep.castep_full_spectral(computer, calc_doc, seed, **kwargs)[source]¶
Perform a “full” spectral calculation on a system, i.e. first perform an SCF then interpolate to different kpoint paths/grids to form DOS and dispersions. Optionally use OptaDOS for post-processing of DOS.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- matador.workflows.castep.castep_elastic(computer, calc_doc, seed, **kwargs)[source]¶
Perform a calculation of the elastic tensor on a system. Currently only calculation of the bulk modulus is implemented.
- Parameters:
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- matador.workflows.castep.castep_full_magres(computer, calc_doc, seed, final_elec_energy_tol=1e-11, **kwargs)[source]¶
Perform a “full” magres calculation on a system, i.e. first perform a relaxation, then do a high quality SCF and compute NMR properties in the same step.
This function is a wrapper for the
CastepMagresWorkflow
class.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
Submodules¶
matador.workflows.castep.common module¶
This submodule implements some common workflow steps for use in more complicated workflows.
- matador.workflows.castep.common.castep_prerelax(computer, calc_doc, seed, write_checkpoint='all', required_keys=None, forbidden_keys=None)[source]¶
Run a self-consistent (i.e. restarted) geometry optimisation. Optionally write a check file containing the final structure and density.
- Parameters:
- Keyword Arguments:
write_checkpoint (bool or str) – keyword to pass to CASTEP’s
write_checkpoint
parameter. IfTrue
(False
), CASTEP parameter set toALL
(NONE
).required_keys (
list
ofstr
) – list of keys required in calc doc to perform the calculation.forbidden_keys (
list
ofstr
) – list of keys to scrub from calc doc to perform the calculation.
- Returns:
whether or not the relaxation was successful.
- Return type:
- matador.workflows.castep.common.castep_scf(computer, calc_doc, seed, elec_energy_tol=None, write_checkpoint='ALL', required_keys=None, forbidden_keys=None)[source]¶
Run a singleshot SCF calculation.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – the structure to run on.
seed (str) – root filename of structure.
- Keyword Arguments:
elec_energy_tol (float or str) – keyword to pass to
elec_energy_tol
.write_checkpoint (bool or str) – keyword to pass to CASTEP’s
write_checkpoint
parameter. IfTrue
(False
), CASTEP parameter set toALL
(NONE
).required_keys (
list
ofstr
) – list of keys required in calc doc to perform the calculation.forbidden_keys (
list
ofstr
) – list of keys to scrub from calc doc to perform the calculation.
- Returns:
whether or not the SCF was successful.
- Return type:
matador.workflows.castep.elastic module¶
This module implements the CastepElasticWorkflow, which performs elastic tensor calculations with CASTEP. So far, only bulk modulus calculations (i.e. varying volume from equilibrium) have been implemented.
- matador.workflows.castep.elastic.castep_elastic(computer, calc_doc, seed, **kwargs)[source]¶
Perform a calculation of the elastic tensor on a system. Currently only calculation of the bulk modulus is implemented.
- Parameters:
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- class matador.workflows.castep.elastic.CastepElasticWorkflow(computer, calc_doc, seed, **workflow_kwargs)[source]¶
Bases:
Workflow
Perform a “full” spectral calculation on a system, i.e. first perform an SCF then interpolate to different kpoint paths/grids to form DOS and dispersions. Optionally use OptaDOS for post-processing of DOS.
- computer¶
the object that calls CASTEP.
- Type:
ComputeTask
- volume_rescale¶
a list of floats containing the amounts by which to rescale volumes when performing bulk modulus calculation.
- Type:
- success¶
the status of the Workflow: only set to True after post-processing method completes.
- Type:
Initialise the Workflow object from a
matador.compute.ComputeTask
, calculation parameters and the seed name.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be running the computation.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- matador.workflows.castep.elastic.castep_rescaled_volume_scf(computer, calc_doc, seed, rescale=1)[source]¶
Run a singleshot SCF calculation.
matador.workflows.castep.magres module¶
This module implements the CastepMagresWorkflow
class, which performs magres calculations with CASTEP in
multiple steps (only when necessary):
Try to pre-relax structure (skipped if check file is already present).
Perform an SCF with lower electronic tolerances.
Calculate NMR properties, e.g. shielding and EFG.
- matador.workflows.castep.magres.castep_full_magres(computer, calc_doc, seed, final_elec_energy_tol=1e-11, **kwargs)[source]¶
Perform a “full” magres calculation on a system, i.e. first perform a relaxation, then do a high quality SCF and compute NMR properties in the same step.
This function is a wrapper for the
CastepMagresWorkflow
class.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- class matador.workflows.castep.magres.CastepMagresWorkflow(computer, calc_doc, seed, **workflow_kwargs)[source]¶
Bases:
Workflow
Perform a “full” magres calculation on a system, i.e. first perform a relaxation in a standardised unit cell, then do a high quality SCF, then compute NMR properties.
- computer¶
the object that calls CASTEP.
- Type:
ComputeTask
- success¶
the status of the Workflow: only set to True after post-processing method completes.
- Type:
- final_elec_energy_tol¶
the electronic energy tolerance to use in the high-quality SCF calculation.
- Type:
Initialise the Workflow object from a
matador.compute.ComputeTask
, calculation parameters and the seed name.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be running the computation.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- matador.workflows.castep.magres.castep_magres_scf(computer, calc_doc, seed, elec_energy_tol=1e-11)[source]¶
Run a singleshot SCF calculation with a high elec_energy_tol.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – the structure to run on.
seed (str) – root filename of structure.
- Returns:
whether or not the SCF was successful.
- Return type:
matador.workflows.castep.phonons module¶
This module implements the CastepPhononWorkflow
class, which performs phonon calculations with CASTEP in
multiple steps (only when necessary):
- Try to pre-relax structure (skipped if check file
is already present).
Calculate dynamical matrix.
If
phonon_fine_kpoint_mp_spacing
keyword is found, interpolate dynamical matrix to form phonon DOS.If
phonon_fine_kpoint_path_spacing
key word is found, interpolate dynamical matrix to form phonon dispersion on the path given by seekpath.If
task=thermodynamics
, perform a CASTEP thermodynamics calculation for the temperature-dependence of the free energy.
- matador.workflows.castep.phonons.castep_full_phonon(computer, calc_doc, seed, **kwargs)[source]¶
Perform a “full” phonon calculation on a system, i.e. first perform a relaxation in a standardised unit cell, then compute the dynamical matrix, then finally interpolate that dynamical matrix into dispersion curves and DOS. This function is a wrapper for the
CastepPhononWorkflow
class.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- class matador.workflows.castep.phonons.CastepPhononWorkflow(computer, calc_doc, seed, **workflow_kwargs)[source]¶
Bases:
Workflow
Perform a “full” phonon calculation on a system, i.e. first perform a relaxation in a standardised unit cell, then compute the dynamical matrix, then finally interpolate that dynamical matrix into dispersion curves and DOS.
- computer¶
the object that calls CASTEP.
- Type:
ComputeTask
- success¶
the status of the Workflow: only set to True after post-processing method completes.
- Type:
Initialise the Workflow object from a
matador.compute.ComputeTask
, calculation parameters and the seed name.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be running the computation.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- matador.workflows.castep.phonons.castep_phonon_prerelax(computer, calc_doc, seed)[source]¶
Run a singleshot geometry optimisation before an SCF-style calculation. This is typically used to ensure phonon calculations start successfully. The phonon calculation will then be restarted from the .check file produced here.
- matador.workflows.castep.phonons.castep_phonon_dynmat(computer, calc_doc, seed)[source]¶
Runs a singleshot phonon dynmat calculation, with no “fine_method” interpolation.
- matador.workflows.castep.phonons.castep_phonon_dos(computer, calc_doc, seed)[source]¶
Runs a DOS interpolation on top of a completed phonon calculation.
- matador.workflows.castep.phonons.castep_phonon_dispersion(computer, calc_doc, seed)[source]¶
Runs a dispersion interpolation on top of a completed phonon calculation.
matador.workflows.castep.spectral module¶
This module implements the CastepSpectralWorkflow, which performs spectral calculations with CASTEP in multiple steps:
Performs a singlepoint calculation (if check file is not found).
If the
spectral_kpoints_mp_spacing
keyword is found, interpolate wavefunction to DOS grid. - If an OptaDOS input file (.odi) with the root seednameis found, run OptaDOS on the resulting density of states.
If
spectral_kpoints_path_spacing
keyword is present, create a bandstructure on the SeeK-path generated path.
- matador.workflows.castep.spectral.castep_full_spectral(computer, calc_doc, seed, **kwargs)[source]¶
Perform a “full” spectral calculation on a system, i.e. first perform an SCF then interpolate to different kpoint paths/grids to form DOS and dispersions. Optionally use OptaDOS for post-processing of DOS.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- Returns:
True if Workflow completed successfully, or False otherwise.
- Return type:
- class matador.workflows.castep.spectral.CastepSpectralWorkflow(computer, calc_doc, seed, **workflow_kwargs)[source]¶
Bases:
Workflow
Perform a “full” spectral calculation on a system, i.e. first perform an SCF then interpolate to different kpoint paths/grids to form DOS and dispersions. Optionally use OptaDOS for post-processing of DOS.
- computer¶
the object that calls CASTEP.
- success¶
the status of the Workflow: only set to True after post-processing method completes.
- Type:
Initialise the Workflow object from a
matador.compute.ComputeTask
, calculation parameters and the seed name.- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be running the computation.calc_doc (dict) – dictionary of structure and calculation parameters.
seed (str) – root seed for the calculation.
- Raises:
RuntimeError – if any part of the calculation fails.
- matador.workflows.castep.spectral.castep_spectral_scf(computer, calc_doc, seed)[source]¶
Run a singleshot SCF calculation.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – the structure to run on.
seed (str) – root filename of structure.
- matador.workflows.castep.spectral.castep_spectral_dos(computer, calc_doc, seed)[source]¶
Runs a DOS interpolation on top of a completed SCF. If a single .odi file is found, run OptaDOS on the resulting DOS.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – the structure to run on.
seed (str) – root filename of structure.
- matador.workflows.castep.spectral.castep_spectral_dispersion(computer, calc_doc, seed)[source]¶
Runs a dispersion interpolation on top of a completed SCF calculation, optionally running orbitals2bands and OptaDOS projected dispersion.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling CASTEP.calc_doc (dict) – the structure to run on.
seed (str) – root filename of structure.
- matador.workflows.castep.spectral.optados_pdos(computer, _, seed)[source]¶
Run an OptaDOS projected-DOS.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling OptaDOS._ – second parameter is required but ignored.
seed (str) – root filename of structure.
- matador.workflows.castep.spectral.optados_dos_broadening(computer, _, seed)[source]¶
Run an OptaDOS total DOS broadening.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling OptaDOS._ – second parameter is required but ignored.
seed (str) – root filename of structure.
- matador.workflows.castep.spectral.optados_pdispersion(computer, _, seed)[source]¶
Runs an OptaDOS projected dispersion calculation.
- Parameters:
computer (
matador.compute.ComputeTask
) – the object that will be calling OptaDOS._ – second parameter is required but ignored.
seed (str) – root filename of structure.