Generate ORCA 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 ORCA input file we want to generate. As you might have guessed in this specific example we will be working with Ethane.

mol_3d

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.

First we start importing the required modules.

from pathlib import Path
from aqme.qprep import qprep

Next we list all the files whose ORCA input we want.

sdf_files = [str(filepath) for filepath in Path('sdf_files').glob('*.sdf'))]

Now we are going to specify the ORCA calculation.

ORCA_SP = r'''
m06 def2qzvpp
%cpcm
smd true
SMDsolvent "CH2Cl2"
end'''.lstrip()

Now we proceed to generate the ORCA input files.

qprep(files=sdf_files,
      qm_input=ORCA_SP,
      suffix='m06-basic',
      program='orca',
      mem='16GB',
      nprocs=8)

With this we have generated a new folder named QCALC that contains the file 'ethane_conf_1_m06-basic.inp' with the following contents:

# ethane_conf_1_m06-basic
%maxcore 16000
%pal nprocs 8 end
! m06 def2qzvpp
%cpcm
smd true
SMDsolvent "CH2Cl2"
end
* xyz 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.

qprep(files=sdf_files,
      charge=0,
      mult=3,
      qm_input=ORCA_SP,
      suffix='m06-triplet',
      program='orca',
      mem='16GB',
      nprocs=8)

Will lead to the creation of the file 'ethane_conf_1_wb97xd-triplet.com' with the following contents:

# ethane_conf_1_m06-triplet
%maxcore 16000
%pal nprocs 8 end
! m06 def2qzvpp
%cpcm
smd true
SMDsolvent "CH2Cl2"
end
* xyz 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
*