@@ -173,15 +188,15 @@ function gevp_mass(mat_obs::Vector{MatInfo}; t0::Int64=2, delta_t_in::Array{Int6
...
@@ -173,15 +188,15 @@ function gevp_mass(mat_obs::Vector{MatInfo}; t0::Int64=2, delta_t_in::Array{Int6
end
end
returnplat_en0
returnplat_en0
end
end
function fit_mass(en_i::Array{uwreal};t_in::Int64=3,wpm::Union{Nothing,Dict{Int64,Vector{Float64}}}=nothing)
function fit_mass(en_i::Array{uwreal};t_in::Int64=3,t_fin::Int64=length(en_i)-1,wpm::Union{Nothing,Dict{String,Vector{Float64}},Dict{Int64,Vector{Float64}}}=nothing)
@.model(x,p)=p[1]+p[2]*exp(-x*p[3])
@.model(x,p)=p[1]+p[2]*exp(-x*p[3])
ydata=en_i[t_in:end-5]
ydata=en_i[t_in:t_fin]
xdata=collect(1:length(ydata))
xdata=collect(1:length(ydata))
par,_=fit_routine(model,xdata,ydata,3,wpm=wpm)
par,_=fit_routine(model,xdata,ydata,3,wpm=wpm)
println("\nPar[1] is ",par[1])
println("\nPar[1] is ",par[1])
returnpar[1]
returnpar[1]
end
end
function gevp_dec(mat_obs::Vector{MatInfo},mass::Vector{uwreal};t0::Int64=2,wpm::Union{Nothing,Dict{Int64,Vector{Float64}}}=nothing,pl::Bool=true,n::Int64=1,pseudo::Bool=true)
function gevp_dec(mat_obs::Vector{MatInfo},mass::Vector{uwreal};t0::Int64=2,wpm::Union{Nothing,Dict{Int64,Vector{Float64}}}=nothing,pl::Bool=true,n::Int64=1,pseudo::Bool=true,wilson::Bool=false)
y0s=getfield.(mat_obs,:y0)
y0s=getfield.(mat_obs,:y0)
mu_list=getfield.(mat_obs,:mu)
mu_list=getfield.(mat_obs,:mu)
plat_dec0=Vector{uwreal}(undef,length(mat_obs))
plat_dec0=Vector{uwreal}(undef,length(mat_obs))
...
@@ -192,7 +207,7 @@ function gevp_dec(mat_obs::Vector{MatInfo}, mass::Vector{uwreal}; t0::Int64=2, w
...
@@ -192,7 +207,7 @@ function gevp_dec(mat_obs::Vector{MatInfo}, mass::Vector{uwreal}; t0::Int64=2, w
@@ -204,7 +219,30 @@ function gevp_dec(mat_obs::Vector{MatInfo}, mass::Vector{uwreal}; t0::Int64=2, w
...
@@ -204,7 +219,30 @@ function gevp_dec(mat_obs::Vector{MatInfo}, mass::Vector{uwreal}; t0::Int64=2, w
end
end
returnplat_dec0
returnplat_dec0
end
end
function getall_eig(a::Vector{Matrix{uwreal}},t0;iter=30)
#this second function accepts plateau
function gevp_dec(mat_obs::Vector{MatInfo},mass::Vector{uwreal},plat::Vector{Vector{Int64}};t0::Int64=2,wpm::Union{Nothing,Dict{Int64,Vector{Float64}}}=nothing,pl::Bool=true,n::Int64=1,pseudo::Bool=true,wilson::Bool=false)
y0s=getfield.(mat_obs,:y0)
mu_list=getfield.(mat_obs,:mu)
plat_dec0=Vector{uwreal}(undef,length(mat_obs))
foriin1: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],n)#ground and excited state energy