aiida_aimall.workchains.calcfunctions#
Calcfunctions used throughout workchains
Module Contents#
Functions#
|
Rotates the fragment to the defined coordinate system |
|
Remove digits from a list of strings. e.g. ['O1','H2','H3'] -> ['O','H','H'] |
|
Generate a StructureData for Gaussian inputs |
|
Calculate the multiplicity of a molecule as 2S +1 |
Given molecule object, find the atoms corresponding to a * and the atom to which that is bound |
|
|
Reindexes the atoms in a molecule, setting attached_atom to index 0, and zero_at to index 1 |
|
MMFF optimize the molecule to generate xyz coordiantes |
|
For a given smiles, determine xyz structure, charge, and multiplicity |
|
Take an input xyz string and convert it to StructureData |
|
Add charge and multiplicity keys to Gaussian Input |
|
Find the .wfx filename from gaussian_parameters |
|
Create wavefunction SinglefileData from retrieved folder |
|
Validate the shell code, ensuring that it is ShellCode or Str |
|
Validate the parser, ensuring that the provided value is one of the accepted values. |
|
Validates that the file extension provided for AIM is wfx, wfn or fchk |
|
For a given smiles, determine xyz structure, charge, and multiplicity |
|
Convert the xyz file provided as SinglefileData to StructureData |
- aiida_aimall.workchains.calcfunctions.generate_rotated_structure_aiida(FolderData, atom_dict, cc_dict)[source]#
Rotates the fragment to the defined coordinate system
- Parameters:
FolderData (aiida.orm.FolderData) – aim calculation folder
atom_dict – AIM atom dict
cc_dict – AIM cc_dict
- Returns:
- Dict with keys ‘atom_symbols’ and ‘geom’ containing atomic symbols and the
the rotated geometry.
- aiida_aimall.workchains.calcfunctions.remove_numcharss_from_strlist(in_list)[source]#
Remove digits from a list of strings. e.g. [‘O1’,’H2’,’H3’] -> [‘O’,’H’,’H’]
- Parameters:
in_list – input list to remove digits from
- Returns:
output list with the numerical digits removed from each element
Note
- The intention for this list is to convert numered atomic symbols, e.g. from Gaussian
to just symbols
- aiida_aimall.workchains.calcfunctions.dict_to_structure(fragment_dict)[source]#
Generate a StructureData for Gaussian inputs
- Parameters:
fragment_dict (aiida.orm.Dict) – AiiDA orm.Dict with keys ‘atom_symbols’ and ‘geom’
- Returns:
aiida.orm.StructureData for the molecule
Note
- input can be generated, for example, by
aiida_aimall.workchains.calcfunctions.generate_rotated_structure_aiida()
- aiida_aimall.workchains.calcfunctions.calc_multiplicity(mol)[source]#
Calculate the multiplicity of a molecule as 2S +1
Loops over the atoms in the molecule and gets number of radical electrons, then converts that number to the multiplicity.
- Parameters:
mol – rdkit.Chem molecule object
- Returns:
integer number of multiplicity
- aiida_aimall.workchains.calcfunctions.find_attachment_atoms(mol)[source]#
Given molecule object, find the atoms corresponding to a * and the atom to which that is bound
- Parameters:
mol – rdkit molecule object
- Returns:
molecule with added hydrogens, the * atom object, and the atom object to which that is attached
Note
Assumes that only one * is present in the molecule
- aiida_aimall.workchains.calcfunctions.reorder_molecule(h_mol_rw, zero_at, attached_atom)[source]#
Reindexes the atoms in a molecule, setting attached_atom to index 0, and zero_at to index 1
- Parameters:
h_mol_rw – RWMol rdkit object with explicit hydrogens
zero_at – the placeholder * atom
attached_atom – the atom bonded to *
- Returns:
molecule with reordered indices
- aiida_aimall.workchains.calcfunctions.get_xyz(reorder_mol)[source]#
MMFF optimize the molecule to generate xyz coordiantes
- Parameters:
reorder_mol – rdkit.Chem molecule output, output of
aiida_aimall.workchains.calcfunctions.reorder_molecule()- Returns:
string of the geometry block of an .xyz file
- aiida_aimall.workchains.calcfunctions.get_substituent_input(smiles: str) dict[source]#
For a given smiles, determine xyz structure, charge, and multiplicity
- Parameters:
smiles (str) – SMILEs of substituent to run
- Returns:
Dict with keys xyz, charge, multiplicity
- Raises:
ValueError – if molecule cannot be built from SMILES
- aiida_aimall.workchains.calcfunctions.generate_structure_data(smiles_dict)[source]#
Take an input xyz string and convert it to StructureData
- Parameters:
smiles_dict – output of
aiida_aimall.workchains.calcfunctions.get_substituent_input()- Returns:
StructureData of the molecule
- aiida_aimall.workchains.calcfunctions.parameters_with_cm(parameters, smiles_dict)[source]#
Add charge and multiplicity keys to Gaussian Input
- Parameters:
parameters – dictionary to be provided to GaussianCalculation
smiles_dict – aiida_aimall.workchains.calcfunctions.get_substituent_input
- Returns:
Dict of Gaussian parameters updated with charge and multiplicity
- aiida_aimall.workchains.calcfunctions.get_wfxname_from_gaussianinputs(gaussian_parameters)[source]#
Find the .wfx filename from gaussian_parameters
Check if input parameters was provided to gaussian_parameters, and if so, look for .wfx file names supplied. If it was, return the first .wfx filename found
- Parameters:
gaussian_parameters – input dictionary to be provided to GaussianCalculation
- Returns:
Str of .wfx filename
- aiida_aimall.workchains.calcfunctions.create_wfx_from_retrieved(wfxname, retrieved_folder)[source]#
Create wavefunction SinglefileData from retrieved folder
- Parameters:
wfxname – Str of the name of a .wfx file to get from the retrieved folder
retrieved_folder – FolderData of a completed GaussianCalculation
- Returns:
SinglefileData of the .wfx file to find in the FolderData
- aiida_aimall.workchains.calcfunctions.validate_shell_code(node, _)[source]#
Validate the shell code, ensuring that it is ShellCode or Str
- Parameters:
node – input node to check the type for ShellCode or Str
- Returns:
None if the type is ShellCode or Str, or error string if node is not
- aiida_aimall.workchains.calcfunctions.validate_parser(node, _)[source]#
Validate the parser, ensuring that the provided value is one of the accepted values.
- Parameters:
node – input node to check the type for ShellCode or Str
- Returns:
None if the value is aimall.base or aimall.group, or an error string if it is not
- aiida_aimall.workchains.calcfunctions.validate_file_ext(node, _)[source]#
Validates that the file extension provided for AIM is wfx, wfn or fchk
- Parameters:
node – node to check the value of to ensure it is in a supported format
- Returns:
None if the type is ShellCode or Str, or error string if node is not