diff --git a/src/OohataHuzinaga.jl b/src/OohataHuzinaga.jl index 7a58044..a5aa96a 100644 --- a/src/OohataHuzinaga.jl +++ b/src/OohataHuzinaga.jl @@ -18,6 +18,8 @@ export gaussianproduct export normalization export overlap +export Operator +export oei export kinetic export boys export attraction diff --git a/src/auxiliary.jl b/src/auxiliary.jl index 798efd0..0b25bcc 100644 --- a/src/auxiliary.jl +++ b/src/auxiliary.jl @@ -16,7 +16,6 @@ end function distance(Rᵢ, Rⱼ) d = (Rᵢ[1] - Rⱼ[1])^2 + (Rᵢ[2] - Rⱼ[2])^2 + (Rᵢ[3] - Rⱼ[3])^2 - return d end diff --git a/src/kinetic.jl b/src/kinetic.jl index d34a21e..56074e0 100644 --- a/src/kinetic.jl +++ b/src/kinetic.jl @@ -1,16 +1,45 @@ +struct Operator<:Function + ô +end + function Kxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ, nᵢ, nⱼ) K = αⱼ * (2 * (ℓⱼ + mⱼ + nⱼ) + 3) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ, nᵢ, nⱼ) K -= (2 * (αⱼ^2)) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ + 2, mᵢ, mⱼ, nᵢ, nⱼ) K -= (2 * (αⱼ^2)) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ + 2, nᵢ, nⱼ) K -= (2 * (αⱼ^2)) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ, nᵢ, nⱼ + 2) - K -= (1 / 2) * (ℓⱼ * (ℓⱼ - 1)) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ - 2, mᵢ, mⱼ, nᵢ, nⱼ) K -= (1 / 2) * (mⱼ * (mⱼ - 1)) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ - 2, nᵢ, nⱼ) K -= (1 / 2) * (nⱼ * (nⱼ - 1)) * Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ, nᵢ, nⱼ - 2) - return K end +function oei(basis, molecule::Molecule, integral::Operator) + n = length(basis) + O = zeros(n, n) + for c in CartesianIndices(O) + i, j = c[1], c[2] + basisᵢ, basisⱼ = basis[i], basis[j] + Rᵢ, Rⱼ = basisᵢ.R, basisⱼ.R + dist = distance(Rᵢ, Rⱼ) + m, p = basisᵢ.size, basisⱼ.size + ℓᵢ, mᵢ, nᵢ = basisᵢ.ℓ, basisᵢ.m, basisᵢ.n + ℓⱼ, mⱼ, nⱼ = basisⱼ.ℓ, basisⱼ.m, basisⱼ.n + for e in CartesianIndices((m, p)) + k, l = e[1], e[2] + αᵢ = basisᵢ.α[k] + αⱼ = basisⱼ.α[l] + dᵢ, dⱼ = basisᵢ.d[k], basisⱼ.d[l] + Nᵢ, Nⱼ = basisᵢ.N[k], basisⱼ.N[l] + O[i, j] += ( + exp(-αᵢ * αⱼ * dist / (αᵢ + αⱼ)) * + Nᵢ * Nⱼ * dᵢ * dⱼ * + integral.ô(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ, nᵢ, nⱼ) + ) + end + end + return O +end + function kinetic(basis, molecule::Molecule) n = length(basis) T = zeros(n, n) diff --git a/src/overlap.jl b/src/overlap.jl index 840d1c9..26805de 100644 --- a/src/overlap.jl +++ b/src/overlap.jl @@ -1,10 +1,8 @@ function Sxyz(Rᵢ, Rⱼ, αᵢ, αⱼ, ℓᵢ, ℓⱼ, mᵢ, mⱼ, nᵢ, nⱼ) Rₚ = gaussianproduct(αᵢ, Rᵢ, αⱼ, Rⱼ, αᵢ + αⱼ) - Sx = sᵢ(ℓᵢ, ℓⱼ, αᵢ + αⱼ, Rᵢ[1], Rⱼ[1], Rₚ[1]) Sy = sᵢ(mᵢ, mⱼ, αᵢ + αⱼ, Rᵢ[2], Rⱼ[2], Rₚ[2]) Sz = sᵢ(nᵢ, nⱼ, αᵢ + αⱼ, Rᵢ[3], Rⱼ[3], Rₚ[3]) - return Sx * Sy * Sz end