cirq.kak_decomposition
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]