예제 #1
0
    def testFunctionsCGF(self):
        """
        Test getting amplitude from CGF
        """

        # construct integrator object
        integrator = PyQInt()

        # get compile info
        compile_info = integrator.get_compile_info()

        # build hydrogen molecule
        mol = Molecule()
        mol.add_atom('H', 0.0, 0.0, 0.0)
        cgfs, nuclei = mol.build_basis('sto3g')

        # test values at these coordinates
        coords = []
        for x in np.linspace(0, 10, 10):
            coords.append([x, x, x])

        # results
        ans = [
            6.2825e-01, 7.1229e-02, 6.8672e-03, 3.0000e-04, 3.7662e-06,
            1.3536e-08, 1.3927e-11, 4.1021e-15, 3.4591e-19, 8.3505e-24
        ]

        # test for each coord
        amps = []
        for i, coord in enumerate(coords):
            amp = cgfs[0].get_amp(coord)
            amps.append(amp)

        np.testing.assert_almost_equal(amps, ans, 4)
예제 #2
0
    def test_compiler_info(self):
        """
        Test automatic integral evaluation for hydrogen molecule
        """

        # construct integrator object
        integrator = PyQInt()

        compiler_info = integrator.get_compile_info()
        self.assertTrue(len(compiler_info["compiler_version"]) > 4)
        self.assertTrue(len(compiler_info["compile_date"]) > 10)
        self.assertTrue(len(compiler_info["compile_time"]) > 4)
        self.assertTrue(len(compiler_info["openmp_version"]) > 2)