@@ -215,10 +215,10 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
215
215
elif "ESP" in d_calc_final :
216
216
d ["output" ]["esp" ] = d_calc_final ["ESP" ][- 1 ]
217
217
218
- if (
219
- d ["output" ]["job_type " ] == "opt"
220
- or d [ "output" ][ "job_type" ] == "optimization"
221
- ) :
218
+ if "nbo_data" in d_calc_final :
219
+ d ["output" ]["nbo " ] = d_calc_final [ "nbo_data" ]
220
+
221
+ if d [ "output" ][ "job_type" ] in [ "opt" , "optimization" , "ts" ] :
222
222
if "molecule_from_optimized_geometry" in d_calc_final :
223
223
d ["output" ]["optimized_molecule" ] = d_calc_final [
224
224
"molecule_from_optimized_geometry"
@@ -231,28 +231,44 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
231
231
d_calc_final ["opt_constraint" ][0 ],
232
232
float (d_calc_final ["opt_constraint" ][6 ]),
233
233
]
234
- if (
235
- d ["output" ]["job_type" ] == "freq"
236
- or d ["output" ]["job_type" ] == "frequency"
237
- ):
234
+ if d ["output" ]["job_type" ] in ["freq" , "frequency" ]:
238
235
d ["output" ]["frequencies" ] = d_calc_final ["frequencies" ]
236
+ d ["output" ]["frequency_modes" ] = d_calc_final ["frequency_mode_vectors" ]
239
237
d ["output" ]["enthalpy" ] = d_calc_final ["total_enthalpy" ]
240
238
d ["output" ]["entropy" ] = d_calc_final ["total_entropy" ]
241
- if (
242
- d ["input" ]["job_type" ] == "opt"
243
- or d ["input" ]["job_type" ] == "optimization"
244
- ):
239
+ if d ["input" ]["job_type" ] in ["opt" , "optimization" , "ts" ]:
245
240
d ["output" ]["optimized_molecule" ] = d_calc_final ["initial_molecule" ]
246
241
d ["output" ]["final_energy" ] = d ["calcs_reversed" ][1 ]["final_energy" ]
242
+ # For frequency-first calcs
243
+ else :
244
+ if len (d ["calcs_reversed" ]) > 1 :
245
+ first_calc = d ["calcs_reversed" ][- 1 ]["input" ]["rem" ]["job_type" ]
246
+ second_calc = d ["calcs_reversed" ][- 2 ]["input" ]["rem" ]["job_type" ]
247
+ if first_calc in ["freq" , "frequency" ] and second_calc in ["opt" , "optimization" , "ts" ]:
248
+ d ["output" ]["optimized_molecule" ] = d_calc_final ["initial_molecule" ]
249
+ d ["output" ]["final_energy" ] = d ["calcs_reversed" ][1 ]["final_energy" ]
250
+
251
+ if d ["output" ]["job_type" ] == "pes_scan" :
252
+ d ["output" ]["scan_energies" ] = d_calc_final .get ("scan_energies" )
253
+ d ["input" ]["scan_variables" ] = d_calc_final .get ("scan_variables" )
254
+ d ["output" ]["scan_geometries" ] = d_calc_final .get ("optimized_geometries" )
255
+ d ["output" ]["scan_molecules" ] = d_calc_final .get ("molecules_from_optimized_geometries" )
256
+
257
+ if d ["output" ]["job_type" ] == "force" :
258
+ d ["output" ]["gradients" ] = d_calc_final ["gradients" ][0 ]
259
+ if d_calc_final ["pcm_gradients" ] is not None :
260
+ d ["output" ]["pcm_gradients" ] = d_calc_final ["pcm_gradients" ][0 ]
261
+ if d_calc_final ["CDS_gradients" ] is not None :
262
+ d ["output" ]["CDS_gradients" ] = d_calc_final ["CDS_gradients" ][0 ]
247
263
248
264
opt_trajectory = []
249
265
calcs = copy .deepcopy (d ["calcs_reversed" ])
250
266
calcs .reverse ()
251
267
for calc in calcs :
252
268
job_type = calc ["input" ]["rem" ]["job_type" ]
253
- if job_type == "opt" or job_type == "optimization" :
254
- for ii , geom in enumerate (calc ["geometries" ]):
255
- site_properties = {"Mulliken" : calc ["Mulliken" ][ii ]}
269
+ if job_type in [ "opt" , "optimization" , "ts" ] :
270
+ for ii ,geom in enumerate (calc ["geometries" ]):
271
+ site_properties = {"Mulliken" :calc ["Mulliken" ][ii ]}
256
272
if "RESP" in calc :
257
273
site_properties ["RESP" ] = calc ["RESP" ][ii ]
258
274
mol = Molecule (
@@ -310,30 +326,36 @@ def generate_doc(self, dir_name, qcinput_files, qcoutput_files, multirun):
310
326
311
327
d ["state" ] = "successful" if d_calc_final ["completion" ] else "unsuccessful"
312
328
if "special_run_type" in d :
313
- if d ["special_run_type" ] == "frequency_flattener" :
329
+ if d ["special_run_type" ] in [ "frequency_flattener" , "ts_frequency_flattener" ] :
314
330
if d ["state" ] == "successful" :
315
- orig_num_neg_freq = sum (
316
- 1
317
- for freq in d ["calcs_reversed" ][- 2 ]["frequencies" ]
318
- if freq < 0
319
- )
320
- orig_energy = d_calc_init ["final_energy" ]
321
- final_num_neg_freq = sum (
322
- 1 for freq in d_calc_final ["frequencies" ] if freq < 0
323
- )
331
+ orig_num_neg_freq = None
332
+ for calc in d ["calcs_reversed" ][::- 1 ]:
333
+ if "frequencies" in calc :
334
+ orig_num_neg_freq = sum (1 for freq in calc ["frequencies" ] if freq < 0 )
335
+ break
336
+ orig_energy = None
337
+ for calc in d ["calcs_reversed" ][::- 1 ]:
338
+ if "final_energy" in calc :
339
+ if calc ["final_energy" ] is not None :
340
+ orig_energy = calc ["final_energy" ]
341
+ break
342
+ final_num_neg_freq = sum (1 for freq in d_calc_final ["frequencies" ] if freq < 0 )
324
343
final_energy = d ["calcs_reversed" ][1 ]["final_energy" ]
325
- d ["num_frequencies_flattened" ] = (
326
- orig_num_neg_freq - final_num_neg_freq
327
- )
328
- if final_num_neg_freq > 0 : # If a negative frequency remains,
329
- # and it's too large to ignore,
330
- if (
331
- final_num_neg_freq > 1
332
- or abs (d ["output" ]["frequencies" ][0 ]) >= 15.0
333
- ):
334
- d [
335
- "state"
336
- ] = "unsuccessful" # then the flattening was unsuccessful
344
+ if orig_num_neg_freq is None :
345
+ d ["num_frequencies_flattened" ] = 0
346
+ else :
347
+ d ["num_frequencies_flattened" ] = orig_num_neg_freq - final_num_neg_freq
348
+
349
+ if d ["special_run_type" ] == "frequency_flattener" :
350
+ if final_num_neg_freq > 0 : # If a negative frequency remains,
351
+ # and it's too large to ignore,
352
+ if final_num_neg_freq > 1 or abs (d ["output" ]["frequencies" ][0 ]) >= 15.0 :
353
+ d ["state" ] = "unsuccessful" # then the flattening was unsuccessful
354
+ else :
355
+ if final_num_neg_freq > 1 : # If a negative frequency remains,
356
+ # and it's too large to ignore,
357
+ if final_num_neg_freq > 2 or abs (d ["output" ]["frequencies" ][1 ]) >= 15.0 :
358
+ d ["state" ] = "unsuccessful" # then the flattening was unsuccessful
337
359
if final_energy > orig_energy :
338
360
d ["warnings" ]["energy_increased" ] = True
339
361
0 commit comments