neuralqx.utils.symmetries.types.symmetry module

class Symmetry

Bases: object

Minimal base class for symmetries that map edges to edges.

Subclasses are expected to implement __getitem__(edge) -> edge (typically by looking up the canonical form of the queried edge and then re-orienting the result to match the query). This base class provides a uniform map_edge(edge) -> edge API for users that prefer an explicit method call, and also makes instances callable via __call__.

Returns:

Instances of subclasses map an input edge to its image edge under the symmetry.

map_edge(e)

Map an edge under this symmetry.

By default, this delegates to self[e] and therefore requires subclasses to implement __getitem__. Subclasses may override this method directly if they do not use __getitem__-based access.

Parameters:

e (Tuple[int, int, int]) – Edge to map.

Return type:

Tuple[int, int, int]

Returns:

The mapped edge.

Raises:

TypeError – If the subclass does not implement __getitem__ and does not override map_edge.