bdb6a19f2c4b91583c6480c191a2539ebef3b7b2,qcengine/programs/terachem.py,TeraChemExecutor,parse_output,#TeraChemExecutor#Any#Any#,121

Before Change


        for idx,line in enumerate(output_lines):
            if "FINAL ENERGY" in line:
                properties["scf_total_energy"] = float(line.strip("\n").split()[2])
                last_scf_line = output_lines[idx-2]
                properties["scf_iterations"] = int(last_scf_line.split()[0])
                if "XC Energy" in output_lines:
                    properties["scf_xc_energy"] = float(last_scf_line.split()[4])
            elif "Total atoms" in line:

After Change


                properties["scf_total_energy"] = float(line.strip("\n").split()[2])
                line_final_energy = idx
            elif "Start SCF Iterations" in line:
                line_scf_header = idx
            elif "Total atoms" in line:
                natom = int(line.split()[-1])
            elif "DIPOLE MOMENT" in line:
                newline = line.replace(",","").replace("}","").replace("{","")
                properties["scf_dipole_moment"] = [ float(x) for x in newline.split()[2:5] ]
            elif "Nuclear repulsion energy" in line:
                properties["nuclear_repulsion_energy"] = float(line.split()[-2])
            elif "Gradient units are Hartree/Bohr" in line:
                //Gradient is stored as (dE/dx1,dE/dy1,dE/dz1,dE/dx2,dE/dy2,...)
                for i in range(idx+3,idx+3+natom):
                   grad = output_lines[i].strip("\n").split() 
                   for x in grad:
                       gradients.append( float(x) )

        // Look for the last line that is the SCF info 
        last_scf_line = ""
        for idx in reversed(range(line_scf_header, line_final_energy)):
            current_line = output_lines[idx]
            if self.is_scf_line(current_line):
                last_scf_line = current_line 
                break
                     
        if len(last_scf_line) > 0:
            properties["scf_iterations"] = int(last_scf_line.split()[0])
            if "XC Energy" in output_lines:
                properties["scf_xc_energy"] = float(last_scf_line.split()[4])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: MolSSI/QCEngine
Commit Name: bdb6a19f2c4b91583c6480c191a2539ebef3b7b2
Time: 2019-05-10
Author: fangliu.ustc@gmail.com
File Name: qcengine/programs/terachem.py
Class Name: TeraChemExecutor
Method Name: parse_output


Project Name: cornellius-gp/gpytorch
Commit Name: 3879bcde8d42c619c96b6483dba14a76a8e5f00b
Time: 2019-09-29
Author: kaw293@cornell.edu
File Name: gpytorch/utils/grid.py
Class Name:
Method Name: create_data_from_grid


Project Name: kengz/SLM-Lab
Commit Name: ec849adaf4ceb42ed52ca142c839f627c34b9434
Time: 2018-05-21
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/reinforce.py
Class Name: Reinforce
Method Name: calc_advantage