From 62cd27cbb6a87189062daa92cc1d1e7aca0706fe Mon Sep 17 00:00:00 2001 From: Federico Cerisola Date: Thu, 15 Aug 2024 01:15:24 +0100 Subject: [PATCH] Fix correlations function for LorentzianSD Old implementation failed to work properly for the critically and overdamped cases. --- src/LorentzianSD.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LorentzianSD.jl b/src/LorentzianSD.jl index 1c23b23..507b6d0 100644 --- a/src/LorentzianSD.jl +++ b/src/LorentzianSD.jl @@ -42,8 +42,8 @@ sdoverω(J::LorentzianSD, ω) = (J.α*J.Γ/π)/((ω^2 - J.ω0^2)^2 + (J.Γ*ω)^2 reorganisation_energy(J::LorentzianSD) = J.α/J.ω0^2/2 function correlations_imag(J::LorentzianSD, τ; ωcutoff=Inf) - ω1 = sqrt(J.ω0^2 - J.Γ^2/4) - return -J.α*exp(-J.Γ*τ/2)*sin(ω1*τ)/(2*ω1) + ω1 = sqrt(complex(J.ω0^2 - J.Γ^2/4)) + return -J.α*exp(-J.Γ*τ/2)*τ*real(sinc(ω1*τ/π))/2 end real_memory_kernel_ft(J::LorentzianSD, ω) = (J.α*(J.ω0^2 - ω^2))/((ω^2 - J.ω0^2)^2 + (J.Γ*ω)^2)