-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbasis2.py
56 lines (43 loc) · 1.83 KB
/
basis2.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Use of basis2 to use a guess from a previous calculation with a different basis set
from pyqchem import get_output_from_qchem, Structure, QchemInput
from pyqchem.parsers.parser_optimization import basic_optimization
from pyqchem.parsers.basic import basic_parser_qchem
# define molecule
coordinates = [[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0],
[0.0, 0.0, -1.0]]
symbols = ['O', 'H', 'H']
molecule = Structure(coordinates=coordinates,
symbols=symbols,
charge=0,
multiplicity=1)
print('Initial structure')
print(molecule)
# Initial calculation with STO-3G basis
qc_input = QchemInput(molecule,
jobtype='opt',
exchange='hf',
basis='sto-3g',
)
parsed_data, ee = get_output_from_qchem(qc_input,
processors=4,
parser=basic_optimization,
force_recalculation=False,
return_electronic_structure=True)
opt_molecule = parsed_data['optimized_molecule']
print('Optimized structure')
print(opt_molecule)
print('Final energy:', parsed_data['energy'])
# Precise calculation with larger 6-31G basis using previous MO as guess
qc_input = QchemInput(opt_molecule,
jobtype='sp',
exchange='hf',
basis='6-31g',
basis2=ee['basis'],
scf_guess=ee['coefficients']
)
parsed_data = get_output_from_qchem(qc_input,
processors=4,
parser=basic_parser_qchem,
force_recalculation=False)
print('results: ', parsed_data)