canonical_gate
CanonicalAxis
Bases: BaseAxis
Source code in opensquirrel/ir/semantics/canonical_gate.py
parse(axis)
staticmethod
Parse and validate an AxisLike
.
Check if the axis
can be cast to a 1DArray of length 3, raise an error otherwise.
After casting to an array, the elements of the canonical axis are restricted to the Weyl chamber.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
axis
|
AxisLike
|
|
required |
Returns:
Type | Description |
---|---|
NDArray[float64]
|
Parsed axis represented as a 1DArray of length 3. |
Source code in opensquirrel/ir/semantics/canonical_gate.py
restrict_to_weyl_chamber(axis)
staticmethod
Restrict the given axis to the Weyl chamber. The six rules that are (implicitly) used are: 1. The canonical parameters are periodic with a period of 2 (neglecting a global phase). 2. Can(tx, ty, tz) ~ Can(tx - 1, ty, tz) (for any parameter) 3. Can(tx, ty, tz) ~ Can(tx, -ty, -tz) (for any pair of parameters) 4. Can(tx, ty, tz) ~ Can(ty, tx, tz) (for any pair of parameters) 5. Can(tx, ty, 0) ~ Can(1 - tx, ty, 0) 6. Can(tx, ty, tz) x Can(tx', ty', tz') = Can(tx + tx', ty + ty', tz + tz') (here x represents matrix multiplication)
Based on the rules described in Chapter 5 of https://threeplusone.com/pubs/on_gates.pdf