Generate a Gaussian Calculation using SMILES input#
Though not explicitly directly integrated with AIMAll software, aiida-aimall provides a workchain to take a SMILES string of a substituent as input, and generate and run a Gaussian calculation. This is provided in part due to workflows used by the authors in automating creation of data for large numbers of substituents automatically. The
SmilesToGaussianWorkchain. SmilesToGaussianWorkchain provides this functionality. It uses the RDKit package to convert the SMILES input to a molecular geometry through an MMFF94 optimization, and then provides that to the Gaussian calculation.
The SMILES provides should have exactly one asterisk indicating the point of attachment of the substituent to the substrate. In the generated geometry, this * will be replaced with a hydrogen. For example a valid input SMILES is “C” for a methyl group, but a methylene group with SMILES “*C” or methane with SMILES “C” are invalid SMILES for input in this WorkChain. If such inputs are passed, an exception will be raised. SMILES without placeholder atoms can be provided to
GaussianToAIMWorkChain.
Setting up the calculation#
[2]:
%%capture
from aiida import load_profile
from aiida.plugins import WorkflowFactory
from aiida.orm import Str, load_code, Dict
from aiida.engine import submit
load_profile()
SmilestoGaussianWorkChain = WorkflowFactory('aimall.smitogauss')
builder = SmilestoGaussianWorkChain.get_builder()
# methyl group
builder.smiles = Str('*C')
builder.gaussian_parameters = Dict(
{
"link0_parameters": {
"%chk": "aiida.chk",
"%mem": "3200MB", # Currently set to use 8000 MB in .sh files
"%nprocshared": 4,
},
"functional": "wb97xd",
"basis_set": "aug-cc-pvtz",
"charge": 0,
"multiplicity": 1,
"route_parameters": {"opt": None, "Output": "WFX"},
"input_parameters": {"output.wfx": None},
}
)
builder.gaussian_code = load_code('gaussian@localhost')
submit(builder)
Examining the output#
[3]:
from aiida.tools.visualization import Graph
# workchain_node = load_node(114229)
graph = Graph(graph_attr={"rankdir": "LR"})
graph.recurse_descendants(
114289,
origin_style=None,
include_process_inputs=True,
annotate_links="both"
)
graph.graphviz
[3]:
The outputs of the workchain are the typical GaussianCalculation output_parameters from aiida-gaussian. Additionally, if a wfx or wfn file was created, it stores that as SinglefileData with node label ‘output_wfx’ for a wfx file whose name is ‘output.wfx’.
Additional Options#
SmilesToGaussianWorkchain takes some additional inputs not provided above. Aside from the runtime parameters seen in the provenance graph generated, one can optionally provide a wavefunction group as wfxgroup. This will store the wavefunction file in the provided group. This is useful for use with the controllers, which scan for inputs to submit from given groups. This functionality will be covered in another tutorial.
SmilesToGaussianWorkchain attempts to find a wavefunction file name from the provided Gaussian input. It does so by looking in the “input_parameters” section of the input dictionary for entries with “wfx” in the name. If for some reason this is not working, you can also pass wfxname as an input to explicitly find the wfx file name.