Skip to content

Commit

Permalink
Magic number not small enough. Made smaller. Just needs to counter -1…
Browse files Browse the repository at this point in the history
…e-16s
  • Loading branch information
Neutrino155 committed Dec 11, 2023
1 parent 64ff29c commit 59f8127
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TrialPolaron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ println(result)
This example calculates the polaron propagator for given values of τ, v, w, and β. The result is then printed.
"""
function polaron_propagator(τ, v, w, ω, β)
(v^2 - w^2) / v^3 * (1 - exp(-v * τ)) * (1 - exp(-v ** ω - τ))) / (1 - exp(-v * β * ω)) + w^2 / v^2 * τ * (1 - τ / β / ω) + sqrt(eps(Float64))
(v^2 - w^2) / v^3 * (1 - exp(-v * τ)) * (1 - exp(-v ** ω - τ))) / (1 - exp(-v * β * ω)) + w^2 / v^2 * τ * (1 - τ / β / ω) + 1e-15
end

"""
Expand All @@ -54,7 +54,7 @@ println(result)
This example calculates the polaron propagator for the given values of τ, v, and w. The result is then printed.
"""
function polaron_propagator(τ, v, w, ω)
w^2 * τ / v^2 + (v^2 - w^2) / v^3 * (1 - exp(-v * τ)) + sqrt(eps(Float64))
w^2 * τ / v^2 + (v^2 - w^2) / v^3 * (1 - exp(-v * τ)) + 1e-15
end

"""
Expand All @@ -71,7 +71,7 @@ Calculates the recoil function (a generalisation of D(u) in Eqn. (35c) in FHIP 1
See FHIP 1962: https://doi.org/10.1103/PhysRev.127.1004.
"""
function polaron_propagator(τ, v::Vector, w::Vector, ω, β)
return τ * (1 - τ / ω / β) + sum((h_i(i, v, w) / v[i]^2) * ((1 + exp(-v[i] * ω * β) - exp(-v[i] * τ) - exp(v[i] *- ω * β))) / (v[i] * (1 - exp(-v[i] * ω * β))) - τ * (1 - τ / ω / β)) for i in eachindex(v)) + sqrt(eps(Float64))
return τ * (1 - τ / ω / β) + sum((h_i(i, v, w) / v[i]^2) * ((1 + exp(-v[i] * ω * β) - exp(-v[i] * τ) - exp(v[i] *- ω * β))) / (v[i] * (1 - exp(-v[i] * ω * β))) - τ * (1 - τ / ω / β)) for i in eachindex(v)) + 1e-15
end

"""
Expand All @@ -85,7 +85,7 @@ Calculates the recoil function at zero-temperature.
- `w::Vector{Float64}`: is a vector of the w variational parameters.
"""
function polaron_propagator(τ, v::Vector, w::Vector, ω)
return τ + sum((h_i(i, v, w) / v[i]^2) * ((1 - exp(-v[i] * τ)) / v[i] - τ) for i in eachindex(v)) + sqrt(eps(Float64))
return τ + sum((h_i(i, v, w) / v[i]^2) * ((1 - exp(-v[i] * τ)) / v[i] - τ) for i in eachindex(v)) + 1e-15
end

# Hellwarth et al. 1999 PRB - Part IV; T-dep of the Feynman variation parameter
Expand Down

0 comments on commit 59f8127

Please sign in to comment.