View source on GitHub |
Represents a unitary operation as an axis, angle, and global phase.
cirq.AxisAngleDecomposition(
*,
angle: float,
axis: Tuple[float, float, float],
global_phase: Union[int, float, complex]
)
The unitary \(U\) is decomposed as follows:
$$U = g e^{-i heta/2 (xX + yY + zZ)}$$
where heta is the rotation angle, (x, y, z) is a unit vector along the rotation axis, and g is the global phase.
Methods
canonicalize
canonicalize(
atol: float = 1e-08
) -> 'AxisAngleDecomposition'
Returns a standardized AxisAngleDecomposition with the same unitary.
Ensures the axis (x, y, z) satisfies x+y+z >= 0. Ensures the angle theta satisfies -pi + atol < theta <= pi + atol.
Args | |
---|---|
atol
|
Absolute tolerance for errors in the representation and the canonicalization. Determines how much larger a value needs to be than pi before it wraps into the negative range (so that approximation errors less than the tolerance do not cause sign instabilities). |
Returns | |
---|---|
The canonicalized AxisAngleDecomposition. |
__eq__
__eq__(
other: _SupportsValueEquality
) -> bool
__ne__
__ne__(
other: _SupportsValueEquality
) -> bool