cirq.three_qubit_matrix_to_operations
Returns operations for a 3 qubit unitary.
cirq.three_qubit_matrix_to_operations(
q0: cirq.Qid
,
q1: cirq.Qid
,
q2: cirq.Qid
,
u: np.ndarray,
atol: float = 1e-08
) -> Sequence[cirq.Operation
]
The algorithm is described in Shende et al.:
Synthesis of Quantum Logic Circuits. Tech. rep. 2006,
https://arxiv.org/abs/quant-ph/0406176
Args |
q0
|
first qubit
|
q1
|
second qubit
|
q2
|
third qubit
|
u
|
unitary matrix
|
atol
|
A limit on the amount of absolute error introduced by the
construction.
|
Returns |
The resulting operations will have only known two-qubit and one-qubit
gates based operations, namely CZ, CNOT and rx, ry, PhasedXPow gates.
|
Raises |
ValueError
|
If the u matrix is non-unitary or not of shape (8,8).
|
ImportError
|
If the decomposition cannot be done because the SciPy version is less than
1.5.0 and so does not contain the required cossin method.
|
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."],[],[]]