megnet.data.local_env module

class AllAtomPairs[source]

Bases: pymatgen.analysis.local_env.NearNeighbors

Get all combinations of atoms as bonds in a molecule

get_nn_info(molecule: pymatgen.core.structure.Molecule, n: int) → Dict[source]

Get all near-neighbor sites as well as the associated image locations and weights of the site with index n.

Parameters
  • structure (Structure) – input structure.

  • n (integer) – index of site for which to determine near-neighbor information.

Returns

each dictionary provides information

about a single near neighbor, where key ‘site’ gives access to the corresponding Site object, ‘image’ gives the image location, and ‘weight’ provides the weight that a given near-neighbor site contributes to the coordination number (1 or smaller), ‘site_index’ gives index of the corresponding site in the original structure.

Return type

siw (list of dicts)

class MinimumDistanceNNAll(cutoff: float = 4.0)[source]

Bases: pymatgen.analysis.local_env.MinimumDistanceNN

Determine bonded sites by fixed cutoff

Args:.
cutoff (float): cutoff radius in Angstrom to look for trial

near-neighbor sites (default: 4.0).

Args: tol (float): tolerance parameter for neighbor identification

(default: 0.1).

cutoff (float): cutoff radius in Angstrom to look for trial

near-neighbor sites (default: 10.0).

get_all_sites (boolean): If this is set to True then the neighbor

sites are only determined by the cutoff radius, tol is ignored

get_all_nn_info_old(structure: pymatgen.core.structure.Structure) → List[Dict][source]
get_nn_info(structure: pymatgen.core.structure.Structure, n: int) → Dict[source]

Get all near-neighbor sites as well as the associated image locations and weights of the site with index n using the closest neighbor distance-based method.

Parameters
  • structure (Structure) – input structure.

  • n (integer) – index of site for which to determine near neighbors.

Returns

tuples, each one

of which represents a neighbor site, its image location, and its weight.

Return type

siw (list of tuples (Site, array, float))

deserialize(config: Dict)[source]

Deserialize the config dict to object :param config: (dict) nn_strategy config dict from seralize function

Returns: object

get(identifier: Union[str, pymatgen.analysis.local_env.NearNeighbors])[source]
serialize(identifier: Union[str, pymatgen.analysis.local_env.NearNeighbors])[source]

Serialize the local env objects to a dictionary :param identifier: (NearNeighbors object/str/None)

Returns: dictionary or None