示例#1
0
def calculate_deriv_gto(gto1, gto2, gto3, gto4, coord):
    # build integrator object
    integrator = PyQInt()

    # distance
    diff = 0.00001
    p = np.zeros(3)
    p[coord] = diff

    gto1_new1 = gto(gto1.c, gto1.p - 0.5 * p, gto1.alpha, gto1.l, gto1.m,
                    gto1.n)
    gto1_new2 = gto(gto1.c, gto1.p + 0.5 * p, gto1.alpha, gto1.l, gto1.m,
                    gto1.n)

    # build hydrogen molecule
    left = integrator.repulsion_gto(gto1_new1, gto2, gto3, gto4)
    right = integrator.repulsion_gto(gto1_new2, gto2, gto3, gto4)

    return (right - left) / diff
示例#2
0
    def test_gto_repulsion(self):
        """
        Test two-electron integrals for primitive GTOs

        (ij|kl) = <gto_i gto_j | r_ij | gto_k gto_l>
        """

        # construct integrator object
        integrator = PyQInt()

        # test GTO
        gto1 = gto(0.154329, [0.0, 0.0, 0.0], 3.425251, 0, 0, 0)
        gto2 = gto(0.535328, [0.0, 0.0, 0.0], 0.623914, 0, 0, 0)
        gto3 = gto(0.444635, [0.0, 0.0, 0.0], 0.168855, 0, 0, 0)
        repulsion = integrator.repulsion_gto(gto1, gto1, gto1, gto1)
        result = 2.0883402824401855
        np.testing.assert_almost_equal(repulsion, result, 4)