DesignMatrix
-
template<typename F>
class DesignMatrix : public tadah::mlip::DesignMatrixBase Design tadah::core::Matrix \( \Phi \) and the corresponding target vector \( \mathrm{T} \)
An aggregation matrix composed of \phi_i matrices
where N corresponds to the number of structures in a provided StructureDB.Phi = | \phi_1 | | \phi_2 | | ... | | \phi_N |
The ordering in \( \phi_i \)
We need to know: STRESS, FORCE| energy of the 1st structure | force on the 1st atom in the x-dir | force on the 1st atom in the y-dir | force on the 1st atom in the z-dir | force on the 2nd atom in the x-dir | ... | force on the n-th atom in the z-dir | stress xx | stress xy | stress xz | stress yy | stress yz | stress zz
Scalling factors FWEIGHT, SWEIGHT
Default scalling:
Forces are scaled by 1/N_i/3 where N_i is a number of atoms in the i-th structure.
Stresses are scaled by 1/6.
Energies are scaled by 1/N_i
- Template Parameters:
F – tadah::models::Function_Base child -> tadah::models::BF_Base or tadah::models::Kern_Base
Public Functions
-
inline DesignMatrix(F &f, const tadah::core::Context &c, tadah::mlip::memory::IMLIPWorkspaceManager &workspaceManager)
This constructor fully initialise this object.
This class is used to build a Design tadah::core::Matrix.
Usage example:
tadah::core::Context context("tadah::core::Context"); tadah::models::BF_Linear bf(context); DesignMatrix<LinearKernel> desmat(bf, context);
-
inline void refresh_context_scalars(const tadah::core::Context &c)
Refresh per-iter scalars from (possibly updated) context. Intended for HPO reinit paths where loss-weighting keys may change between iters but the DesignMatrix object is reused.
-
inline void build(StDescriptorsDB &st_desc_db, const StructureDB &stdb, bool wcopy)
Build design matrix from already calculated StDescriptorsDB.
Here we simply build matrix from already calculated descriptors. The vector of targets T is build from StructureDB. D2, D3 and DM calculators are not used.
-
template<typename DC>
inline void build(const StructureDB &stdb, Normaliser &norm, DC &dc, bool wcopy) Calculate descriptors and build design matrix.