Exemple #1
0
 def test_parse_frequencies(self):
     """Test frequency parsing"""
     no3_path = os.path.join(arc_path, 'arc', 'testing',
                             'NO3_freq_QChem_fails_on_cclib.out')
     c2h6_path = os.path.join(arc_path, 'arc', 'testing',
                              'C2H6_freq_Qchem.out')
     so2oo_path = os.path.join(arc_path, 'arc', 'testing',
                               'SO2OO_CBS-QB3.log')
     no3_freqs = parser.parse_frequencies(path=no3_path, software='QChem')
     c2h6_freqs = parser.parse_frequencies(path=c2h6_path, software='QChem')
     so2oo_freqs = parser.parse_frequencies(path=so2oo_path,
                                            software='Gaussian')
     self.assertTrue(
         np.array_equal(
             no3_freqs,
             np.array([-390.08, -389.96, 822.75, 1113.23, 1115.24, 1195.35],
                      np.float64)))
     self.assertTrue(
         np.array_equal(
             c2h6_freqs,
             np.array([
                 352.37, 847.01, 861.68, 1023.23, 1232.66, 1235.04, 1425.48,
                 1455.31, 1513.67, 1518.02, 1526.18, 1526.56, 3049.78,
                 3053.32, 3111.61, 3114.2, 3134.14, 3136.8
             ], np.float64)))
     self.assertTrue(
         np.array_equal(
             so2oo_freqs,
             np.array([
                 302.51, 468.1488, 469.024, 484.198, 641.0067, 658.6316,
                 902.2888, 1236.9268, 1419.0826
             ], np.float64)))
    def test_parse_frequencies(self):
        """Test frequency parsing"""
        no3_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'NO3_freq_QChem_fails_on_cclib.out')
        c2h6_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'C2H6_freq_QChem.out')
        so2oo_path = os.path.join(ARC_PATH, 'arc', 'testing', 'composite', 'SO2OO_CBS-QB3.log')
        ch2o_path_molpro = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'CH2O_freq_molpro.out')
        ch2o_path_terachem = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'CH2O_freq_terachem.dat')
        ch2o_path_terachem_output = os.path.join(ARC_PATH, 'arc', 'testing', 'freq',
                                                 'formaldehyde_freq_terachem_output.out')
        ncc_path_terachem_output = os.path.join(ARC_PATH, 'arc', 'testing', 'freq',
                                                'ethylamine_freq_terachem_output.out')
        orca_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'orca_example_freq.log')
        dual_freq_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'dual_freq_output.out')

        no3_freqs = parser.parse_frequencies(path=no3_path, software='QChem')
        c2h6_freqs = parser.parse_frequencies(path=c2h6_path, software='QChem')
        so2oo_freqs = parser.parse_frequencies(path=so2oo_path, software='Gaussian')
        ch2o_molpro_freqs = parser.parse_frequencies(path=ch2o_path_molpro, software='Molpro')
        ch2o_terachem_freqs = parser.parse_frequencies(path=ch2o_path_terachem, software='TeraChem')
        ch2o_terachem_output_freqs = parser.parse_frequencies(path=ch2o_path_terachem_output, software='TeraChem')
        ncc_terachem_output_freqs = parser.parse_frequencies(path=ncc_path_terachem_output, software='TeraChem')
        orca_freqs = parser.parse_frequencies(path=orca_path, software='Orca')
        dual_freqs = parser.parse_frequencies(path=dual_freq_path, software='Gaussian')

        np.testing.assert_almost_equal(no3_freqs,
                                       np.array([-390.08, -389.96, 822.75, 1113.23, 1115.24, 1195.35], np.float64))
        np.testing.assert_almost_equal(c2h6_freqs,
                                       np.array([352.37, 847.01, 861.68, 1023.23, 1232.66, 1235.04, 1425.48, 1455.31,
                                                 1513.67, 1518.02, 1526.18, 1526.56, 3049.78, 3053.32, 3111.61, 3114.2,
                                                 3134.14, 3136.8], np.float64))
        np.testing.assert_almost_equal(so2oo_freqs,
                                       np.array([302.51, 468.1488, 469.024, 484.198, 641.0067, 658.6316,
                                                 902.2888, 1236.9268, 1419.0826], np.float64))
        np.testing.assert_almost_equal(ch2o_molpro_freqs,
                                       np.array([1181.01, 1261.34, 1529.25, 1764.47, 2932.15, 3000.10], np.float64))
        np.testing.assert_almost_equal(ch2o_terachem_freqs,
                                       np.array([1198.228, 1271.913, 1562.435, 1900.334, 2918.771, 2966.569],
                                                np.float64))
        np.testing.assert_almost_equal(ch2o_terachem_output_freqs,
                                       np.array([1198.63520807, 1276.19910582, 1563.62759321, 1893.24407646,
                                                 2916.39175334, 2965.86839559], np.float64))
        np.testing.assert_almost_equal(ncc_terachem_output_freqs,
                                       np.array([170.56668709, 278.52007409, 406.49102131, 765.91960508, 861.6118189,
                                                 910.16404036, 1010.63529045, 1052.86795614, 1160.15911873,
                                                 1275.00946008, 1386.75755192, 1406.08828477, 1425.90872097,
                                                 1506.47789418, 1522.65901736, 1527.41841768, 1710.89393731,
                                                 3020.79869151, 3035.66348773, 3061.21808688, 3085.3062489,
                                                 3087.60678739, 3447.41720077, 3529.23879182], np.float64))
        np.testing.assert_almost_equal(orca_freqs,
                                       np.array([1151.03, 1250.19, 1526.12, 1846.4, 3010.49, 3070.82], np.float64))
        np.testing.assert_almost_equal(dual_freqs,
                                       np.array([-1617.8276,    56.9527,    76.681,    121.4038,   182.1572,   194.9796,
                                                   202.4056,   209.9621,   273.506,    342.468,    431.985,    464.0768,
                                                   577.758,    594.4119,   615.5216,   764.1286,   962.2969,   968.0013,
                                                  1004.7852,  1098.0136,  1129.3888,  1137.0454,  1150.7824,  1185.4531,
                                                  1249.0746,  1387.4803,  1401.5073,  1413.8079,  1420.6471,  1453.6296,
                                                  1481.9425,  1487.0125,  1496.0713,  1498.382,   1507.7379,  2280.9881,
                                                  3015.0638,  3018.8871,  3030.1281,  3074.8208,  3079.5256,  3103.8434,
                                                  3109.1728,  3156.4352,  3783.7315], np.float64))
Exemple #3
0
 def test_check_negative_freq(self):
     """Test the check_negative_freq() method"""
     label = 'C2H6'
     self.job3.local_path_to_output_file = os.path.join(arc_path, 'arc', 'testing', 'C2H6_freq_Qchem.out')
     self.job3.job_status = ['done', 'done']
     vibfreqs = parser.parse_frequencies(path=str(self.job3.local_path_to_output_file), software=self.job3.software)
     self.assertTrue(self.sched1.check_negative_freq(label=label, job=self.job3, vibfreqs=vibfreqs))
Exemple #4
0
def determine_convergence(path, job_type, ts=False):
    try:
        log = ess_factory(path)
    except:
        return False
    else:
        for log_type in [GaussianLog, MolproLog, OrcaLog, QChemLog, TeraChemLog]:
            if isinstance(log, log_type):
                software = log_type.__name__.replace('Log', '').lower()
                break
    try:
        done = determine_ess_status(path,
                                    species_label='',
                                    job_type=job_type,
                                    software=software,
                                    )[0] == 'done'
    except:
        return False

    if done and job_type in ['optfreq', 'freq', 'composite']:
        freqs = parse_frequencies(path=path, software=software)
        if not len(freqs):
            # Single atom without freq
            return done
        neg_freqs = [freq for freq in freqs if freq < 0]
        if not ts:
            return done and not len(neg_freqs)
        return done and len(neg_freqs) == 1
Exemple #5
0
 def test_check_negative_freq(self):
     """Test the check_negative_freq() method"""
     label = 'C2H6'
     self.job3.local_path_to_output_file = os.path.join(
         arc_path, 'arc', 'testing', 'freq', 'C2H6_freq_QChem.out')
     self.job3.job_status = [
         'done', {
             'status': 'done',
             'keywords': list(),
             'error': '',
             'line': ''
         }
     ]
     vibfreqs = parser.parse_frequencies(
         path=self.job3.local_path_to_output_file,
         software=self.job3.software)
     self.assertTrue(
         self.sched1.check_negative_freq(label=label,
                                         job=self.job3,
                                         vibfreqs=vibfreqs))