Skip to content

Commit 186c2d1

Browse files
authored
Changed location of get_hopping_eigenvalues() to SurfaceHoppingMethods.jl (#353)
* changed location of get_hopping_eigenvalues() changed the location of the definition of the get_hopping_eigenvalues() function to SurfaceHoppingMethods.jl so this general surface hopping function is defined in a more appropriate location * fixing mistake in previous commit Previous commit copied over the wrong function from SurfaceHoppingMethods\rpsh.jl * added RingPolymerSimulation as dependency in SurfaceHoppingMethods.jl
1 parent d853f7f commit 186c2d1

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/DynamicsMethods/SurfaceHoppingMethods/SurfaceHoppingMethods.jl

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ using NQCDynamics:
1616
NQCDynamics,
1717
AbstractSimulation,
1818
Simulation,
19+
RingPolymerSimulation,
1920
Calculators,
2021
DynamicsMethods,
2122
DynamicsUtils,
@@ -84,6 +85,14 @@ function DynamicsMethods.create_problem(u0, tspan, sim::AbstractSimulation{<:Sur
8485
callback=DynamicsMethods.get_callbacks(sim))
8586
end
8687

88+
function DynamicsUtils.get_hopping_eigenvalues(sim::Simulation, r::AbstractMatrix)
89+
return Calculators.get_eigen(sim.calculator, r).values
90+
end
91+
92+
function DynamicsUtils.get_hopping_eigenvalues(sim::RingPolymerSimulation, r::AbstractArray{T,3}) where {T}
93+
return Calculators.get_centroid_eigen(sim.calculator, r).values
94+
end
95+
8796
include("decoherence_corrections.jl")
8897
include("surface_hopping.jl")
8998
include("fssh.jl")

src/DynamicsMethods/SurfaceHoppingMethods/fssh.jl

-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ function DynamicsUtils.get_hopping_velocity(::Simulation, v::AbstractMatrix)
8383
return v
8484
end
8585

86-
function DynamicsUtils.get_hopping_eigenvalues(sim::Simulation, r::AbstractMatrix)
87-
return Calculators.get_eigen(sim.calculator, r).values
88-
end
89-
9086
function fewest_switches_probability!(probability, v, σ, s, d, dt)
9187
probability .= 0 # Set all entries to 0
9288
for m in axes(σ, 1)

src/DynamicsMethods/SurfaceHoppingMethods/rpsh.jl

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ function DynamicsUtils.get_hopping_velocity(::RingPolymerSimulation, v::Abstract
3535
return get_centroid(v)
3636
end
3737

38-
function DynamicsUtils.get_hopping_eigenvalues(sim::RingPolymerSimulation, r::AbstractArray{T,3}) where {T}
39-
return Calculators.get_centroid_eigen(sim.calculator, r).values
40-
end
41-
4238
function perform_rescaling!(
4339
sim::RingPolymerSimulation{<:SurfaceHopping}, velocity, γ, d
4440
)

0 commit comments

Comments
 (0)