Commit c20a2ce7 authored by Alessandro 's avatar Alessandro

wpm flag added in juobs_linalg call to uwerr

parent bc1bcae9
......@@ -84,7 +84,7 @@ Given a vector where each entry evals[t] is a uwreal array of eigenvalues, this
The index t here runs from 1:T=lenght(evals), while the index i stands for the number of energy levels computed: i = length(evals[t])
It returns a vector array eff_en where each entry eff_en[t] contains the first N states energies as uwreal objects
"""
function energies(evals::Union{Vector{Vector{uwreal}},Array{Array{uwreal}} })
function energies(evals::Union{Vector{Vector{uwreal}},Array{Array{uwreal}} }; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing)
time = length(evals)
n = length(evals[1])
eff_en = Array{Array{uwreal}}(undef, n)
......@@ -94,7 +94,7 @@ function energies(evals::Union{Vector{Vector{uwreal}},Array{Array{uwreal}} })
ratio = evals[t][i] / evals[t+1][i]
aux_en[t] = 0.5*log(ratio * ratio)
end
uwerr.(aux_en)
isnothing(wpm) ? uwerr.(aux_en) : uwerr.(aux_en, wpm)
eff_en[i] = copy(aux_en)
end
return eff_en
......@@ -332,12 +332,10 @@ function make_householder(a::Vector{uwreal})
v[1] = uwreal(1.0)
H = idty(n)
H = H - (2.0 / uwdot(v,v)) * uwdot(reshape(v, :,1), transpose(v)) #this last term is a vector product
#H = H - (2.0 / dot(value.(v),value.(v))) * uwdot(reshape(v, :,1), reshape(v, 1 ,:))
for i in 1:n
for j in 1:n
#println(H[i,j].ids)
if H[i,j]!= 0 && H[i,j]!=1
#uwerr(H[i,j])
end
end
end
......@@ -410,7 +408,6 @@ function backward_sub(u::Matrix{uwreal}, y::Vector{uwreal})
end
x[i] = (y[i] - temp) /u[i,i]
if x[i] !=0
#uwerr(x[i])
end
end
......@@ -466,9 +463,9 @@ uwnorm(a::Vector{uwreal})
It returns the norm of a vector of uwreal
"""
function uwnorm(a::Vector{uwreal})
function uwnorm(a::Vector{uwreal}; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing)
norm = sqrt(uwdot(a,a))
uwerr(norm)
isnothing(wpm) ? uwerr(norm) : uwerr(norm, wpm)
return norm
end
......@@ -540,7 +537,6 @@ function Base.:*(x::uwreal, y::Matrix{uwreal})
for j in 1:m
res[i,j] = x * y[i,j]
if res[i,j] !=0 && res[i,j] !=1
#uwerr(res[i,j])
end
end
end
......
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