Atomic Environments

The AtomicEnvironment object stores information about the local environment of an atom. AtomicEnvironment objects are inputs to the 2-, 3-, and 2+3-body kernels.

class flare.env.AtomicEnvironment(structure: flare.struc.Structure, atom: int, cutoffs, cutoffs_mask=None)

Contains information about the local environment of an atom, including arrays of pair and triplet distances and the chemical species of atoms in the environment.

Parameters:
  • structure (struc.Structure) – Structure of atoms.
  • atom (int) – Index of the atom in the structure.
  • cutoffs – 2- and 3-body cutoff radii. 2-body if one cutoff is

given, 2+3-body if two are passed. :type cutoffs: np.ndarray :param cutoffs_mask: a dictionary to store multiple cutoffs if neede

it should be exactly the same as the hyps mask

The cutoffs_mask allows the user to define multiple cutoffs for different bonds, triples, and many body interaction. This dictionary should be consistent with the hyps_mask used in the GuassianProcess object.

  • species_mask: 118-long integer array descirbing which elements belong to
    like groups for determining which bond hyperparameters to use. For instance, [0,0,1,1,0 …] assigns H to group 0, He and Li to group 1, and Be to group 0 (the 0th register is ignored).
  • nspecie: Integer, number of different species groups (equal to number of
    unique values in species_mask).
  • ntwobody: Integer, number of different hyperparameter/cutoff sets to
    associate with different 2-body pairings of atoms in groups defined in species_mask.
  • twobody_mask: Array of length nspecie^2, which describes the cutoff to
    associate with different pairings of species types. For example, if there are atoms of type 0 and 1, then twobody_mask defines which cutoff to use for parings [0-0, 0-1, 1-0, 1-1]: if we wanted cutoff0 for 0-0 parings and set 1 for 0-1 and 1-1 pairings, then we would make twobody_mask [0, 1, 1, 1].
  • twobody_cutoff_list: Array of length ntwobody, which stores the cutoff
    used for different types of bonds defined in twobody_mask
  • ncut3b: Integer, number of different cutoffs sets to associate
    with different 3-body pariings of atoms in groups defined in species_mask.
  • cut3b_mask: Array of length nspecie^2, which describes the cutoff to
    associate with different bond types in triplets. For example, in a triplet (C, O, H) , there are three cutoffs. Cutoffs for CH bond, CO bond and OH bond. If C and O are associate with atom group 1 in species_mask and H are associate with group 0 in species_mask, the cut3b_mask[1*nspecie+0] determines the C/O-H bond cutoff, and cut3b_mask[1*nspecie+1] determines the C-O bond cutoff. If we want the former one to use the 1st cutoff in threebody_cutoff_list and the later to use the 2nd cutoff in threebody_cutoff_list, the cut3b_mask should be [0, 0, 0, 1].
  • threebody_cutoff_list: Array of length ncut3b, which stores the cutoff
    used for different types of bonds in triplets.
  • nmanybody: Integer, number of different cutoffs set to associate with
    different coordination numbers.
  • manybody_mask: Similar to twobody_mask and cut3b_mask.
  • manybody_cutoff_list: Array of length nmanybody, stores the cutoff used
    for different many body terms

Examples can be found at the end of in tests/test_env.py

as_dict(include_structure: bool = False)

Returns Atomic Environment object as a dictionary for serialization purposes. Optional to not include the structure to avoid redundant information. :return:

as_str() → str

Returns string dictionary serialization cast as string.

Returns:output of as_dict method cast as string
Return type:str
static from_dict(dictionary)

Loads in atomic environment object from a dictionary which was serialized by the to_dict method.

Parameters:dictionary – Dictionary describing atomic environment.
static from_file(file_name: str, format: str = '') → Union[flare.env.AtomicEnvironment, List[flare.env.AtomicEnvironment]]

Load an atomic environment from a file or a series of atomic environments :param file_name: :param format: :return: