Skip to content

Commit

Permalink
Added memory kernel functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cerisola committed Jul 5, 2023
1 parent 4ae960f commit 34471bd
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
38 changes: 37 additions & 1 deletion src/AbstractSD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,40 @@ function correlations(J::AbstractSD, τ, β)
IRe = quadgk(IntRe, 0.0, Inf)[1]
IIm = quadgk(IntIm, 0.0, Inf)[1]
return IRe + 1im*IIm
end
end

"""
memory_kernel(J::AbstractSD, τ)
Calculate the memory kernel for a spectral density `J` at a given time delay `τ`,
that is
```math
\\mathcal{K}(\\tau) = 2\\Theta(\\tau)\\int_0^\\infty J(\\omega)\\sin(\\omega)\\mathrm{d}\\omega,
```
where ``\\Theta`` is the Heavisde theta function.
# Arguments
- `J::AbstractSD`: The spectral density.
- `τ`: The time delay at which the memory kernel is evaluated.
# Returns
- The memory kernel for the spectral density `J` at the given time delay `τ`.
"""
memory_kernel(J::AbstractSD, τ) = τ <= zero(τ) ? zero(τ) : quadgk-> 2*J(ω)*sin*τ), zero(τ), Inf)[1]

"""
imag_memory_kernel_ft(J::AbstractSD, ω)
Calculate the imaginary part of the Fourier-transform of the memory kernel for a
spectral density `J` at a given frequency `ω`.
# Arguments
- `J::AbstractSD`: The spectral density.
- `ω`: The frequency at which the imaginary part of the Fourier-transform of the memory kernel is evaluated.
# Returns
- The imaginary part of the Fourier-transform of the memory kernel for the spectral density `J` at the given frequency `ω`.
"""
imag_memory_kernel_ft(J::AbstractSD, ω) = π*J(ω)
10 changes: 10 additions & 0 deletions src/LorentzianSD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ sdoverω(J::LorentzianSD, ω) = (J.α*J.Γ/π)/((ω^2 - J.ω0^2)^2 + (J.Γ*ω)^2

reorganisation_energy(J::LorentzianSD) = J.α/J.ω0^2/2

function memory_kernel(J::LorentzianSD, τ)
if τ <= zero(τ)
return zero(τ)
end
ω1 = sqrt(J.ω0^2 - J.Γ^2/4)
return J.α*exp(-J.Γ*τ/2)*sin(ω1*τ)/ω1
end

imag_memory_kernel_ft(J::LorentzianSD, ω) = J.α/(J.ω0^2 - ω^2 - 1im*ω*J.Γ)

"""
struct UnderdampedSD <: AbstractSD
Expand Down

0 comments on commit 34471bd

Please sign in to comment.