Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed location of get_hopping_eigenvalues() to SurfaceHoppingMethods.jl #353

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ using NQCDynamics:
NQCDynamics,
AbstractSimulation,
Simulation,
RingPolymerSimulation,
Calculators,
DynamicsMethods,
DynamicsUtils,
Expand Down Expand Up @@ -84,6 +85,14 @@ function DynamicsMethods.create_problem(u0, tspan, sim::AbstractSimulation{<:Sur
callback=DynamicsMethods.get_callbacks(sim))
end

function DynamicsUtils.get_hopping_eigenvalues(sim::Simulation, r::AbstractMatrix)
return Calculators.get_eigen(sim.calculator, r).values
end

function DynamicsUtils.get_hopping_eigenvalues(sim::RingPolymerSimulation, r::AbstractArray{T,3}) where {T}
return Calculators.get_centroid_eigen(sim.calculator, r).values
end

include("decoherence_corrections.jl")
include("surface_hopping.jl")
include("fssh.jl")
Expand Down
4 changes: 0 additions & 4 deletions src/DynamicsMethods/SurfaceHoppingMethods/fssh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ function DynamicsUtils.get_hopping_velocity(::Simulation, v::AbstractMatrix)
return v
end

function DynamicsUtils.get_hopping_eigenvalues(sim::Simulation, r::AbstractMatrix)
return Calculators.get_eigen(sim.calculator, r).values
end

function fewest_switches_probability!(probability, v, σ, s, d, dt)
probability .= 0 # Set all entries to 0
for m in axes(σ, 1)
Expand Down
4 changes: 0 additions & 4 deletions src/DynamicsMethods/SurfaceHoppingMethods/rpsh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ function DynamicsUtils.get_hopping_velocity(::RingPolymerSimulation, v::Abstract
return get_centroid(v)
end

function DynamicsUtils.get_hopping_eigenvalues(sim::RingPolymerSimulation, r::AbstractArray{T,3}) where {T}
return Calculators.get_centroid_eigen(sim.calculator, r).values
end

function perform_rescaling!(
sim::RingPolymerSimulation{<:SurfaceHopping}, velocity, γ, d
)
Expand Down
Loading