Skip to content

Commit

Permalink
Insert of coupling_rescale in wide_band_bath_discretisation.jl
Browse files Browse the repository at this point in the history
Introduction of the keyword 'coupling_rescale' in 'fillbathcouplings!' and 'setcoupling!'
  • Loading branch information
Nhertl authored Sep 18, 2024
1 parent a8abfe2 commit e35b038
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/diabatic/wide_band_bath_discretisation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ function fillbathstates!(out::Hermitian, bath::WideBandBathDiscretisation)
copy!(diagonal, bath.bathstates)
end

function fillbathcoupling!(out::Hermitian, coupling::Real, bath::WideBandBathDiscretisation)
function fillbathcoupling!(out::Hermitian, coupling::Real, bath::WideBandBathDiscretisation, coupling_rescale)
first_column = @view out.data[2:end, 1]
setcoupling!(first_column, bath.bathcoupling, coupling)
setcoupling!(first_column, bath.bathcoupling, coupling, coupling_rescale)
first_row = @view out.data[1, 2:end]
copy!(first_row, first_column)
end

function setcoupling!(out::AbstractVector, bathcoupling::AbstractVector, coupling::Real)
out .= bathcoupling .* coupling
function setcoupling!(out::AbstractVector, bathcoupling::AbstractVector, coupling::Real, coupling_rescale)
out .= bathcoupling .* coupling .* coupling_rescale
end

function setcoupling!(out::AbstractVector, bathcoupling::Real, coupling::Real)
fill!(out, bathcoupling * coupling)
function setcoupling!(out::AbstractVector, bathcoupling::Real, coupling::Real, coupling_rescale)
fill!(out, bathcoupling * coupling .* coupling_rescale)
end

"""
Expand Down

0 comments on commit e35b038

Please sign in to comment.