mu defaults to 0.5

This commit is contained in:
ysyapa 2023-05-11 18:50:20 -04:00
parent e8593d51a3
commit 3b7d7c7689
4 changed files with 5 additions and 8 deletions

View File

@ -27,11 +27,10 @@ end
N=10
n_image=1
μ=0.5
for L in 5.0:14.0
println("Constructing H operator...")
s=system{T}(3,3,N,L,μ)
s=system{T}(3,3,N,L)
@time H=Hamiltonian{T}(s,V_test,0,n_image,mode)
println("Applying H 1000 times...")
if GPU_mode

View File

@ -8,7 +8,7 @@ struct system{T}
L::T
μ::T
system{T}(d::Int, n::Int, N::Int, L::Real, μ::Real) where {T<:Float} = new{T}(d, n, N, convert(T, L), convert(T, μ))
system{T}(d::Int, n::Int, N::Int, L::Real, μ::Real=0.5) where {T<:Float} = new{T}(d, n, N, convert(T, L), convert(T, μ))
end
norm_square(x::Array{Int})::Int = sum(x .* x)

View File

@ -26,10 +26,9 @@
"N = 6\n",
"L = 12\n",
"ϕ = 0.0\n",
"μ = 0.5\n",
"n_imag = 1\n",
"\n",
"s = system{T}(d, n, N, L, μ)\n",
"s = system{T}(d, n, N, L)\n",
"H = Hamiltonian{T}(s, V_gauss, ϕ, n_imag, mode)\n",
"@time evals, evecs, info = eig(H, 5)\n",
"print(info.numops, \" operations : \")\n",
@ -52,10 +51,9 @@
"N = 32\n",
"L = 16\n",
"ϕ = 0.5\n",
"μ = 0.5\n",
"n_imag = 0\n",
"\n",
"s = system{T}(d, n, N, L, μ)\n",
"s = system{T}(d, n, N, L)\n",
"H = Hamiltonian{T}(s, V_gauss, ϕ, n_imag, mode)\n",
"@time evals, evecs, info = eig(H, 20)\n",
"print(info.numops, \" operations : \")\n",

View File

@ -24,7 +24,7 @@
" n_image=0\n",
" for L::T in 5.0:9.0\n",
" print(\"L=$L\")\n",
" s=system{T}(3,n,N,L,0.5)\n",
" s=system{T}(3,n,N,L)\n",
" H=Hamiltonian{T}(s,V_test,0.0,n_image,mode)\n",
" evals,_,_ = eig(H,5)\n",
" println(real.(evals))\n",