Skip to content

Commit c142bf6

Browse files
committed
add hess parsing test
1 parent 3cb17a7 commit c142bf6

File tree

5 files changed

+465
-2
lines changed

5 files changed

+465
-2
lines changed

atomate/qchem/firetasks/tests/test_parse_outputs.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
module_dir = os.path.dirname(os.path.abspath(__file__))
1717

1818

19-
class TestParseOutputQChem(AtomateTest):
19+
class TestParseOutputQChem_grads(AtomateTest):
2020
def setUp(self, lpad=False):
2121
super().setUp(lpad=False)
2222

2323
def tearDown(self):
2424
pass
25-
25+
2626
def test_parse_grad_good(self):
2727
my_calc_dir = os.path.join(module_dir, "..", "..", "test_files","parse_grad_good")
2828
ft = QChemToDb(calc_dir=my_calc_dir, parse_grad_file=True)
@@ -53,5 +53,33 @@ def test_parse_grad_bad(self):
5353
self.assertEqual(task_doc["warnings"]["grad_file_missing"], True)
5454
os.remove(os.path.join(my_calc_dir, "task.json"))
5555

56+
57+
class TestParseOutputQChem_hess(AtomateTest):
58+
def setUp(self, lpad=False):
59+
os.makedirs(os.path.join(module_dir, "..", "..", "test_files", "freq_save_hess", "scratch"))
60+
shutil.copyfile(
61+
os.path.join(module_dir, "..", "..", "test_files", "freq_save_hess", "BUP_scratch", "132.0"),
62+
os.path.join(module_dir, "..", "..", "test_files", "freq_save_hess", "scratch", "132.0"),
63+
)
64+
shutil.copyfile(
65+
os.path.join(module_dir, "..", "..", "test_files", "freq_save_hess", "BUP_scratch", "HESS"),
66+
os.path.join(module_dir, "..", "..", "test_files", "freq_save_hess", "scratch", "HESS"),
67+
)
68+
super().setUp(lpad=False)
69+
70+
def test_parse_hess(self):
71+
my_calc_dir = os.path.join(module_dir, "..", "..", "test_files","freq_save_hess")
72+
ft = QChemToDb(calc_dir=my_calc_dir, parse_hess_file=True)
73+
ft.run_task({})
74+
task_doc = loadfn(os.path.join(my_calc_dir,"task.json"))
75+
self.assertEqual(task_doc["output"]["final_energy"], -151.3244603665)
76+
self.assertEqual(task_doc["output"]["hess_data"]["scratch/132.0"][0],0.12636293260949633)
77+
self.assertEqual(task_doc["output"]["hess_data"]["scratch/132.0"][-2],-0.2025032138024329)
78+
self.assertEqual(task_doc["output"]["hess_data"]["scratch/HESS"][-2], ' -0.175476533300377 -0.202503213802433 0.205623571433770 \n')
79+
os.remove(os.path.join(my_calc_dir, "task.json"))
80+
81+
def tearDown(self):
82+
pass
83+
5684
if __name__ == "__main__":
5785
unittest.main()
1.13 KB
Binary file not shown.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
$hessian
2+
Dimension 12
3+
0.126362932609496
4+
-4.433736872010650E-002 4.803028695314032E-002
5+
-0.232219060220548 0.103994954971091 0.416818534868519
6+
-0.123167531732906 5.620157833111076E-002 0.195627375150984
7+
0.137538029234560
8+
5.610615881394289E-002 -2.601459393545238E-002 -9.539164914755137E-002
9+
-5.996060628950006E-002 2.620827496924317E-002
10+
0.215614248544132 -0.100471300908688 -0.406356673600227
11+
-0.202878917050539 9.735610631707604E-002 0.405676795542478
12+
-1.120660716146122E-002 -6.742724595369494E-003 4.943141033484526E-003
13+
-3.722786556199047E-003 3.996723218112889E-004 -9.222846621205926E-004
14+
0.150458723666484
15+
4.621054102109451E-003 -1.969311331572267E-005 7.592908052803240E-004
16+
4.718238922954899E-004 7.822854599492641E-004 9.346035240281546E-004
17+
0.165896170411460 0.223593900083420
18+
-1.172738217162766E-002 -3.208374969727183E-003 1.948696686335527E-003
19+
-8.608658002456569E-004 1.108219767547019E-003 -2.029424866889353E-003
20+
-0.143052788123427 -0.207585064161736 0.196003044584296
21+
8.011206286599550E-003 -5.121485015710039E-003 3.164854403636131E-002
22+
-1.064771094556473E-002 3.454775153766684E-003 -1.181304683159105E-002
23+
-0.135529329948847 -0.170989048405919 0.155641036095526
24+
0.138165834608429
25+
-1.638984419623026E-002 -2.199599990233876E-002 -9.362596628886355E-003
26+
3.287204066181141E-003 -9.759664940144342E-004 2.180591067569924E-003
27+
-0.159553118137659 -0.224356492429896 0.209685219363836
28+
0.172655758267816 0.247328458826990
29+
2.833219384811784E-002 -3.152790927580822E-004 -1.241055795519516E-002
30+
8.112407699843841E-003 -3.072676937038772E-003 2.709302924727442E-003
31+
0.139031931752027 0.205891169832389 -0.195922316403627
32+
-0.175476533300377 -0.202503213802433 0.205623571433770
33+
$end
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$molecule
2+
0 1
3+
O 0.3178678256 -0.1451772019 0.1876900614
4+
H -0.1270774417 0.0644667196 1.0214927440
5+
H 2.3658372785 0.0719311463 0.7249943525
6+
O 1.8971011149 -0.5514399588 1.2982221472
7+
$end
8+
9+
$rem
10+
job_type = freq
11+
basis = def2-svpd
12+
max_scf_cycles = 100
13+
gen_scfman = true
14+
xc_grid = 3
15+
thresh = 14
16+
s2thresh = 16
17+
scf_algorithm = diis
18+
resp_charges = true
19+
symmetry = false
20+
sym_ignore = true
21+
method = wb97xd
22+
geom_opt_max_cycles = 200
23+
$end
24+

0 commit comments

Comments
 (0)