Пример #1
0
    def test_init_welltemp_s(self):

        f = [('s', 'wt', 4, (0.5, 2.0, 3.0, 4.0))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small wt')
        self.assertIsInstance(bs, BasisSet)
        self.assertTrue(np.allclose(bs.functions['s']['e'],
                        np.array([16.000, 3.8984375, 1.1875, 0.50585938])))
Пример #2
0
    def test_init_legendre_s(self):

        le_s = np.array([20.08553692, 5.29449005, 1.39561243, 0.36787944])

        f = [('s', 'le', 4, (1.0, 2.0))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small et')
        self.assertIsInstance(bs, BasisSet)
        self.assertTrue(np.allclose(bs.functions['s']['e'], le_s))
Пример #3
0
    def test_init_eventemp_df(self):

        f = [('d', 'et', 4, (0.5, 2.0)), ('f', 'et', 3, (1.0, 3.0))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small et')
        self.assertIsInstance(bs, BasisSet)
        self.assertTrue(np.allclose(bs.functions['d']['e'],
                        np.array([4.0, 2.0, 1.0, 0.5])))
        self.assertTrue(np.allclose(bs.functions['f']['e'],
                        np.array([9.0, 3.0, 1.0])))
Пример #4
0
    def test_init_eventemp_s(self):

        f = [('s', 'et', 5, (0.5, 2.0))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small et')
        self.assertIsInstance(bs, BasisSet)
        self.assertEqual(bs.name, 'small et')
        self.assertEqual(bs.element, 'H')
        self.assertTrue(np.allclose(bs.functions['s']['e'],
                        np.array([8.0, 4.0, 2.0, 1.0, 0.5])))
Пример #5
0
    def test_init_welltemp_sp(self):

        wt_s = np.array([30.4, 13.78515502, 6.21305899, 2.78349551,
                         1.24082247, 0.55241203])
        wt_p = np.array([72.9, 21.58054659, 6.35310115, 1.86463574,
                         0.54936271])
        f = [('s', 'wt', 6, (0.5, 2.0, 0.9, 1.2)),
             ('p', 'wt', 5, (0.5, 3.0, 0.8, 1.3))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small wt')
        self.assertIsInstance(bs, BasisSet)
        self.assertTrue(np.allclose(bs.functions['s']['e'], wt_s))
        self.assertTrue(np.allclose(bs.functions['p']['e'], wt_p))
Пример #6
0
    def test_init_mixed_formula_spd(self):

        et_s = np.array([8.0, 4.0, 2.0, 1.0, 0.5])
        wt_p = np.array([16.000, 3.8984375, 1.1875, 0.50585938])
        leg_d = np.array([36.59823444, 1.8221188, 1.56831219])
        f = [('s', 'et', 5, (0.5, 2.0)),
             ('p', 'wt', 4, (0.5, 2.0, 3.0, 4.0)),
             ('d', 'le', 3, (1.0, 1.5, 1.1))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small et')
        self.assertIsInstance(bs, BasisSet)
        self.assertTrue(np.allclose(bs.functions['s']['e'], et_s))
        self.assertTrue(np.allclose(bs.functions['p']['e'], wt_p))
        self.assertTrue(np.allclose(bs.functions['d']['e'], leg_d))
Пример #7
0
    def test_init_legendre_spd(self):

        leg_s = np.array([1.48029993e+03, 7.57611094e+00, 1.22140276e+00,
                          6.53769785e-01, 1.22456428e-01])
        leg_p = np.array([330.29955991, 5.21663132, 4.70275331, 1.8221188])
        leg_d = np.array([36.59823444, 1.8221188, 1.56831219])
        f = [('s', 'le', 5, (1.0, 3.5, 1.6, 1.2)),
             ('p', 'le', 4, (2.0, 1.5, 1.2, 1.1)),
             ('d', 'le', 3, (1.0, 1.5, 1.1))]
        bs = BasisSet.from_sequence(funs=f, element='H', name='small et')
        self.assertIsInstance(bs, BasisSet)
        self.assertTrue(np.allclose(bs.functions['s']['e'], leg_s))
        self.assertTrue(np.allclose(bs.functions['p']['e'], leg_p))
        self.assertTrue(np.allclose(bs.functions['d']['e'], leg_d))
Пример #8
0
    def setUp(self):

        fs = [('s', 'et', 4, (0.5, 2.0)), ('p', 'et', 3, (1.0, 3.0)),
              ('d', 'et', 2, (1.5, 4.0))]
        self.bs = BasisSet.from_sequence(name='test', element='H', funs=fs)
        self.maxDiff = None