-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsimple_calculation.py
39 lines (31 loc) · 1.44 KB
/
simple_calculation.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
# Simple single point calculation
from pyqchem import get_output_from_qchem, QchemInput, Structure
from pyqchem.parsers.basic import basic_parser_qchem
import numpy as np
molecule = Structure(coordinates=[[0.0, 0.0, 0.0],
[0.0, 0.0, 0.9]],
symbols=['O', 'H'],
charge=-1,
multiplicity=1)
# create qchem input
qc_input = QchemInput(molecule,
jobtype='sp',
exchange='hf',
basis='6-31G',
unrestricted=True)
# calculate and parse qchem output
data = get_output_from_qchem(qc_input,
processors=4,
force_recalculation=True,
parser=basic_parser_qchem,
)
print('scf energy', data['scf_energy'], 'H')
print('Orbital energies (H)')
print(' {:^10} {:^10}'.format('alpha', 'beta'))
for a, b in zip(data['orbital_energies']['alpha'], data['orbital_energies']['beta']):
print('{:10.3f} {:10.3f}'.format(a, b))
print('dipole moment:', data['multipole']['dipole_moment'], data['multipole']['dipole_units'])
print('quadrupole moment ({}):\n'.format(data['multipole']['quadrupole_units']),
np.array(data['multipole']['quadrupole_moment']))
print('octopole moment ({}):\n'.format(data['multipole']['octopole_units']),
np.array(data['multipole']['octopole_moment']))