"""
Molecular integrals over Gaussian basis functions generated by sympleints.
See https://github.com/eljost/sympleints for more information.

sympleints version: 0.1.dev79+g63f1ef8.d20230515
symppy version: 1.10.1

sympleints was executed with the following arguments:
	lmax = 4
	lauxmax = 6
	write = False
	out_dir = devel_ints
	keys = ['~2c2e', '~3c2e_sph']
	sph = False
	opt_basic = True
	normalize = cgto
"""

import numpy


def self_ovlp3d_00(ax, da, A, bx, db, B):
    """Cartesian 3D (ss) self overlap.

    Generated code; DO NOT modify by hand!"""

    result = numpy.zeros((1, 1), dtype=float)

    x0 = (ax + bx) ** (-1.0)

    # 1 item(s)
    result[0, 0] = numpy.sum(5.568327996831708 * da * db * x0**1.5)
    return result


def self_ovlp3d_11(ax, da, A, bx, db, B):
    """Cartesian 3D (pp) self overlap.

    Generated code; DO NOT modify by hand!"""

    result = numpy.zeros((3, 3), dtype=float)

    x0 = ax + bx
    x1 = 2.784163998415854 * da * db * numpy.sqrt(x0 ** (-1.0)) / x0**2

    # 3 item(s)
    result[0, 0] = numpy.sum(x1)
    result[0, 1] = numpy.sum(x1)
    result[0, 2] = numpy.sum(x1)
    return result


def self_ovlp3d_22(ax, da, A, bx, db, B):
    """Cartesian 3D (dd) self overlap.

    Generated code; DO NOT modify by hand!"""

    result = numpy.zeros((6, 6), dtype=float)

    x0 = ax + bx
    x1 = x0 ** (-1.0)
    x2 = 1.392081999207927 * da * db
    x3 = numpy.sqrt(x1) * x2 / x0**3
    x4 = x1**1.5 * x2 / x0**2

    # 6 item(s)
    result[0, 0] = numpy.sum(x3)
    result[0, 1] = numpy.sum(x4)
    result[0, 2] = numpy.sum(x4)
    result[0, 3] = numpy.sum(x3)
    result[0, 4] = numpy.sum(x4)
    result[0, 5] = numpy.sum(x3)
    return result


def self_ovlp3d_33(ax, da, A, bx, db, B):
    """Cartesian 3D (ff) self overlap.

    Generated code; DO NOT modify by hand!"""

    result = numpy.zeros((10, 10), dtype=float)

    x0 = ax + bx
    x1 = x0 ** (-1.0)
    x2 = 0.6960409996039635 * da * db
    x3 = numpy.sqrt(x1) * x2 / x0**4
    x4 = x1**1.5 * x2 / x0**3

    # 10 item(s)
    result[0, 0] = numpy.sum(x3)
    result[0, 1] = numpy.sum(x4)
    result[0, 2] = numpy.sum(x4)
    result[0, 3] = numpy.sum(x4)
    result[0, 4] = numpy.sum(x4)
    result[0, 5] = numpy.sum(x4)
    result[0, 6] = numpy.sum(x3)
    result[0, 7] = numpy.sum(x4)
    result[0, 8] = numpy.sum(x4)
    result[0, 9] = numpy.sum(x3)
    return result


def self_ovlp3d_44(ax, da, A, bx, db, B):
    """Cartesian 3D (gg) self overlap.

    Generated code; DO NOT modify by hand!"""

    result = numpy.zeros((15, 15), dtype=float)

    x0 = 0.5 / (ax + bx)
    x1 = (ax + bx) ** (-1.0)
    x2 = (x1 * (ax + bx) - 1.0) * A[0]
    x3 = 1.772453850905516 * numpy.sqrt(x1)
    x4 = x2**2 * x3
    x5 = x0 * x3
    x6 = 3.0 * x5
    x7 = x0 * (3.0 * x4 + x6)
    x8 = x4 + x5
    x9 = x2 * x8
    x10 = x2 * x5
    x11 = x2 * (2.0 * x10 + x9)
    x12 = 5.0 * x0 * (x11 + x7)
    x13 = 4.0 * x0 * (2.0 * x10 + x9)
    x14 = x11 + x7
    x15 = x14 * x2
    x16 = x2 * (x13 + x15)
    x17 = x12 + x16
    x18 = da * db
    x19 = 0.02991993003418851 * x1 * x18
    x20 = (x1 * (ax + bx) - 1.0) * A[1]
    x21 = x20**2 * x3
    x22 = x21 + x5
    x23 = x18 * x22
    x24 = 0.06666666666666667 * x3
    x25 = x17 * x24
    x26 = (x1 * (ax + bx) - 1.0) * A[2]
    x27 = x26**2 * x3
    x28 = x27 + x5
    x29 = x18 * x28
    x30 = x0 * (3.0 * x21 + x6)
    x31 = x20 * x22
    x32 = 2.0 * x5
    x33 = x20 * (x20 * x32 + x31)
    x34 = x30 + x33
    x35 = x18 * x34
    x36 = 0.1111111111111111 * x14 * x3
    x37 = 0.3333333333333333 * x28
    x38 = x0 * (3.0 * x27 + x6)
    x39 = x26 * x28
    x40 = x26 * (x26 * x32 + x39)
    x41 = x38 + x40
    x42 = 5.0 * x0 * (x30 + x33)
    x43 = 8.0 * x5
    x44 = x0 * (x20 * x43 + 4.0 * x31)
    x45 = x20 * x34
    x46 = x20 * (x44 + x45)
    x47 = x42 + x46
    x48 = x24 * x47
    x49 = x18 * x8
    x50 = 5.0 * x0 * (x38 + x40)
    x51 = x0 * (x26 * x43 + 4.0 * x39)
    x52 = x26 * x41
    x53 = x26 * (x51 + x52)
    x54 = x50 + x53
    x55 = x24 * x54

    # 15 item(s)
    result[0, 0] = numpy.sum(
        x19 * (7.0 * x0 * (x12 + x16) + x2 * (6.0 * x0 * (x13 + x15) + x17 * x2))
    )
    result[0, 1] = numpy.sum(x23 * x25)
    result[0, 2] = numpy.sum(x25 * x29)
    result[0, 3] = numpy.sum(x35 * x36)
    result[0, 4] = numpy.sum(x14 * x23 * x37)
    result[0, 5] = numpy.sum(x18 * x36 * x41)
    result[0, 6] = numpy.sum(x48 * x49)
    result[0, 7] = numpy.sum(x35 * x37 * x8)
    result[0, 8] = numpy.sum(0.3333333333333333 * x23 * x41 * x8)
    result[0, 9] = numpy.sum(x49 * x55)
    result[0, 10] = numpy.sum(
        x19 * (7.0 * x0 * (x42 + x46) + x20 * (6.0 * x0 * (x44 + x45) + x20 * x47))
    )
    result[0, 11] = numpy.sum(x29 * x48)
    result[0, 12] = numpy.sum(0.1111111111111111 * x3 * x35 * x41)
    result[0, 13] = numpy.sum(x23 * x55)
    result[0, 14] = numpy.sum(
        x19 * (7.0 * x0 * (x50 + x53) + x26 * (6.0 * x0 * (x51 + x52) + x26 * x54))
    )
    return result


self_ovlp3d = {
    (0, 0): self_ovlp3d_00,
    (1, 1): self_ovlp3d_11,
    (2, 2): self_ovlp3d_22,
    (3, 3): self_ovlp3d_33,
    (4, 4): self_ovlp3d_44,
}
