-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_g09_file.py
More file actions
39 lines (30 loc) · 1.07 KB
/
create_g09_file.py
File metadata and controls
39 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from ase.io import read
from ase.calculators.gaussian import Gaussian
import sys
def create_gaussian_input(inp, out):
"""
Creates a g09 .com file without specifing the kind of calculus to run
(optimization, ab-initio md, frequencies...). You would have to add it.
Parameters
==========
inp: str
name of the molecule file to start the g09 calculation.
out: str
name of the gaussian file (.com) without extension. Default
chemical formula.
Return
======
(ase.calculator.Gaussian) Calculator used to create the input.
"""
atoms = read(inp)
if out is None:
out = atoms.get_chemical_formula()
calculator = Gaussian(label=out,
chk=out,
xc='bmk',
basis='6-31+g',
mult=1)
calculator.write_input(atoms)
return calculator
if __name__ == '__main__':
create_gaussian_input(sys.argv[1], sys.argv[2])