Moshinsky transform unit tests

This commit is contained in:
Nuwan Yapa 2024-04-12 16:48:11 -04:00
parent 3b3f096913
commit 6f10af12d4
1 changed files with 21 additions and 0 deletions

21
test/moshinsky.jl Normal file
View File

@ -0,0 +1,21 @@
println("### Test: U' * U == identity")
using LinearAlgebra
include("../ho_basis.jl")
E_max = 15
Λ = 0
println("No of threads = ", Threads.nthreads())
@time "Basis" Es, n1s, l1s, n2s, l2s = get_2p_basis(E_max)
println("Basis size = ", length(Es))
@time "Moshinsky brackets" U = Moshinsky_transform(Es, n1s, l1s, n2s, l2s, Λ)
check = conj(U) * U - I
println("Maximum = ", maximum(abs.(check)))
println("Norm = ", sum(check .* conj(check)))