As I am rewriting / redesigning some aspects of this package, I will slowly update some thoughts here about how NBodyIPs works internally.
hash
In NBodyIPs
there is a dummy-type BASIS
defined. This is primarily used
to dispatch the hash
function as follows: Each basis function implements
hash(::BASIS, V::T) = ...
which returns a hash key that describes only the basis function V
but disregards its parameters. For example, OneBody(1.234)
has a
hash that includes the type information as well as the value 1.234
while
hash(::BASIS, V::OneBody) = hash(OneBody)
i.e. this ignores the parameter E0 = 1.234
.
These basis-hashs are used to group and combine the basis functions to allow for faster assembly.
The lsqfit
function allows the kw argument Vref
which can be an arbitrary
AbstractCalculator
that can be used as a reference potential from which to
start the fit. I.e. the final fit will be Vref + Vfit
. If the
kwarg E0
is provided, then Vref = OneBody(E0)
is used as default.
Providing both E0
and Vref
means that E0
will be ignored.
The two main descriptors in NBodyIPs
are BondAngleDesc
and BondLengthDesc
.
Eacha are defined via a space transform and a cutoff function. Please
see inline documentation for these.
NBodyIPs
as a separate type.Regularisers