pymatgen.analysis.chemenv.connectivity.structure_connectivity module

Structure connectivity class.

class StructureConnectivity(light_structure_environment, connectivity_graph=None, environment_subgraphs=None)[source]

Bases: MSONable

Main class containing the connectivity of a structure.

Constructor for the StructureConnectivity object.

Parameters:
  • light_structure_environment – a LightStructureEnvironments object containing the relevant local environments for the sites in the structure.

  • connectivity_graph – the networkx MultiGraph if it has already been computed, e.g. stored in a file or dict and StructureConnectivity is reconstructed from that file or dict.

  • environment_subgraphs – the different subgraphs of environments that have been computed if any (as for connectivity_graph, only if it is reconstructed from a file or dict).

add_bonds(isite, site_neighbors_set)[source]

Add the bonds for a given site index to the structure connectivity graph.

Parameters:
  • isite – Index of the site for which the bonds have to be added.

  • site_neighbors_set – site_neighbors_set: Neighbors set of the site

add_sites()[source]

Add the sites in the structure connectivity graph.

as_dict()[source]

Returns:

environment_subgraph(environments_symbols=None, only_atoms=None)[source]
Parameters:
  • () (only_atoms) –

  • ()

Returns:

classmethod from_dict(d)[source]
Parameters:

() (d) –

Returns:

get_connected_components(environments_symbols=None, only_atoms=None)[source]
Parameters:
  • () (only_atoms) –

  • ()

Returns:

Returns:

setup_atom_environment_subgraph(atom_environment)[source]
Parameters:

() (atom_environment) –

Returns:

setup_atom_environments_subgraph(atoms_environments)[source]
Parameters:

() (atoms_environments) –

Returns:

setup_connectivity_description()[source]

Returns:

setup_environment_subgraph(environments_symbols, only_atoms=None)[source]

Set up the graph for predefined environments and optionally atoms.

Parameters:
  • environments_symbols – Symbols of the environments for the environment subgraph.

  • only_atoms – Atoms to be considered.

setup_environments_subgraph(environments_symbols)[source]
Parameters:

() (environments_symbols) –

Returns:

get_delta_image(isite1, isite2, data1, data2)[source]

Helper method to get the delta image between one environment and another from the ligand’s delta images.