AdiabaticModels
NQCModels.AdiabaticModels
— ModuleAdiabaticModels
All models defined within this module have only a single electronic state and return potentials as scalars and derivatives as simple arrays.
The central abstract type is the AdiabaticModel
, which all models should subtype.
NQCModels.AdiabaticModels.AdiabaticASEModel
— TypeAdiabaticASEModel{A} <: AdiabaticModel
Wrapper for an ase.Atoms
object that has a calculator attached. This Model will synchronise the positions with the ase
object and handle the unit conversions.
Implements both potential
and derivative!
.
Notes on calling Python from Julia
Both PyCall.jl and PythonCall.jl can be used to create the ase.Atoms
object, but PythonCall.jl is preferred.
NQCModels.AdiabaticModels.AdiabaticModel
— TypeAdiabaticModel <: Model
AdiabaticModel
s represent the potentials from classical molecular dynamics where the potential is a function of the position.
Implementation
AdiabaticModel
s should implement:
potential(model, R)
derivative!(model, D, R)
(this is the derivative of the potential energy with respect to the positions)ndofs(model)
(these are the degrees of freedom)
Example
This example creates a 2 dimensional adiabatic model MyModel
. We implement the 3 compulsory functions then evaluate the potential. Here, the argument R
is an AbstractMatrix
since this is a 2D model that can accept multiple atoms.
struct MyModel{P} <: NQCModels.AdiabaticModels.AdiabaticModel
param::P
end
NQCModels.ndofs(::MyModel) = 2
NQCModels.potential(model::MyModel, R::AbstractMatrix) = model.param*sum(R.^2)
NQCModels.derivative!(model::MyModel, D, R::AbstractMatrix) = D .= model.param*2R
model = MyModel(10)
NQCModels.potential(model, [1 2; 3 4])
# output
300
NQCModels.AdiabaticModels.DarlingHollowayElbow
— TypeDarlingHollowayElbow()
Adiabatic elbow potential from Darling and Holloway: Faraday Discuss., 1993, 96, 43-54
NQCModels.AdiabaticModels.DiatomicHarmonic
— TypeDiatomicHarmonic(r₀=1.0)
Harmonic interaction between two particles.
NQCModels.AdiabaticModels.Free
— TypeFree()
Zero external potential everywhere. Useful for modelling free particles.
julia> model, R = Free(3), rand(3, 10);
julia> potential(model, R)
0.0
julia> derivative(model, R)
3×10 Matrix{Float64}:
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
NQCModels.AdiabaticModels.Harmonic
— TypeHarmonic(m=1.0, ω=1.0, r₀=0.0)
Adiabatic harmonic potential. $V(x) = mω^2(x-r₀)^2 / 2$
julia> using Symbolics;
julia> @variables x, m, ω, r₀;
julia> model = Harmonic(m=m, ω=ω, r₀=r₀);
julia> potential(model, hcat(x))
0.5m*(ω^2)*((x - r₀)^2)
julia> derivative(model, hcat(x))
1×1 Matrix{Num}:
m*(x - r₀)*(ω^2)
NQCModels.AdiabaticModels.Morse
— TypeNQCModels.AdiabaticModels.eigenenergy
— MethodEq. 43
NQCModels.AdiabaticModels.getλ
— MethodEq. 36
NQCModels.AdiabaticModels.getω₀
— MethodEq. 44