Anisotropic PIPs and Models
Functions
Generates a mask matrix identifying unique atom pairs from a list of atom types. |
|
Creates a JIT-compiled function to compute anisotropic masked distances. |
|
Randomizes the length scale parameters in a PIP model parameter tree. |
Classes
Permutationally Invariant Polynomials layer (Anisotropic). |
|
Energy model combining |
|
Energy model using PIP. |
- class molpipx.pip_anisotropic_flax.EnergyPIPAniso(*args, **kwargs)[source]
Bases:
ModuleEnergy model using PIP.
- Variables:
f_mono (Callable) – callable function that returns the monomials
f_poly (Callable) – callable function that returns the polynomials
f_mask (Callable) – callable function that returns the masked distances
l (float) – initial value of the morse variables length scale parameter
n_pairs (int) – Number of unique atom pairs.
- class molpipx.pip_anisotropic_flax.LayerPIPAniso(*args, **kwargs)[source]
Bases:
ModuleEnergy model combining
LayerPIPAnisoand a dense output layer.- Variables:
f_mono (Callable) – Function that returns the monomials.
f_poly (Callable) – Function that returns the polynomials.
f_mask (Callable) – Function that returns the masked distances.
l (float) – Initial value of the morse variables length scale parameter.
n_pairs (int) – Number of unique atom pairs.
- class molpipx.pip_anisotropic_flax.PIPAniso(*args, **kwargs)[source]
Bases:
ModulePermutationally Invariant Polynomials layer (Anisotropic).
- Variables:
f_mono (Callable) – Function that returns the monomials.
f_poly (Callable) – Function that returns the polynomials.
f_mask (Callable) – Function that returns the masked distances.
l (float) – Initial value of the morse variables length scale parameter.
bias_init (Callable) – Initializer function for the
lparameter.n_pairs (int) – Number of unique atom pairs.
- __call__(input)[source]
Applies the PIP transformation to the inputs. Anisotropic version, where we considered different atom-atom type length scale parameter (warning: this function only works for a single input)
- Parameters:
inputs – geometry, array of number of atoms by 3 (Na x 3)
mask – array with the mask for each atom-atom type length scale parameter
- Returns:
pip vector
- Return type:
pip_vector
- molpipx.pip_anisotropic_flax.get_f_mask(mask: jaxtyping.Array) Callable[source]
Creates a JIT-compiled function to compute anisotropic masked distances.
- Parameters:
mask (Array) – The binary mask array generated by
get_mask.- Returns:
A function
f_mask(l, inputs)that returns weighted distances.- Return type:
Callable
- molpipx.pip_anisotropic_flax.get_mask(atom_types: list) Tuple[source]
Generates a mask matrix identifying unique atom pairs from a list of atom types.
- Parameters:
atom_types (list) – A list of atomic symbols (e.g.,
['H', 'H', 'O']).- Returns:
A tuple containing the mask array and a list of unique pair strings.
- Return type:
Tuple
- molpipx.pip_anisotropic_flax.lambda_random_init(params_pip: Any, key: jaxtyping.Array) Any[source]
Randomizes the length scale parameters in a PIP model parameter tree.
- Parameters:
params_pip (Any) – The Flax parameter PyTree.
key (KeyArray) – A JAX random key.
- Returns:
The updated parameter PyTree with randomized lambda values.
- Return type:
Any