Obtain the Optimized Structures

After the optimization tasks are completed, run ~/gaussian/optlog2gjf.py to process all log files in the current directory. Or specify the output file name (e.g. “test.log”) and process it only, e.g. ~/gaussian/optlog2gjf.py test.log.

  • If the optimization task completes successfully, the optimized structure will be extracted and written to a gjf file. The name of the gjf file will be “test_opt.gjf” of the log file is “test.log”. You can change the default route card by opening and editing the ROUTE in the “~/gaussian/optlog2gjf.py”.
  • If the task is not finished due to time limit, a restarted file will be created. For example, “test_rst.gjf” will be created if “test.log” doesn’t have the optimized structure.
    • If the optimization oscillates, which means the energy goes up down up down multiple times, the structure with the lowest energy will be extracted and written to the restarted file.
    • Otherwise, the restarted file only contains the link 0 commands and route section. And the optimization job will be restarted from the last structure inferred from the checkpoint file (“.chk”).
    • You should resubmit the “*rst.gjf” to the Hyak.
  • If the task fails with error info of “Bend failed for angle”, this means the angle of three atoms is 180º. Those three atoms are included in the end of the log file. Download that file to the local computer, open it with GaussView, modify that angle in the last structure to not equal 180º, save the last structure as Gaussian input format and submit it again!
  • If the task fails with other error information, check what the information is and fix it!

Obtain the Optimized Energies

Run ~/gaussian/HFenergies.py, and it will extract the optimized energy of all log files in the current directory. All energies will be written to a file named with “HFenergies.csv”.

Compress Log Files

The original log files could be big. We can only keep the first and the last structures during the optimization, and remove the middle optimization steps.

  • For example,  run ~/gaussian/compress_optlog.py test.log to generate the compressed log file “test_c.log” from “test.log”. You can delete the original log file and rename “test_c.log” to “test.log” by mv test_c.log test.log.
  • To achieve the above steps for multiple log files: for i in *.log; do ~/gaussian/compress_optlog.py $i; done and  for i in *_c.log; do mv $i ${i/_c/}; done