Generate Gaussian Inputs
For these examples we are going to assume that we have a folder named 'sdf_files' that contains a single file 'ethane.sdf' with a single conformer in .sdf format whose gaussian input file we want to generate. As you might have guessed in this specific example we will be working with Ethane.
The sdf file contents are as follows:
OpenBabel12082212193D
8 7 0 0 0 0 0 0 0 0999 V2000
0.9537 -0.0505 -0.0702 C 0 0 0 0 0 0 0 0 0 0 0 0
2.4658 -0.0505 -0.0702 C 0 0 0 0 0 0 0 0 0 0 0 0
0.5694 -1.0113 -0.4254 H 0 0 0 0 0 0 0 0 0 0 0 0
0.5694 0.7375 -0.7247 H 0 0 0 0 0 0 0 0 0 0 0 0
0.5694 0.1223 0.9395 H 0 0 0 0 0 0 0 0 0 0 0 0
2.8501 -0.2233 -1.0799 H 0 0 0 0 0 0 0 0 0 0 0 0
2.8501 -0.8385 0.5843 H 0 0 0 0 0 0 0 0 0 0 0 0
2.8501 0.9103 0.2850 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 3 1 0 0 0 0
1 4 1 0 0 0 0
1 5 1 0 0 0 0
2 6 1 0 0 0 0
2 7 1 0 0 0 0
2 8 1 0 0 0 0
M END
$$$$
Note
The following code will also work for multiple conformers and/or molecules.
Note
AQME supports various formats for providing the geometries of the conformers. If we want to use a format to specify the molecule that does not contain 3D coordinates we will need to generate them beforehand, please see the Conformer Search section.
We will be using the QPREP module --qprep
We indicate the files whose gaussian input we want --files "sdf_files/*.sdf"
Warning
Please notice that shell wildcard arguments need to be provided as strings.
--files "sdf_files/*.sdf"
should be provided instead of
--files sdf_files/*.sdf
. This feature might change in future to
follow the usual conventions.
We include the suffix that will be appended to the base name of the files
--suffix "wb97xd-basic"
We indicate the details of the gaussian calculation
--qm_input "wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)"
And the number of processors --nprocs 8
and memory --mem 16GB
for
the gaussian calculations.
Our final command will now look like this:
python -m aqme --qprep --files "sdf_files/*.sdf" --qm_input "wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)" --suffix wb97xd-basic --program gaussian --mem 16GB --nprocs 8
With this we have generated a new folder named QCALC that contains the file 'ethane_conf_1_wb97xd-basic.com' with the following contents:
%nprocshared=8
%mem=16GB
# wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)
ethane_conf_1_wb97xd-basic
0 1
C 0.95370000 -0.05050000 -0.07020000
C 2.46580000 -0.05050000 -0.07020000
H 0.56940000 -1.01130000 -0.42540000
H 0.56940000 0.73750000 -0.72470000
H 0.56940000 0.12230000 0.93950000
H 2.85010000 -0.22330000 -1.07990000
H 2.85010000 -0.83850000 0.58430000
H 2.85010000 0.91030000 0.28500000
Enforce Charge and Multiplicity
If we had wanted to specify the charge and multiplicity we just need to add the
appropriate keywords --charge 0 --mult 3
.
Leading to the full command line (note that we have changed the suffix so the file name that we will generate will be different)
python -m aqme --qprep --suffix wb97xd-triplet --charge 0 --mult 3 --files "sdf_files/*.sdf" --qm_input "wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)" --program gaussian --mem 16GB --nprocs 8
Which will create the file 'ethane_conf_1_wb97xd-triplet.com' with the following contents:
%nprocshared=8
%mem=16GB
# wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)
ethane_conf_1_wb97xd-triplet
0 3
C 0.95370000 -0.05050000 -0.07020000
C 2.46580000 -0.05050000 -0.07020000
H 0.56940000 -1.01130000 -0.42540000
H 0.56940000 0.73750000 -0.72470000
H 0.56940000 0.12230000 0.93950000
H 2.85010000 -0.22330000 -1.07990000
H 2.85010000 -0.83850000 0.58430000
H 2.85010000 0.91030000 0.28500000
Include the gen or genecp section
If we want to include a genecp with automatic detection of the atoms in the molecule we have to add some extra keywords:
We need to specify the atoms whose ECP we are setting --gen_atoms "['C']"
As well as the ECP --bs_gen def2svp
The basis set for the atoms that will not use the ECP --bs_nogen "6-31G*"
Finally we need to also substitute the basis set by genecp
in the qm_input
parameter --qm_input "wb97xd/genecp scrf=(smd,solvent=acetonitrile)"
And we end up with the following command line:
python -m aqme --qprep --suffix "wb97xd-genecp" --gen_atoms "['C']" --bs_gen def2svp --bs_nogen "6-31G*" --files "sdf_files/*.sdf" --qm_input "wb97xd/genecp scrf=(smd,solvent=acetonitrile)" --program gaussian --mem 16GB --nprocs 8
Which will lead to the creation of the file 'ethane_conf_1_wb97xd-genecp.com' with the following contents:
%nprocshared=8
%mem=16GB
# wb97xd/genecp scrf=(smd,solvent=acetonitrile)
ethane_conf_1_wb97xd-genecp
0 1
C 0.95370000 -0.05050000 -0.07020000
C 2.46580000 -0.05050000 -0.07020000
H 0.56940000 -1.01130000 -0.42540000
H 0.56940000 0.73750000 -0.72470000
H 0.56940000 0.12230000 0.93950000
H 2.85010000 -0.22330000 -1.07990000
H 2.85010000 -0.83850000 0.58430000
H 2.85010000 0.91030000 0.28500000
H 0
6-31G*
****
C 0
def2svp
****
C 0
def2svp
If we instead do not want to include the ECP section, or in other words we want
to use the gen
instead of genecp
we only need to substitute it in the
qm_input
parameter. AQME will automatically recognize it and write
the input file accordingly:
python -m aqme --qprep --suffix "wb97xd-gen" --gen_atoms "['C']" --bs_gen def2svp --bs_nogen "6-31G*" --files "sdf_files/*.sdf" --qm_input "wb97xd/gen scrf=(smd,solvent=acetonitrile)" --program gaussian --mem 16GB --nprocs 8
Which will lead to the creation of the file 'ethane_conf_1_wb97xd-gen.com' with the following contents:
%nprocshared=8
%mem=16GB
# wb97xd/gen scrf=(smd,solvent=acetonitrile)
ethane_conf_1_wb97xd-gen
0 1
C 0.95370000 -0.05050000 -0.07020000
C 2.46580000 -0.05050000 -0.07020000
H 0.56940000 -1.01130000 -0.42540000
H 0.56940000 0.73750000 -0.72470000
H 0.56940000 0.12230000 0.93950000
H 2.85010000 -0.22330000 -1.07990000
H 2.85010000 -0.83850000 0.58430000
H 2.85010000 0.91030000 0.28500000
H 0
6-31G*
****
C 0
def2svp
****
Include instructions after the geometry section
Finally if we want to specify some extra instructions after the geometry which are required for some commands such as the modredundant optimization option or for nbo6 calculations. Here we use the NBO as an example.
We will only need to add a single extra command to include such instructions
--qm_end "$nbo bndidx $end"
Warning
In linux-based systems the $
needs to be escaped so the previous
option would need to be typed as --qm_end "$nbo bndidx $end"
instead.
But as we are using an NBO calculation as example we also need to use a gaussian
command line that is appropriate for the calculation
--qm_input "pop=(nbo6read,savenbos) wb97xd/def2svp"
Our final command line will look like:
python -m aqme --qprep --suffix wb97xd-nbo --qm_end "$nbo bndidx $end" --qm_input "pop=(nbo6read,savenbos) wb97xd/def2svp" --files "sdf_files/*.sdf" --program gaussian --mem 16GB --nprocs 8
Which will lead to the creation of the file 'ethane_conf_1_wb97xd-nbo.com' with the following contents:
%nprocshared=8
%mem=16GB
# pop=(nbo6read,savenbos) wb97xd/def2svp
ethane_conf_1_wb97xd-nbo
0 1
C 0.95370000 -0.05050000 -0.07020000
C 2.46580000 -0.05050000 -0.07020000
H 0.56940000 -1.01130000 -0.42540000
H 0.56940000 0.73750000 -0.72470000
H 0.56940000 0.12230000 0.93950000
H 2.85010000 -0.22330000 -1.07990000
H 2.85010000 -0.83850000 0.58430000
H 2.85010000 0.91030000 0.28500000
$nbo bndidx $end