Single-element Kernels

Single element 2-, 3-, and 2+3-body kernels. The kernel functions to choose:

  • Two body:

    • two_body: force kernel
    • two_body_en: energy kernel
    • two_body_grad: gradient of kernel function
    • two_body_force_en: energy force kernel
  • Three body:

    • three_body,
    • three_body_grad,
    • three_body_en,
    • three_body_force_en,
  • Two plus three body:

    • two_plus_three_body,
    • two_plus_three_body_grad,
    • two_plus_three_en,
    • two_plus_three_force_en
  • Two plus many body:

    • two_plus_many_body,
    • two_plus_many_body_grad,
    • two_plus_many_body_en,
    • two_plus_many_body_force_en
  • Two plus three plus many body:

    • two_plus_three_plus_many_body,
    • two_plus_three_plus_many_body_grad,
    • two_plus_three_plus_many_body_en,
    • two_plus_three_plus_many_body_force_en

Example:

>>> gp_model = GaussianProcess(kernel_name='2b',
                               <other arguments>)
flare.kernels.sc.many_body(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

many-body single-element kernel between two forces.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2-, 3-, and many-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the many-body force/force kernel.

Return type:

float

flare.kernels.sc.many_body_en(env1, env2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

many-body single-element kernel between two local energies.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2-, 3-, and many-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the many-body energy/energy kernel.

Return type:

float

flare.kernels.sc.many_body_en_jit(q_array_1, q_array_2, sig, ls)

many-body single-element energy kernel between accelerated with Numba.

Parameters:
  • q_array_1 (np.ndarray) – coordination number of the 1st local environment.
  • q_array_2 (np.ndarray) – coordination number of the 2nd local environment.
  • sig (float) – many-body signal variance hyperparameter.
  • ls (float) – many-body length scale hyperparameter.
Returns:

Value of the many-body kernel.

Return type:

float

flare.kernels.sc.many_body_force_en(env1, env2, d1, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

many-body single-element kernel between two local energies.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2-, 3-, and many-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the many-body force/energy kernel.

Return type:

float

flare.kernels.sc.many_body_force_en_jit(q_array_1, q_array_2, q_neigh_array_1, q_neigh_grads, d1, sig, ls)

many-body single-element kernel between force and energy components accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – many-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – many-body bond array of the second local environment.
  • neighbouring_dists_array_1 (np.ndarray) – matrix padded with zero values of distances of neighbours for the atoms in the first local environment.
  • num_neighbours_1 (np.nsdarray) – number of neighbours of each atom in the first local environment
  • d1 (int) – Force component of the first environment.
  • sig (float) – many-body signal variance hyperparameter.
  • ls (float) – many-body length scale hyperparameter.
  • r_cut (float) – many-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the many-body kernel.

Return type:

float

flare.kernels.sc.many_body_grad(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

many-body single-element kernel between two force components and its gradient with respect to the hyperparameters.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2-, 3-, and many-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the many-body kernel and its gradient

with respect to the hyperparameters.

Return type:

(float, np.ndarray)

flare.kernels.sc.many_body_grad_jit(q_array_1, q_array_2, q_neigh_array_1, q_neigh_array_2, q_neigh_grads_1, q_neigh_grads_2, d1, d2, sig, ls)

gradient of many-body single-element kernel between two force components w.r.t. the hyperparameters, accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – many-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – many-body bond array of the second local environment.
  • neighbouring_dists_array_1 (np.ndarray) – matrix padded with zero values of distances of neighbours for the atoms in the first local environment.
  • neighbouring_dists_array_2 (np.ndarray) – matrix padded with zero values of distances of neighbours for the atoms in the second local environment.
  • num_neighbours_1 (np.nsdarray) – number of neighbours of each atom in the first local environment
  • num_neighbours_2 (np.ndarray) – number of neighbours of each atom in the second local environment
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • sig (float) – many-body signal variance hyperparameter.
  • ls (float) – many-body length scale hyperparameter.
  • r_cut (float) – many-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the many-body kernel and its gradient w.r.t. sig and ls

Return type:

array

flare.kernels.sc.many_body_jit(q_array_1, q_array_2, q_neigh_array_1, q_neigh_array_2, q_neigh_grads_1, q_neigh_grads_2, d1, d2, sig, ls)

many-body single-element kernel between two force components accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – many-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – many-body bond array of the second local environment.
  • neighbouring_dists_array_1 (np.ndarray) – matrix padded with zero values of distances of neighbours for the atoms in the first local environment.
  • neighbouring_dists_array_2 (np.ndarray) – matrix padded with zero values of distances of neighbours for the atoms in the second local environment.
  • num_neighbours_1 (np.nsdarray) – number of neighbours of each atom in the first local environment
  • num_neighbours_2 (np.ndarray) – number of neighbours of each atom in the second local environment
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • sig (float) – many-body signal variance hyperparameter.
  • ls (float) – many-body length scale hyperparameter.
  • r_cut (float) – many-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the many-body kernel.

Return type:

float

flare.kernels.sc.three_body(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

3-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 3-body kernel.

Return type:

float

flare.kernels.sc.three_body_en(env1, env2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

3-body single-element kernel between two local energies.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 3-body force/energy kernel.

Return type:

float

flare.kernels.sc.three_body_en_jit(bond_array_1, bond_array_2, cross_bond_inds_1, cross_bond_inds_2, cross_bond_dists_1, cross_bond_dists_2, triplets_1, triplets_2, sig, ls, r_cut, cutoff_func)

3-body single-element kernel between two local energies accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – 3-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 3-body bond array of the second local environment.
  • cross_bond_inds_1 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_inds_2 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_1 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_2 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • triplets_1 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the first local environment that are within a distance r_cut of atom m.
  • triplets_2 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the second local environment that are within a distance r_cut of atom m.
  • sig (float) – 3-body signal variance hyperparameter.
  • ls (float) – 3-body length scale hyperparameter.
  • r_cut (float) – 3-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 3-body local energy kernel.

Return type:

float

flare.kernels.sc.three_body_force_en(env1, env2, d1, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

3-body single-element kernel between a force component and a local energy.

Parameters:
  • env1 (AtomicEnvironment) – Local environment associated with the force component.
  • env2 (AtomicEnvironment) – Local environment associated with the local energy.
  • d1 (int) – Force component of the first environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 3-body force/energy kernel.

Return type:

float

flare.kernels.sc.three_body_force_en_jit(bond_array_1, bond_array_2, cross_bond_inds_1, cross_bond_inds_2, cross_bond_dists_1, cross_bond_dists_2, triplets_1, triplets_2, d1, sig, ls, r_cut, cutoff_func)

3-body single-element kernel between a force component and a local energy accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – 3-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 3-body bond array of the second local environment.
  • cross_bond_inds_1 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_inds_2 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_1 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_2 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • triplets_1 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the first local environment that are within a distance r_cut of atom m.
  • triplets_2 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the second local environment that are within a distance r_cut of atom m.
  • d1 (int) – Force component of the first environment (1=x, 2=y, 3=z).
  • sig (float) – 3-body signal variance hyperparameter.
  • ls (float) – 3-body length scale hyperparameter.
  • r_cut (float) – 3-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 3-body force/energy kernel.

Return type:

float

flare.kernels.sc.three_body_grad(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

3-body single-element kernel between two force components and its gradient with respect to the hyperparameters.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 3-body kernel and its gradient

with respect to the hyperparameters.

Return type:

(float, np.ndarray)

flare.kernels.sc.three_body_grad_jit(bond_array_1, bond_array_2, cross_bond_inds_1, cross_bond_inds_2, cross_bond_dists_1, cross_bond_dists_2, triplets_1, triplets_2, d1, d2, sig, ls, r_cut, cutoff_func)

3-body single-element kernel between two force components and its gradient with respect to the hyperparameters.

Parameters:
  • bond_array_1 (np.ndarray) – 3-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 3-body bond array of the second local environment.
  • cross_bond_inds_1 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_inds_2 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_1 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_2 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • triplets_1 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the first local environment that are within a distance r_cut of atom m.
  • triplets_2 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the second local environment that are within a distance r_cut of atom m.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • sig (float) – 3-body signal variance hyperparameter.
  • ls (float) – 3-body length scale hyperparameter.
  • r_cut (float) – 3-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 3-body kernel and its gradient with respect to the hyperparameters.

Return type:

(float, float)

flare.kernels.sc.three_body_jit(bond_array_1, bond_array_2, cross_bond_inds_1, cross_bond_inds_2, cross_bond_dists_1, cross_bond_dists_2, triplets_1, triplets_2, d1, d2, sig, ls, r_cut, cutoff_func)

3-body single-element kernel between two force components accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – 3-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 3-body bond array of the second local environment.
  • cross_bond_inds_1 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_inds_2 (np.ndarray) – Two dimensional array whose row m contains the indices of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_1 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the first local environment that are within a distance r_cut of both atom n and the central atom.
  • cross_bond_dists_2 (np.ndarray) – Two dimensional array whose row m contains the distances from atom m of atoms n > m in the second local environment that are within a distance r_cut of both atom n and the central atom.
  • triplets_1 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the first local environment that are within a distance r_cut of atom m.
  • triplets_2 (np.ndarray) – One dimensional array of integers whose entry m is the number of atoms in the second local environment that are within a distance r_cut of atom m.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • sig (float) – 3-body signal variance hyperparameter.
  • ls (float) – 3-body length scale hyperparameter.
  • r_cut (float) – 3-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 3-body kernel.

Return type:

float

flare.kernels.sc.two_body(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – One-element array containing the 2-body cutoff.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2-body kernel.

Return type:

float

flare.kernels.sc.two_body_en(env1, env2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2-body single-element kernel between two local energies.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – One-element array containing the 2-body cutoff.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2-body force/energy kernel.

Return type:

float

flare.kernels.sc.two_body_en_jit(bond_array_1, bond_array_2, sig, ls, r_cut, cutoff_func)

2-body single-element kernel between two local energies accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – 2-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 2-body bond array of the second local environment.
  • sig (float) – 2-body signal variance hyperparameter.
  • ls (float) – 2-body length scale hyperparameter.
  • r_cut (float) – 2-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 2-body local energy kernel.

Return type:

float

flare.kernels.sc.two_body_force_en(env1, env2, d1, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2-body single-element kernel between a force component and a local energy.

Parameters:
  • env1 (AtomicEnvironment) – Local environment associated with the force component.
  • env2 (AtomicEnvironment) – Local environment associated with the local energy.
  • d1 (int) – Force component of the first environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – One-element array containing the 2-body cutoff.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2-body force/energy kernel.

Return type:

float

flare.kernels.sc.two_body_force_en_jit(bond_array_1, bond_array_2, d1, sig, ls, r_cut, cutoff_func)

2-body single-element kernel between a force component and a local energy accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – 2-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 2-body bond array of the second local environment.
  • d1 (int) – Force component of the first environment (1=x, 2=y, 3=z).
  • sig (float) – 2-body signal variance hyperparameter.
  • ls (float) – 2-body length scale hyperparameter.
  • r_cut (float) – 2-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 2-body force/energy kernel.

Return type:

float

flare.kernels.sc.two_body_grad(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2-body single-element kernel between two force components and its gradient with respect to the hyperparameters.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig, ls).
  • cutoffs (np.ndarray) – One-element array containing the 2-body cutoff.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2-body kernel and its gradient

with respect to the hyperparameters.

Return type:

(float, np.ndarray)

flare.kernels.sc.two_body_grad_jit(bond_array_1, bond_array_2, d1, d2, sig, ls, r_cut, cutoff_func)

2-body single-element kernel between two force components and its gradient with respect to the hyperparameters.

Parameters:
  • bond_array_1 (np.ndarray) – 2-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 2-body bond array of the second local environment.
  • d1 (int) – Force component of the first environment (1=x, 2=y, 3=z).
  • d2 (int) – Force component of the second environment (1=x, 2=y, 3=z).
  • sig (float) – 2-body signal variance hyperparameter.
  • ls (float) – 2-body length scale hyperparameter.
  • r_cut (float) – 2-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 2-body kernel and its gradient with respect to the hyperparameters.

Return type:

(float, float)

flare.kernels.sc.two_body_jit(bond_array_1, bond_array_2, d1, d2, sig, ls, r_cut, cutoff_func)

2-body single-element kernel between two force components accelerated with Numba.

Parameters:
  • bond_array_1 (np.ndarray) – 2-body bond array of the first local environment.
  • bond_array_2 (np.ndarray) – 2-body bond array of the second local environment.
  • d1 (int) – Force component of the first environment (1=x, 2=y, 3=z).
  • d2 (int) – Force component of the second environment (1=x, 2=y, 3=z).
  • sig (float) – 2-body signal variance hyperparameter.
  • ls (float) – 2-body length scale hyperparameter.
  • r_cut (float) – 2-body cutoff radius.
  • cutoff_func (Callable) – Cutoff function.
Returns:

Value of the 2-body kernel.

Return type:

float

flare.kernels.sc.two_plus_many_body(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, d2: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+many-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2b, ls2b, sigmb, lsmb, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_many_body_en(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3+many-body single-element energy kernel.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2, ls2, sig3, ls3, sigm, lsm, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_many_body_force_en(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3+many-body single-element kernel between two force and energy components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2, ls2, sig3, ls3, sigm, lsm, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_many_body_grad(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, d2: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+many-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2b, ls2b, sigmb, lsmb, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_three_body(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, d2: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig1, ls1, sig2, ls2, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3-body kernel.

Return type:

float

flare.kernels.sc.two_plus_three_body_grad(env1, env2, d1, d2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3-body single-element kernel between two force components and its gradient with respect to the hyperparameters.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig1, ls1, sig2, ls2, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3-body kernel and its gradient

with respect to the hyperparameters.

Return type:

(float, np.ndarray)

flare.kernels.sc.two_plus_three_en(env1, env2, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3-body single-element kernel between two local energies.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig1, ls1, sig2, ls2).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3-body force/energy kernel.

Return type:

float

flare.kernels.sc.two_plus_three_force_en(env1, env2, d1, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3-body single-element kernel between a force component and a local energy.

Parameters:
  • env1 (AtomicEnvironment) – Local environment associated with the force component.
  • env2 (AtomicEnvironment) – Local environment associated with the local energy.
  • d1 (int) – Force component of the first environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig1, ls1, sig2, ls2).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3-body force/energy kernel.

Return type:

float

flare.kernels.sc.two_plus_three_plus_many_body(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, d2: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2, ls2, sig3, ls3, sigm, lsm, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_three_plus_many_body_en(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3+many-body single-element energy kernel.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2, ls2, sig3, ls3, sigm, lsm, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_three_plus_many_body_force_en(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3+many-body single-element kernel between two force and energy components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2, ls2, sig3, ls3, sigm, lsm, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float

flare.kernels.sc.two_plus_three_plus_many_body_grad(env1: flare.env.AtomicEnvironment, env2: flare.env.AtomicEnvironment, d1: int, d2: int, hyps, cutoffs, cutoff_func=<function quadratic_cutoff>)

2+3+many-body single-element kernel between two force components.

Parameters:
  • env1 (AtomicEnvironment) – First local environment.
  • env2 (AtomicEnvironment) – Second local environment.
  • d1 (int) – Force component of the first environment.
  • d2 (int) – Force component of the second environment.
  • hyps (np.ndarray) – Hyperparameters of the kernel function (sig2, ls2, sig3, ls3, sigm, lsm, sig_n).
  • cutoffs (np.ndarray) – Two-element array containing the 2- and 3-body cutoffs.
  • cutoff_func (Callable) – Cutoff function of the kernel.
Returns:

Value of the 2+3+many-body kernel.

Return type:

float