Removed berggren.jl

This commit is contained in:
Nuwan Yapa 2024-12-03 17:48:35 -05:00
parent 37af76e3a8
commit 85de22e94b
6 changed files with 18 additions and 23 deletions

View File

@ -1,18 +0,0 @@
using SparseArrays
include("ho_basis.jl")
"Basis transformation from HO to momentum space"
function get_W_matrix(basis_p, E_max, Λ, μ1ω1, μ2ω2=μ1ω1; weights=true)
Es, n1s, l1s, n2s, l2s = get_2p_basis(E_max, Λ)
W = zeros(ComplexF64, length(basis_p), length(Es))
Threads.@threads for idx in CartesianIndices(W)
(i1, i2) = Tuple(idx)
((j1, j2), (k1, w1), (k2, w2)) = basis_p[i1]
if j1 == l1s[i2] && j2 == l2s[i2]
elem1 = 1/sqrt(sqrt(μ1ω1)) * (-1)^n1s[i2] * ho_basis(j1, n1s[i2], 1/sqrt(μ1ω1) * k1)
elem2 = 1/sqrt(sqrt(μ2ω2)) * (-1)^n2s[i2] * ho_basis(j2, n2s[i2], 1/sqrt(μ2ω2) * k2)
W[idx] = elem1 * elem2 * (weights ? w1 * w2 : 1)
end
end
return sparse(W)
end

View File

@ -1,7 +1,7 @@
using LinearAlgebra, SparseArrays, Arpack using LinearAlgebra, SparseArrays, Arpack
include("helper.jl") include("helper.jl")
include("p_space.jl") include("p_space.jl")
include("berggren.jl") include("ho_basis.jl")
println("No of threads = ", Threads.nthreads()) println("No of threads = ", Threads.nthreads())

View File

@ -1,7 +1,6 @@
using LinearAlgebra, SparseArrays, Arpack using LinearAlgebra, SparseArrays, Arpack
include("helper.jl") include("helper.jl")
include("p_space.jl") include("p_space.jl")
include("berggren.jl")
println("No of threads = ", Threads.nthreads()) println("No of threads = ", Threads.nthreads())
atol = 10^-5 atol = 10^-5

View File

@ -2,7 +2,6 @@ using Arpack, SparseArrays, LRUCache
using DelimitedFiles, Plots using DelimitedFiles, Plots
include("../ho_basis.jl") include("../ho_basis.jl")
include("../p_space.jl") include("../p_space.jl")
include("../berggren.jl")
println("No of threads = ", Threads.nthreads()) println("No of threads = ", Threads.nthreads())

View File

@ -2,7 +2,6 @@ using Arpack, SparseArrays, LRUCache
using DelimitedFiles, Plots using DelimitedFiles, Plots
include("../ho_basis.jl") include("../ho_basis.jl")
include("../p_space.jl") include("../p_space.jl")
include("../berggren.jl")
println("No of threads = ", Threads.nthreads()) println("No of threads = ", Threads.nthreads())

View File

@ -205,3 +205,19 @@ function get_src_V12_matrix(V_of_r, E_max, Λ, μω_global; atol=10^-6, maxevals
return V12 return V12
end end
"Basis transformation from HO to momentum space"
function get_W_matrix(basis_p, E_max, Λ, μ1ω1, μ2ω2=μ1ω1; weights=true)
Es, n1s, l1s, n2s, l2s = get_2p_basis(E_max, Λ)
W = zeros(ComplexF64, length(basis_p), length(Es))
Threads.@threads for idx in CartesianIndices(W)
(i1, i2) = Tuple(idx)
((j1, j2), (k1, w1), (k2, w2)) = basis_p[i1]
if j1 == l1s[i2] && j2 == l2s[i2]
elem1 = 1/sqrt(sqrt(μ1ω1)) * (-1)^n1s[i2] * ho_basis(j1, n1s[i2], 1/sqrt(μ1ω1) * k1)
elem2 = 1/sqrt(sqrt(μ2ω2)) * (-1)^n2s[i2] * ho_basis(j2, n2s[i2], 1/sqrt(μ2ω2) * k2)
W[idx] = elem1 * elem2 * (weights ? w1 * w2 : 1)
end
end
return sparse(W)
end