Skip to content

Commit

Permalink
Unpack variables to reduce allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
Leticia-maria committed Nov 24, 2023
1 parent fd72412 commit 21396ed
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ struct GaussianBasisSet <: AbstractBasisSet
R::Matrix{Float64}
α::Matrix{Float64}
d::Matrix{Float64}
N::Matrix{Float64}
::Int
m::Int
n::Int
N::Matrix{Float64}
end

function _angularmomentum(ℓ::T) where T <: Integer
Expand Down Expand Up @@ -151,15 +151,20 @@ function parsebasis(molecule, basisset)
for shell in data["elements"]["$(atom.number)"]["electron_shells"]
for (index, ℓ) in enumerate(shell["angular_momentum"])
for momentum in _angularmomentum(ℓ)
α = hcat(parse.(Float64, shell["exponents"])...)
d = hcat(parse.(Float64, shell["coefficients"][index])...)
= momentum[1]
m = momentum[2]
n = momentum[3]
push!(basis,
GaussianBasisSet(
GaussianBasisSet(
atom.coords,
hcat(parse.(Float64, shell["exponents"])...),
hcat(parse.(Float64, shell["coefficients"][index])...),
momentum[1],
momentum[2],
momentum[3],
normalization.(hcat(parse.(Float64, shell["exponents"])...), momentum[1], momentum[2], momentum[3])
α,
d,
normalization.(α, momentum[1], momentum[2], momentum[3]),
,
m,
n
)
)
end
Expand Down

0 comments on commit 21396ed

Please sign in to comment.