topo_metrics.symbols#
Classes#
Vertex Symbol (VS) representation. |
|
Cummulative All-Rings Vertex Symbol (CARVS) vector. |
Functions#
|
Pad the vectors of a list of CARVS objects to the same length. |
|
Pad the CARVs per atom to the same length. |
|
Compute the topological distances between all pairs of CARVS objects. |
Module Contents#
- class topo_metrics.symbols.VertexSymbol[source]#
Bases:
NamedTupleVertex Symbol (VS) representation.
- to_str(all_rings: bool = False) str[source]#
Returns the string representation of the VertexSymbol.
If all_rings is True, ring counts are grouped and formatted with multiplicity. Otherwise, only the smallest ring sizes are shown, with multiplicity for repeated values.
- Parameters:
all_rings – If True, ring counts are grouped and formatted with multiplicity. Otherwise, only the smallest ring sizes are shown, with multiplicity for repeated values.
- Return type:
A string representation of the VertexSymbol.
- class topo_metrics.symbols.CARVS[source]#
Bases:
NamedTupleCummulative All-Rings Vertex Symbol (CARVS) vector.
- classmethod from_list(carvs_list: Sequence[CARVS]) CARVS[source]#
Construct a CARVS object from a list of CARVS objects, averaging the vectors and spreads.
- Parameters:
carvs_list – One or more CARVS objects to be averaged.
- Returns:
A new CARVS object whose vector is the average of all input vectors,
whose spread is the average of all input spreads, and whose
’is_single_node’ is True only if it is True for every entry in
carvs_list.
- Raises:
ValueError – If carvs_list is empty or if the vectors in carvs_list do not all have the same length.
- topo_metrics.symbols.pad_carvs(carvs_list: Sequence[CARVS]) Sequence[CARVS][source]#
Pad the vectors of a list of CARVS objects to the same length.
- Parameters:
carvs_list – A list of CARVS objects.
- Return type:
A list of CARVS objects with the vectors padded to the same length.
- topo_metrics.symbols.pad_carvs_per_atom(all_carvs: list[numpy.typing.NDArray[numpy.int_]]) list[numpy.typing.NDArray[numpy.int_]][source]#
Pad the CARVs per atom to the same length.
- Parameters:
all_carvs – List of CARVs per atom.
- Return type:
List of padded CARVs per atom.
- topo_metrics.symbols.get_all_topological_distances(carvs: list[CARVS]) numpy.ndarray[source]#
Compute the topological distances between all pairs of CARVS objects.
- Parameters:
carvs – A list of CARVS objects.
- Returns:
A square matrix of shape (n_points, n_points) containing the Euclidean
distances between all pairs of points.