Exemplo n.º 1
0
 def test_get_t1_diagnostic(self):
     """
     Ensure molpro can retrieve the T1 diagnostic from CCSD calculations
     """
     log = MolproLog(os.path.join(self.data_path, 'ethylene_f12_dz.out'))
     t1_diagnostic = log.get_T1_diagnostic()
     self.assertAlmostEqual(t1_diagnostic, 0.01152184)
Exemplo n.º 2
0
 def test_load_negative_frequency(self):
     """
     Load an imaginary frequency from a  molpro output file
     """
     freq_log = MolproLog(os.path.join(self.data_path, 'molpro_TS.out'))
     imaginary_freq = freq_log.load_negative_frequency()
     self.assertEqual(imaginary_freq, -1997.98)
Exemplo n.º 3
0
 def test_load_non_f12_e0(self):
     """
     Load E0 for CCSD(T) (without F12) from a molpro output file
     """
     molpro_log = MolproLog(os.path.join(self.data_path, 'TS_CCSD(T)_no_F12_sp_molpro.out'))
     e0 = molpro_log.load_energy()
     self.assertAlmostEqual(e0, -301585968.58196217, places=7)
Exemplo n.º 4
0
    def test_load_hosi_from_molpro_log(self):
        """
        Uses a molpro log file for HOSI to test that its
        molecular degrees of freedom can be properly read.
        """

        log = MolproLog(os.path.join(self.data_path, 'HOSI_ccsd_t1.out'))
        conformer, unscaled_frequencies = log.load_conformer(spin_multiplicity=1)
        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, NonlinearRotor)]) == 1)
        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)

        trans = [mode for mode in conformer.modes if isinstance(mode, IdealGasTranslation)][0]
        rot = [mode for mode in conformer.modes if isinstance(mode, NonlinearRotor)][0]
        vib = [mode for mode in conformer.modes if isinstance(mode, HarmonicOscillator)][0]
        t_list = np.array([298.15], np.float64)

        self.assertAlmostEqual(trans.get_partition_function(t_list), 9.175364e7, delta=1e1)
        self.assertAlmostEqual(rot.get_partition_function(t_list), 1.00005557e5, delta=1e-2)
        self.assertAlmostEqual(vib.get_partition_function(t_list), 1.9734989e0, delta=1e-4)

        self.assertAlmostEqual(e0 / constants.Na / constants.E_h, -768.275662, 4)
        self.assertEqual(conformer.spin_multiplicity, 1)
        self.assertEqual(conformer.optical_isomers, 1)
Exemplo n.º 5
0
 def test_check_for_errors(self):
     """
     Uses Molpro log files that failed due to insufficient memory and unrecognized basis set
     to test if errors are properly parsed.
     """
     with self.assertRaises(LogError):
         MolproLog(os.path.join(self.data_path, 'insufficient_memory.out'))
     with self.assertRaises(LogError):
         MolproLog(os.path.join(self.data_path, 'unrecognized_basis_set.out'))
Exemplo n.º 6
0
    def test_load_rad_from_molpro_log_f12(self):
        """
        Uses a Molpro log file for OH (C2H4) to test that radical
        energy can be properly read.
        """

        log = MolproLog(os.path.join(self.data_path, 'OH_f12.out'))
        e0 = log.load_energy()

        self.assertAlmostEqual(e0 / constants.Na / constants.E_h, -75.663696424380, 5)
Exemplo n.º 7
0
    def test_load_qz_from_molpro_log_f12(self):
        """
        Uses a Molpro log file for ethylene_qz (C2H4) to test that F12b
        energy can be properly read.
        """

        log = MolproLog(os.path.join(self.data_path, 'ethylene_f12_qz.out'))
        e0 = log.load_energy()

        self.assertAlmostEqual(e0 / constants.Na / constants.E_h, -78.472682755635, 5)
Exemplo n.º 8
0
 def test_load_mrci_e0(self):
     """
     Load the MRCI and MRCI+Davidson energies from a molpro output file
     """
     mrci_log = MolproLog(os.path.join(self.data_path, 'molpro_mrci.out'))
     mrciq_log = MolproLog(os.path.join(self.data_path, 'molpro_mrci+q.out'))
     mrci_e0 = mrci_log.load_energy()
     mrciq_e0 = mrciq_log.load_energy()
     self.assertAlmostEqual(mrci_e0, -293217091.0381712, places=7)
     self.assertAlmostEqual(mrciq_e0, -293284017.3925107, places=7)