atomate.qchem.firetasks package¶
Subpackages¶
Submodules¶
atomate.qchem.firetasks.critic2 module¶
-
class
atomate.qchem.firetasks.critic2.
ProcessCritic2
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Process the CP and YT json outputs from a Critic2 execution
- Required params:
- molecule (Molecule): Molecule object of the molecule whose electron density is being analyzed
Note that if prev_calc_molecule is set in the firework spec it will override the molecule required param.
-
required_params
= ['molecule']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
class
atomate.qchem.firetasks.critic2.
RunCritic2
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Run the Critic2 package on an electron density cube file produced by a Q-Chem single point calculation to generate CP and YT files for electron density critical points analysis.
- Required params:
- molecule (Molecule): Molecule object of the molecule whose electron density is being analyzed
Note that if prev_calc_molecule is set in the firework spec it will override the molecule required param.
cube_file (str): Name of the cube file being analyzed
-
required_params
= ['molecule', 'cube_file']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
atomate.qchem.firetasks.fragmenter module¶
atomate.qchem.firetasks.geo_transformations module¶
-
class
atomate.qchem.firetasks.geo_transformations.
PerturbGeometry
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Modify a Molecule geometry.
-
optional_params
= ['molecule', 'mode', 'scale']¶
-
required_params
= []¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
-
class
atomate.qchem.firetasks.geo_transformations.
RotateTorsion
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Writes QChem Input files from input sets. A dictionary is passed to WriteInputFromIOSet where parameters are given as keys in the dictionary.
- required_params:
atom_indexes (list): This should be a list of the pymatgen molecule indexes of the four atoms in torsion angle to be rotated angle (float): This is the desired torsion angle in degrees (the value should be between -180 and 180)
- optional_params:
molecule (Molecule): Specify a pymatgen molecule to be rotated. A molecule is optional because molecules can be inherited from previous fireworks
-
optional_params
= ['molecule']¶
-
required_params
= ['atom_indexes', 'angle']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
atomate.qchem.firetasks.parse_outputs module¶
atomate.qchem.firetasks.run_calc module¶
-
class
atomate.qchem.firetasks.run_calc.
RunNoQChem
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Do NOT run QChem. Do nothing.
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
-
class
atomate.qchem.firetasks.run_calc.
RunQChemCustodian
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Run QChem using custodian “on rails”, i.e. in a simple way that supports most common options.
- Required params:
- qchem_cmd (str): The name of the full executable for running QChem. Note that this is
explicitly different from qchem_cmd in RunQChemDirect because it does not include any flags and should only be the call to the executable. Supports env_chk.
- Optional params:
- multimode (str): Parallelization scheme, either openmp or mpi. Defaults to openmp.
Supports env_chk.
input_file (str): Name of the QChem input file. Defaults to “mol.qin”. output_file (str): Name of the QChem output file. Defaults to “mol.qout” max_cores (int): Maximum number of cores to parallelize over. Supports env_chk. qclog_file (str): Name of the file to redirect the standard output to. None means
not to record the standard output. Defaults to None.
suffix (str): String to append to the file in postprocess. calc_loc (str): Path where Q-Chem should run. Will env_chk by default. If not in
environment, will be set to None, in which case Q-Chem will run in the system-defined QCLOCALSCR.
save_scratch (bool): Whether to save scratch directory contents. Defaults to False. max_errors (int): Maximum # of errors to fix before giving up (default=5) job_type (str): Choose from “normal” (default) and “opt_with_frequency_flattener” handler_group (str): Group of handlers to use. See handler_groups dict in the code
for the groups and complete list of handlers in each group.
gzip_output (bool): gzip output, defaults to True. backup (bool): Whether to backup the initial input file. If True, the input will
be copied with a “.orig” appended. Defaults to True.
* Just for opt_with_frequency_flattener * linked (bool): Whether or not to use the linked flattener. Defaults to True. max_iterations (int): Number of perturbation -> optimization -> frequency iterations
to perform. Defaults to 10.
- max_molecule_perturb_scale (float): The maximum scaled perturbation that can be
applied to the molecule. Defaults to 0.3.
-
optional_params
= ['multimode', 'input_file', 'output_file', 'max_cores', 'qclog_file', 'suffix', 'calc_loc', 'save_scratch', 'max_errors', 'job_type', 'handler_group', 'gzipped_output', 'backup', 'linked', 'max_iterations', 'max_molecule_perturb_scale', 'freq_before_opt', 'transition_state']¶
-
required_params
= ['qchem_cmd']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
class
atomate.qchem.firetasks.run_calc.
RunQChemDirect
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Execute a command directly (no custodian).
- Required params:
- qchem_cmd (str): The name of the full command line call to run. This should include any
flags for parallelization, saving scratch, and input / output files. Does NOT support env_chk.
-
required_params
= ['qchem_cmd']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
class
atomate.qchem.firetasks.run_calc.
RunQChemFake
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
QChem Emulator
- Required params:
- ref_dir (string): Path to reference qchem run directory with input file in the folder
named “mol.qin” and output file in the folder named “mol.qout”.
-
optional_params
= ['input_file']¶
-
required_params
= ['ref_dir']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
atomate.qchem.firetasks.write_inputs module¶
-
class
atomate.qchem.firetasks.write_inputs.
WriteCustomInput
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Writes QChem Input files from custom input sets. This firetask gives the maximum flexibility when trying to define custom input parameters.
- required_params:
qchem_input_custom (dict): Define custom input parameters to generate a qchem input file. This should be a dictionary of dictionaries (i.e. {{“rem”: {“method”: “b3lyp”, basis”: “6-31*G++”, …} Each QChem section should be a key with its own dictionary as the value. For more details on how the input should be structured look at pymatgen.io.qchem.inputs * *
- optional_params:
input_file (str): Name of the QChem input file. Defaults to mol.qin write_to_dir (str): Path of the directory where the QChem input file will be written, the default is to write to the current working directory
-
optional_params
= ['molecule', 'opt', 'pcm', 'solvent', 'van_der_waals', 'input_file', 'write_to_dir']¶
-
required_params
= ['rem']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
class
atomate.qchem.firetasks.write_inputs.
WriteInput
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Writes QChem input file from QCInput object.
- required_params:
qc_input (QCInput): QCInput object
- optional_params:
input_file (str): Name of the QChem input file. Defaults to mol.qin write_to_dir (str): Path of the directory where the QChem input file will be written, the default is to write to the current working directory
-
optional_params
= ['input_file', 'write_to_dir']¶
-
required_params
= ['qc_input']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)
-
class
atomate.qchem.firetasks.write_inputs.
WriteInputFromIOSet
(*args, **kwargs)¶ Bases:
fireworks.core.firework.FiretaskBase
Writes QChem Input files from input sets. A dictionary is passed to WriteInputFromIOSet where parameters are given as keys in the dictionary.
- required_params:
qc_input_set (QChemDictSet or str): Either a QChemDictSet object or a string name for the QChem input set (e.g., “OptSet”). * Note that if the molecule is to be inherited through fw_spec qc_input_set must be a string name for the QChem input set. *
- optional_params:
molecule (Molecule): Molecule that will be subjected to an electronic structure calculation qchem_input_params (dict): When using a string name for QChem input set, use this as a dict
to specify kwargs for instantiating the input set parameters. This setting is ignored if you provide the full object representation of a QChemDictSet. Basic uses would be to modify the default inputs of the set, such as dft_rung, basis_set, pcm_dielectric, scf_algorithm, or max_scf_cycles. See pymatgen/io/qchem/sets.py for default values of all input parameters. For instance, if a user wanted to use a more advanced DFT functional, include a pcm with a dielectric of 30, and use a larger basis, the user would set qchem_input_params = {“dft_rung”: 5, “pcm_dielectric”: 30, “basis_set”: “6-311++g**”}. However, more advanced customization of the input is also possible through the overwrite_inputs key which allows the user to directly modify the rem, pcm, smd, and solvent dictionaries that QChemDictSet passes to inputs.py to print an actual input file. For instance, if a user wanted to set the sym_ignore flag in the rem section of the input file to true, then they would set qchem_input_params = {“overwrite_inputs”: “rem”: {“sym_ignore”: “true”}}. Of course, overwrite_inputs could be used in conjunction with more typical modifications, as seen in the test_double_FF_opt workflow test.
input_file (str): Name of the QChem input file. Defaults to mol.qin write_to_dir (str): Path of the directory where the QChem input file will be written, the default is to write to the current working directory
-
optional_params
= ['molecule', 'qchem_input_params', 'input_file', 'write_to_dir']¶
-
required_params
= ['qchem_input_set']¶
-
run_task
(fw_spec)¶ This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.
- Args:
- fw_spec (dict): A Firework spec. This comes from the master spec.
In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.
- Returns:
(FWAction)