Helper Functions

flare.kernels.kernels.coordination_number(rij, cij, r_cut, cutoff_func)
Pairwise contribution to many-body descriptor based on number of
atoms in the environment
Parameters:
  • rij (float) – distance between atoms i and j
  • cij (float) – Component of versor of rij along given direction
  • r_cut (float) – cutoff hyperparameter
  • cutoff_func (callable) – cutoff function
Returns:

the value of the pairwise many-body contribution float: the value of the derivative of the pairwise many-body contribution w.r.t. the central atom displacement

Return type:

float

flare.kernels.kernels.force_helper(A, B, C, D, fi, fj, fdi, fdj, ls1, ls2, ls3, sig2)

Helper function for computing the force/force kernel between two pairs or triplets of atoms of the same type.

See Table IV of the SI of the FLARE paper for definitions of intermediate quantities.

Returns:
Force/force kernel between two pairs or triplets of atoms of
the same type.
Return type:float
flare.kernels.kernels.k_sq_exp_dev(q1, q2, sig, ls)

First Gradient of generic squared exponential kernel on two many body functions

Parameters:
  • q1 (float) – the many body descriptor of the first local environment
  • q2 (float) – the many body descriptor of the second local environment
  • sig (float) – amplitude hyperparameter
  • ls2 (float) – squared lenghtscale hyperparameter
Returns:

the value of the derivative of the squared exponential kernel

Return type:

float

flare.kernels.kernels.k_sq_exp_double_dev(q1, q2, sig, ls)

Second Gradient of generic squared exponential kernel on two many body functions

Parameters:
  • q1 (float) – the many body descriptor of the first local environment
  • q2 (float) – the many body descriptor of the second local environment
  • sig (float) – amplitude hyperparameter
  • ls2 (float) – squared lenghtscale hyperparameter
Returns:

the value of the double derivative of the squared exponential kernel

Return type:

float

flare.kernels.kernels.mb_grad_helper_ls(q1, q2, qi, qj, sig, ls)

Helper function for many body gradient collecting all the derivatives of the force-force many body kernel w.r.t. ls

flare.kernels.kernels.mb_grad_helper_ls_(qdiffsq, sig, ls)

Derivative of a many body force-force kernel w.r.t. ls

flare.kernels.kernels.q_value(distances, r_cut, cutoff_func, q_func=<function coordination_number>)

Compute value of many-body descriptor based on distances of atoms in the local many-body environment.

Parameters:
  • distances (np.ndarray) – distances between atoms i and j
  • r_cut (float) – cutoff hyperparameter
  • cutoff_func (callable) – cutoff function
  • q_func (callable) – many-body pairwise descrptor function
Returns:

the value of the many-body descriptor

Return type:

float

flare.kernels.kernels.q_value_mc(distances, r_cut, ref_species, species, cutoff_func, q_func=<function coordination_number>)

Compute value of many-body many components descriptor based on distances of atoms in the local many-body environment.

Parameters:
  • distances (np.ndarray) – distances between atoms i and j
  • r_cut (float) – cutoff hyperparameter
  • ref_species (int) – species to consider to compute the contribution
  • species (np.ndarray) – atomic species of neighbours
  • cutoff_func (callable) – cutoff function
  • q_func (callable) – many-body pairwise descrptor function
Returns:

the value of the many-body descriptor

Return type:

float