tqec.templates.subtemplates.get_spatially_distinct_subtemplates

get_spatially_distinct_subtemplates(instantiation: ndarray[Any, dtype[int64]], manhattan_radius: int = 1, avoid_zero_plaquettes: bool = True) UniqueSubTemplates[source]

Returns a representation of all the distinct sub-templates of the provided manhattan radius.

Note

This method will likely be inefficient for large templates (i.e., large values of k) or for large Manhattan radiuses, both in terms of memory used and computation time. Subclasses are invited to reimplement that method using a specialized algorithm (or hard-coded values) to speed things up.

Parameters:
  • instantiation – a 2-dimensional array representing the instantiated template on which sub-templates should be computed.

  • manhattan_radius – radius of the considered ball using the Manhattan distance. Only squares with sides of 2*manhattan_radius+1 plaquettes will be considered.

  • avoid_zero_plaquettesTrue if sub-templates with an empty plaquette (i.e., 0 value in the instantiation of the Template instance) at its center should be ignored. Default to True.

Returns:

a representation of all the sub-templates found.