Ejemplo n.º 1
0
 def test_energy_from_qchem_log(self):
     """
     Uses a QChem log files to test that
     molecular energies can be properly read.
     """
     log = QChemLog(os.path.join(os.path.dirname(__file__), 'data', 'npropyl.out'))
     self.assertAlmostEqual(log.load_energy(), -310896203.5432524, delta=1e-5)
     log = QChemLog(os.path.join(os.path.dirname(__file__), 'data', 'co.out'))
     self.assertAlmostEqual(log.load_energy(), -297402545.0217114, delta=1e-5)
     log = QChemLog(os.path.join(os.path.dirname(__file__), 'data', 'CH4_sp_qchem.out'))
     self.assertAlmostEqual(log.load_energy(), -106356735.53661588, delta=1e-5)
Ejemplo n.º 2
0
    def test_load_co_modes_from_qchem_log(self):
        """
        Uses a QChem log file for CO to test that its
        molecular degrees of freedom can be properly read.
        """
        log = QChemLog(
            os.path.join(os.path.dirname(__file__), 'data', 'co.out'))
        conformer, unscaled_frequencies = log.load_conformer()
        E0 = log.load_energy()

        self.assertTrue(
            len([
                mode for mode in conformer.modes
                if isinstance(mode, IdealGasTranslation)
            ]) == 1)
        self.assertTrue(
            len([
                mode for mode in conformer.modes
                if isinstance(mode, LinearRotor)
            ]) == 1)
        self.assertTrue(
            len([
                mode for mode in conformer.modes
                if isinstance(mode, NonlinearRotor)
            ]) == 0)
        self.assertTrue(
            len([
                mode for mode in conformer.modes
                if isinstance(mode, HarmonicOscillator)
            ]) == 1)
        self.assertTrue(
            len([
                mode for mode in conformer.modes
                if isinstance(mode, HinderedRotor)
            ]) == 0)