Adopt new interface
This commit is contained in:
parent
a9098b3d65
commit
a5cb029621
|
|
@ -1,4 +1,4 @@
|
||||||
include("CPU.jl")
|
include("Hamiltonian.jl")
|
||||||
|
|
||||||
T=Float32
|
T=Float32
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@ L::T = 16
|
||||||
n_imag = 0
|
n_imag = 0
|
||||||
μ::T = 0.5
|
μ::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))
|
dim = N ^ (d * (n - 1))
|
||||||
H_mat = zeros(Complex{T}, dim, dim)
|
H_mat = zeros(Complex{T}, dim, dim)
|
||||||
iter = CartesianIndices(vectorDims(H))
|
iter = CartesianIndices(vectorDims(H))
|
||||||
|
|
|
||||||
16
tester.ipynb
16
tester.ipynb
|
|
@ -14,11 +14,11 @@
|
||||||
"# Done.\n",
|
"# Done.\n",
|
||||||
"# -> Time used = 12s\n",
|
"# -> Time used = 12s\n",
|
||||||
"\n",
|
"\n",
|
||||||
"include(\"CPU.jl\")\n",
|
"include(\"Hamiltonian.jl\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"T=Float32\n",
|
"T=Float32\n",
|
||||||
"\n",
|
"\n",
|
||||||
"function V_test(r2::T)::T\n",
|
"function V_test(r2)\n",
|
||||||
" return -4*exp(-r2/4)\n",
|
" return -4*exp(-r2/4)\n",
|
||||||
"end\n",
|
"end\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
"L=4.0f0\n",
|
"L=4.0f0\n",
|
||||||
"n_imag=0\n",
|
"n_imag=0\n",
|
||||||
"\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",
|
"@time evals,evecs,info=eig(H,5)\n",
|
||||||
"print(info.numops,\" operations : \")\n",
|
"print(info.numops,\" operations : \")\n",
|
||||||
"println(evals)\n"
|
"println(evals)\n"
|
||||||
|
|
@ -46,11 +46,11 @@
|
||||||
"# Done.\n",
|
"# Done.\n",
|
||||||
"# -> Time used = 0.229049s\n",
|
"# -> Time used = 0.229049s\n",
|
||||||
"\n",
|
"\n",
|
||||||
"include(\"CPU.jl\")\n",
|
"include(\"Hamiltonian.jl\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"T=Float32\n",
|
"T=Float32\n",
|
||||||
"\n",
|
"\n",
|
||||||
"function V_test(r2::T)::T\n",
|
"function V_test(r2)\n",
|
||||||
" return -4*exp(-r2/4)\n",
|
" return -4*exp(-r2/4)\n",
|
||||||
"end\n",
|
"end\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
"L=14.0f0\n",
|
"L=14.0f0\n",
|
||||||
"n_imag=0\n",
|
"n_imag=0\n",
|
||||||
"\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",
|
"@time evals,evecs,info=eig(H,5)\n",
|
||||||
"print(info.numops,\" operations : \")\n",
|
"print(info.numops,\" operations : \")\n",
|
||||||
"println(evals)"
|
"println(evals)"
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Julia 1.8.5",
|
"display_name": "Julia 1.8.0",
|
||||||
"language": "julia",
|
"language": "julia",
|
||||||
"name": "julia-1.8"
|
"name": "julia-1.8"
|
||||||
},
|
},
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
"file_extension": ".jl",
|
"file_extension": ".jl",
|
||||||
"mimetype": "application/julia",
|
"mimetype": "application/julia",
|
||||||
"name": "julia",
|
"name": "julia",
|
||||||
"version": "1.8.5"
|
"version": "1.8.0"
|
||||||
},
|
},
|
||||||
"orig_nbformat": 4
|
"orig_nbformat": 4
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue