Group Operations¶
Decoupling groups and group operations.
- class gadd.group_operations.DecouplingGroup(elements: Dict[str, int], names: Dict[int, str], multiplication: List[List[int]], inverse_map: Dict[int, int] | None)[source]
Bases:
object
Mathematical structure defining a decoupling group for DD sequences.
This class represents the algebraic structure used in the GADD paper for constructing dynamical decoupling sequences. It encodes the group elements, their names, multiplication table, and inverse relationships according to the Pauli group algebra extended with phase information.
The default group used in the paper is G = {Ip, Im, Xp, Xm, Yp, Ym, Zp, Zm} where the subscripts p/m indicate positive/negative phase rotations on the Bloch sphere. This encoding allows for systematic exploration of DD sequences that maintain the group constraint of multiplying to the identity element.
- multiplication
2D list encoding the group multiplication table where multiplication[i][j] gives the result of multiplying element i with element j.
- Type:
List[List[int]]
Example
>>> group = DEFAULT_GROUP >>> multiply("Xp", "Yp", group) # Returns index for result >>> group.element_name(2) # Returns "Xp"
- property size: int
Size of the group.
- gadd.group_operations.multiply(p1: int | str, p2: int | str, group: DecouplingGroup | None = None) int [source]
Multiply two group elements.
- Parameters:
p1 – First element (index or name).
p2 – Second element (index or name).
group – Optional custom group structure. Defaults to the G = {Ip, Im, Xp, Xm, Yp, Ym, Zp, Zm} used in the paper.
- Returns:
Index of the resulting element.
- gadd.group_operations.invert(a: int | str, group: DecouplingGroup | None = None) int [source]
Find the inverse of a group element.
- Parameters:
a – Element to invert (index or name).
group – Optional custom group structure. Defaults to the G = {Ip, Im, Xp, Xm, Yp, Ym, Zp, Zm} used in the paper.
- Returns:
Index of the inverse element.
- gadd.group_operations.complete_sequence_to_identity(partial_sequence: List[int | str], group: DecouplingGroup | None = None) int [source]
Find the element needed to complete a sequence to multiply to identity.
- Parameters:
partial_sequence – Incomplete sequence of group elements.
group – Optional custom group structure.
- Returns:
Index of element needed to complete sequence to identity.