Skip to content

Commit

Permalink
Add normalization constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Leticia-maria committed Nov 24, 2023
1 parent 6b0951a commit 59fd7c7
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ struct GaussianBasisSet <: AbstractBasisSet
::Int
m::Int
n::Int
N::Matrix{Float64}
end

function _angularmomentum(ℓ::T) where T <: Integer
Expand Down Expand Up @@ -81,6 +82,22 @@ function _getbasis(atoms, basis)
return data
end

function doublefactorial(number)
fact = foldl(Base.:*, range(number, 1, step=-2))

return fact
end

function normalization(α, ℓ, m, n)
N = (4 * α)^(ℓ + m + n)
N /=
doublefactorial(2 *- 1) * doublefactorial(2 * m - 1) * doublefactorial(2 * n - 1)
N *= ((2 * α) / π)^(3 / 2)
N = sqrt(N)

return N
end

"""
The ```parsebasis``` method takes an XYZ file and returns a list of ```GaussianBasisSet``` objects.
The XYZ file is a simple text file that contains the number of atoms in the first line,
Expand Down Expand Up @@ -141,7 +158,8 @@ function parsebasis(molecule, basisset)
hcat(parse.(Float64, shell["coefficients"][index])...),
momentum[1],
momentum[2],
momentum[3]
momentum[3],
normalization.(hcat(parse.(Float64, shell["exponents"])...), momentum[1], momentum[2], momentum[3])
)
)
end
Expand Down

0 comments on commit 59fd7c7

Please sign in to comment.