Decomposes a 2-qubit unitary into 1-qubit ops and XX/YY/ZZ interactions.
cirq.kak_decomposition(
unitary_object: Union[np.ndarray, 'cirq.SupportsUnitary', 'cirq.Gate', 'cirq.Operation',
KakDecomposition],
*,
rtol: float = 1e-05,
atol: float = 1e-08,
check_preconditions: bool = True
) -> cirq.KakDecomposition
Args |
unitary_object
|
The value to decompose. Can either be a 4x4 unitary
matrix, or an object that has a 4x4 unitary matrix (via the
cirq.SupportsUnitary protocol).
|
rtol
|
Per-matrix-entry relative tolerance on equality.
|
atol
|
Per-matrix-entry absolute tolerance on equality.
|
check_preconditions
|
If set, verifies that the input corresponds to a
4x4 unitary before decomposing.
|
Returns |
A cirq.KakDecomposition canonicalized such that the interaction
coefficients x, y, z satisfy:
0 ≤ abs(z2) ≤ y2 ≤ x2 ≤ π/4
if x2 = π/4, z2 >= 0
|
Raises |
ValueError
|
Bad matrix.
|
ArithmeticError
|
Failed to perform the decomposition.
|