neuralqx.utils.symmetries.types.automorphism module

class Automorphism(vertex_map, edge_map_canon, domain, name='auto')

Bases: Symmetry

Vertex automorphism with induced edge mapping on canonical edges.

An automorphism consists of:

  • a vertex relabeling map vertex_map, and

  • an induced edge map edge_map_canon on canonical edges (optionally including permutations of parallel-edge keys within unordered vertex pairs).

When queried with an oriented edge, the edge is canonicalized, mapped via edge_map_canon, and then oriented to match the query edge’s orientation. Iteration yields pairs in the order and orientation of the user-provided domain.

Parameters:
  • vertex_map (Dict[int, int]) – Mapping from source vertices to target vertices.

  • edge_map_canon (Dict[Tuple[int, int, int], Tuple[int, int, int]]) – Mapping from canonical edges to canonical edges induced by vertex_map (and possible within-pair key permutations).

  • domain (List[Tuple[int, int, int]]) – Oriented edges supplied by the user; used for iteration/printing.

  • name (str) – Optional name for the automorphism. Defaults to "auto".

name: str = 'auto'

Default name for an automorphism.

map_vertex(v)

Map a vertex under the automorphism.

Parameters:

v (int) – Source vertex id.

Return type:

int

Returns:

Image vertex id vertex_map[v].

Raises:

KeyError – If v is not present in vertex_map.