ClassicalModels
NQCModels.ClassicalModels
— ModuleClassicalModels
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 ClassicalModel
, which all models should subtype.
NQCModels.ClassicalModels.ClassicalModel
— TypeClassicalModel <: Model
ClassicalModel
s represent the potentials from classical molecular dynamics where the potential is a function of the position.
Implementation
ClassicalModel
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 Classical 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.ClassicalModels.ClassicalModel
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.ClassicalModels.DarlingHollowayElbow
— TypeDarlingHollowayElbow()
Adiabatic elbow potential from Darling and Holloway: Faraday Discuss., 1993, 96, 43-54
NQCModels.ClassicalModels.DiatomicHarmonic
— TypeDiatomicHarmonic(r₀=1.0)
Harmonic interaction between two particles.
NQCModels.ClassicalModels.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.ClassicalModels.Harmonic
— TypeHarmonic(m=1.0, ω=1.0, r₀=0.0)
Classical harmonic potential. $V(x) = mω^2(x-r₀)^2 / 2$
m, ω, r₀ are the mass, frequency, and equilibrium position respectively and can be supplied as numbers or Matrices to create a compound model for multiple particles.
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.ClassicalModels.JuLIPModel
— Typestruct JuLIPModel{T} <: ClassicalModel
Model for interfacing with JuLIP potentials.
NQCModels.ClassicalModels.Morse
— TypeNQCModels.ClassicalModels.eigenenergy
— MethodEq. 43
NQCModels.ClassicalModels.getλ
— MethodEq. 36
NQCModels.ClassicalModels.getω₀
— MethodEq. 44