-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bab1b27
commit ae1a6d7
Showing
5 changed files
with
111 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
using Printf | ||
using LinearAlgebra | ||
using Optimisers | ||
using Polynomials4ML | ||
using Random | ||
using ACEpsi: BackflowPooling, BFwf_lux, setupBFState, Jastrow, displayspec, mBFwf, mBFwf_sto | ||
using ACEpsi.AtomicOrbitals: _invmap | ||
using Plots | ||
|
||
|
||
function mwf_multilevel_sto(Nel::Int, Σ::Vector{Char}, nuclei::Vector{Nuc{T}}, Nbf::Vector{Int}, | ||
Dn::STO_NG, | ||
Pn::OrthPolyBasis1D3T, | ||
bYlm::Union{RYlmBasis, CYlmBasis, CRlmBasis}, | ||
_spec::Vector{Vector{NamedTuple{(:n1, :n2, :l), Tuple{Int64, Int64, Int64}}}}, | ||
totdegree::Vector{Int}, | ||
ν::Vector{Int} | ||
) where {T} | ||
level = length(ν) | ||
wf, spec, spec1p, ps, st = [], [], [], [], [] | ||
for i = 1:level | ||
bRnl = AtomicOrbitalsRadials(Pn, Dn, _spec[i]) | ||
_wf, _spec1, _spec1p = mBFwf_sto(Nel, bRnl, bYlm, nuclei, Nbf[i]; totdeg = totdegree[i], ν = ν[i]) | ||
_ps, _st = setupBFState(MersenneTwister(1234), _wf, Σ) | ||
push!(wf, _wf) | ||
push!(spec, _spec1) | ||
push!(spec1p, _spec1p) | ||
push!(ps, _ps) | ||
push!(st, _st) | ||
end | ||
return wf, spec, spec1p, _spec, ps, st | ||
end | ||
|
||
function mwf_multilevel(Nel::Int, Σ::Vector{Char}, nuclei::Vector{Nuc{T}}, Nbf::Vector{Int}, | ||
Dn::STO_NG, | ||
Pn::OrthPolyBasis1D3T, | ||
bYlm::Union{RYlmBasis, CYlmBasis, CRlmBasis}, | ||
_spec::Vector{Vector{NamedTuple{(:n1, :n2, :l), Tuple{Int64, Int64, Int64}}}}, | ||
totdegree::Vector{Int}, | ||
ν::Vector{Int}) where {T} | ||
level = length(ν) | ||
wf, spec, spec1p, ps, st = [], [], [], [], [] | ||
for i = 1:level | ||
bRnl = AtomicOrbitalsRadials(Pn, Dn, _spec[i]) | ||
_wf, _spec1, _spec1p = mBFwf(Nel, bRnl, bYlm, nuclei, Nbf[i]; totdeg = totdegree[i], ν = ν[i]) | ||
_ps, _st = setupBFState(MersenneTwister(1234), _wf, Σ) | ||
push!(wf, _wf) | ||
push!(spec, _spec1) | ||
push!(spec1p, _spec1p) | ||
push!(ps, _ps) | ||
push!(st, _st) | ||
end | ||
return wf, spec, spec1p, _spec, ps, st | ||
end | ||
|
||
# GaussianBasis | ||
function mwf_multilevel(Nel::Int, Σ::Vector{Char}, nuclei::Vector{Nuc{T}}, Nbf::Vector{Int}, | ||
Dn::GaussianBasis, | ||
Pn::OrthPolyBasis1D3T, | ||
bYlm::Union{RYlmBasis, CYlmBasis, CRlmBasis}, | ||
_spec::Vector{Vector{NamedTuple{(:n1, :n2, :l), Tuple{Int64, Int64, Int64}}}}, | ||
totdegree::Vector{Int}, | ||
ν::Vector{Int}) where {T} | ||
level = length(ν) | ||
wf, spec, spec1p, ps, st = [], [], [], [], [] | ||
for i = 1:level | ||
ζ = ones(Float64,length(_spec[i])) | ||
Dn = GaussianBasis(ζ) | ||
bRnl = AtomicOrbitalsRadials(Pn, Dn, _spec[i]) | ||
_wf, _spec1, _spec1p = mBFwf(Nel, bRnl, bYlm, nuclei, Nbf[i]; totdeg = totdegree[i], ν = ν[i]) | ||
_ps, _st = setupBFState(MersenneTwister(1234), _wf, Σ) | ||
push!(wf, _wf) | ||
push!(spec, _spec1) | ||
push!(spec1p, _spec1p) | ||
push!(ps, _ps) | ||
push!(st, _st) | ||
end | ||
return wf, spec, spec1p, _spec, ps, st | ||
end | ||
|
||
# SlaterBasis | ||
function mwf_multilevel(Nel::Int, Σ::Vector{Char}, nuclei::Vector{Nuc{T}}, Nbf::Vector{Int}, | ||
Dn::SlaterBasis, | ||
Pn::OrthPolyBasis1D3T, | ||
bYlm::Union{RYlmBasis, CYlmBasis, CRlmBasis}, | ||
_spec::Vector{Vector{NamedTuple{(:n1, :n2, :l), Tuple{Int64, Int64, Int64}}}}, | ||
totdegree::Vector{Int}, | ||
ν::Vector{Int}) where {T} | ||
level = length(ν) | ||
wf, spec, spec1p, ps, st = [], [], [], [], [] | ||
for i = 1:level | ||
ζ = ones(Float64,length(_spec[i])) | ||
Dn = SlaterBasis(ζ) | ||
bRnl = AtomicOrbitalsRadials(Pn, Dn, _spec[i]) | ||
_wf, _spec1, _spec1p = mBFwf(Nel, bRnl, bYlm, nuclei, Nbf[i]; totdeg = totdegree[i], ν = ν[i]) | ||
_ps, _st = setupBFState(MersenneTwister(1234), _wf, Σ) | ||
push!(wf, _wf) | ||
push!(spec, _spec1) | ||
push!(spec1p, _spec1p) | ||
push!(ps, _ps) | ||
push!(st, _st) | ||
end | ||
return wf, spec, spec1p, _spec, ps, st | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters