Commit 43d0b8ef authored by Alessandro 's avatar Alessandro

decay constants extraction added

parent 79a34cd1
This diff is collapsed.
......@@ -164,6 +164,39 @@ function fit_mass(en_i::Array{uwreal}; t_in::Int64=3, wpm::Union{Nothing, Dict{I
println("\nPar[1] is ", par[1] )
return par[1]
end
function gevp_dec(mat_obs::Vector{MatInfo}, mass::Vector{uwreal}; t0::Int64=2, delta_t_in::Array{Int64}=[2,5], wpm::Union{Nothing, Dict{Int64,Vector{Float64}}}=nothing)
y0s = getfield.(mat_obs, :y0)
mu_list = getfield.(mat_obs, :mu)
plat_dec0 = Vector{uwreal}(undef, length(mat_obs))
for i in 1:length(mat_obs)
mat = getfield(mat_obs[i], :mat_list)[y0s[i]+2:end-1] #matrices to diagonalise for a given sector [i]
evecs = getall_eig(mat, t0)
elem = mat_elem(evecs, mat, mass[i], 1) #ground and excited state energy
plat = select_plateau(mat_obs[i].ensinfo, mu_list)[end] .- y0s[i]
plat_dec0[i] = -dec(elem, plat, mass[i], mu_list[i])
end
return plat_dec0
end
function getall_eig(a::Vector{Matrix{uwreal}}, t0; iter=30)
n = length(a)
res = Vector{Matrix{uwreal}}(undef, n)
[res[i] = uweigvecs(a[i], a[t0]) for i=1:n]
return res
end
function mat_elem(evec::Vector{Matrix{uwreal}}, ct_mat::Vector{Matrix{uwreal}}, mass::uwreal, n::Int64)
t = length(evec)
res = Vector{uwreal}(undef, t)
for i in 1:t
aux = uwdot(evec[i][:,n], uwdot(ct_mat[i], evec[i][:,n]))[1]
aux2 = 1 / (aux^2)^(0.25) * exp(mass * (i)/2)
res[i] = aux2 * uwdot(evec[i][:,n], ct_mat[i][:,n])
end
return res
end
function dec(mat_elem::Vector{uwreal}, plat::Array{Int64}, mass::uwreal, mu::Vector{Float64})
aux = plat_av(mat_elem, plat)
return sqrt(2/ (mass)^3) * sum(mu)* aux
end
function param_av(fit_masses::Vector{uwreal})
w = 1 ./ err.(fit_masses).^2
av = sum(w .* fit_masses) / sum(w)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment