PotentialFitting

Reference

PotentialFitting.calculate_potentialMethod

calculate_potential(potential::AbstractPotential, cluster::AbstractCluster, indices)

Calculates energy from given potential. Needs to be implemented for each potential.

Arguments

  • potential::AbstractPairPotential : potential
  • cluster::AbstractCluster : molecule cluster
  • indices : indices for atoms that represent potential
source
PotentialFitting.fit_potential!Method
fit_potential!(solver, mpp::MoleculePairPotential, fdata::FitData)
fit_potential!(mpp::MoleculePairPotential, fdata::FitData)

Fits potential using given solver. If solver is not given use default solvers, which is LinearRegression().

Arguments

  • solver : ScikitLearn solver
  • mpp::MoleculePairPotential : potential
  • fdata::FitData : data used in fitting
source
PotentialFitting.get_potential!Method
get_potential!(potential, terms)

Function that sets potential term after potential has been fitted. That is this function transforms fitted term to potential terms. Needs to be implemented for each potential.

Arguments

  • potential : used potential
  • terms : terms from fitting method
source
PotentialFitting.min_distanceMethod

min_distance(mpp::MoleculePairPotential, points)

Gives minimum distance of molecules in mpp on given points. Used to help plotting.

source
PotentialFitting.plot_potentialMethod
plot_potential(pes::Dict; mpp::MoleculePairPotential; emax=100u"cm^-1", marker=:circle)

Plots calculated potential values and fitted potential in same figure. pes is expected to be produced by PotentialCalculation or PotentialDB.

source
PotentialFitting.plot_potentialMethod
plot_potential(pes::Dict; emax=100u"cm^-1")

Plots calculated potential values. Input is expected to be produced by PotentialCalculation or PotentialDB.

source
PotentialFitting.potential_variablesMethod

potential_variables(mpp::MoleculePairPotential, points)

Used to transform cluster data to fittable form.

Arguments

  • mpp::MoleculePairPotential : potential to be fitted
  • points : array for clusters

Returns

Array holding an array for each potential term in mpp.topology that can the be used for fitting.

source
PotentialFitting.save_with_residue_dataMethod
save_with_residue_data(fname, sys, res_name, indx_range)

Save structure sys in a CP2K QM/MM format to pdb file.

Background, CP2K needs QM- and MM-parts to have different residue names. This function add residue name res_name to atoms with index in indx_range and residue name "LIG" to all other atoms. The result is then saved to file fname - you should use pdb suffix.

source
PotentialFitting.scan_potentialMethod
scan_potential(args...; kwargs...)

Plot potentail and visualize structure.

Arguments

  • data::Dict - Data generated by PotentialCalculation or PotentialDB
  • mpp::MoleculePairPotential - (optional) fitted potential.

Keywords

  • scale_radius=0.7 - Parameter for Van der Waals radius.
  • emax=100u"cm^-1" - Maximum energy in plots. Defines also energy unit.
  • extra_box_size=4 - How much extra space is in molecule visualization box.
  • marker=:circle - Marker for calculated potential values.
source
PotentialFitting.set_atomic_symbol!Method
set_atomic_symbol!(sys::FlexibleSystem, s, i::Int)

Changes atomic symbol of atom i. You can use this to edit the symbols so that it is possible to distinquish atoms to different groups in CP2K.

source
PotentialFitting.setweight_e_less!Method
setweight_e_less!(data::FitData, w, emax)

Sets weigth when energy is more than given one.

Arguments

  • data::FitData : data where weigth is adjusted
  • w : new weigth
  • emax : maximum energy
source
PotentialFitting.setweight_e_more!Method
setweight_e_more!(data::FitData, w, emin)

Sets weigth when energy is more than given one.

Arguments

  • data::FitData : data where weigth is adjusted
  • w : new weigth
  • emin : energy
source
StatsBase.rmsdMethod
rmsd(points, energy, mpp::MoleculePairPotential; emax=0u"cm^-1")

Calculates root mean square error for potential mpp.

Atributes

  • points : points where potential is tested
  • energy : referece energy for given points
  • mpp::MoleculePairPotential : potential
  • emax=0u"cm^-1" : cut points where energy is smaller than this
source
PotentialFitting.ClusterPotentialTopologyType

ClusterPotentialTopology{T} <: AbstractClusterPotentialTopology{T}

Container that maps a cluster potential to respective atoms.

Fields

  • potential::T:
  • indices::Vector{Vector{Int}}: Stores information of atoms between which the potentilal exist
source
PotentialFitting.FitDataType
FitData

Structure to help potential parameters fitting.

Fields

  • variables : variables
  • E : energy
  • w : weights

Creation

FitData(mpp, points, energy)
FitData(mpp, data::Dict...)
  • data::Dict : Dict that is returned by load_data_file
source
PotentialFitting.GeneralAngleType

GeneralAngle <: AbstractClusterPotential

General potential with customizable powers for both radial polynomials and cosθ.

Fields

  • constants::Array{Float64,2} : constants
  • ppowers::Vector{Int} : powers for radial polynomials
  • cpowers::Vector{Int} : powers for cosθ

To create potential use:

GeneralAngle(ppowers::AbstractVector{Int}, cpowers::AbstractVector{Int})
source
PotentialFitting.GeneralPowersType

GeneralPowers

General potential with customizable powers.

Fields

  • constants::Vector{Float64} : potential constants
  • powers::Vector{Int} : powers for radius
source
PotentialFitting.PairPotentialTopologyType

PairPotentialTopology{T} <: AbstractPairPotentialTopology{T}

Container that maps a pair potential to respective atoms.

Fields

  • indices::Vector{Tuple{Int, Int}}: Stores information of atom pair(s) between which the potentilal exist
  • potential::T: Potential structure
source