Adopt new interface

This commit is contained in:
Nuwan Yapa 2023-04-07 22:41:53 -04:00
parent a9098b3d65
commit a5cb029621
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
include("CPU.jl")
include("Hamiltonian.jl")
T=Float32
@ -13,7 +13,7 @@ L::T = 16
n_imag = 0
μ::T = 0.5
H = HOperator{T}(V_test, d, n, N, L, μ, n_imag)
H = HOperator{T}(V_test, d, n, N, L, μ, n_imag, cpu_tensor)
dim = N ^ (d * (n - 1))
H_mat = zeros(Complex{T}, dim, dim)
iter = CartesianIndices(vectorDims(H))

View File

@ -14,11 +14,11 @@
"# Done.\n",
"# -> Time used = 12s\n",
"\n",
"include(\"CPU.jl\")\n",
"include(\"Hamiltonian.jl\")\n",
"\n",
"T=Float32\n",
"\n",
"function V_test(r2::T)::T\n",
"function V_test(r2)\n",
" return -4*exp(-r2/4)\n",
"end\n",
"\n",
@ -26,7 +26,7 @@
"L=4.0f0\n",
"n_imag=0\n",
"\n",
"H=HOperator{T}(V_test,3,3,N,L,0.5f0,n_imag)\n",
"H=Hamiltonian{T}(V_test,3,3,N,L,convert(T,0),convert(T,0.5),n_imag,cpu_tensor)\n",
"@time evals,evecs,info=eig(H,5)\n",
"print(info.numops,\" operations : \")\n",
"println(evals)\n"
@ -46,11 +46,11 @@
"# Done.\n",
"# -> Time used = 0.229049s\n",
"\n",
"include(\"CPU.jl\")\n",
"include(\"Hamiltonian.jl\")\n",
"\n",
"T=Float32\n",
"\n",
"function V_test(r2::T)::T\n",
"function V_test(r2)\n",
" return -4*exp(-r2/4)\n",
"end\n",
"\n",
@ -58,7 +58,7 @@
"L=14.0f0\n",
"n_imag=0\n",
"\n",
"H=HOperator{T}(V_test,3,3,N,L,0.5f0,n_imag)\n",
"H=Hamiltonian{T}(V_test,3,3,N,L,convert(T,0),convert(T,0.5),n_imag,cpu_tensor)\n",
"@time evals,evecs,info=eig(H,5)\n",
"print(info.numops,\" operations : \")\n",
"println(evals)"
@ -67,7 +67,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.8.5",
"display_name": "Julia 1.8.0",
"language": "julia",
"name": "julia-1.8"
},
@ -75,7 +75,7 @@
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.8.5"
"version": "1.8.0"
},
"orig_nbformat": 4
},