cirq.single_qubit_op_to_framed_phase_form
Decomposes a 2x2 unitary M into U^-1 * diag(1, r) * U * diag(g, g).
cirq.single_qubit_op_to_framed_phase_form(
mat: np.ndarray
) -> Tuple[np.ndarray, complex, complex]
U translates the rotation axis of M to the Z axis.
g fixes a global phase factor difference caused by the translation.
r's phase is the amount of rotation around M's rotation axis.
This decomposition can be used to decompose controlled single-qubit
rotations into controlled-Z operations bordered by single-qubit operations.
Args |
mat
|
The qubit operation as a 2x2 unitary matrix.
|
Returns |
A 2x2 unitary U, the complex relative phase factor r, and the complex
global phase factor g. Applying M is equivalent (up to global phase) to
applying U, rotating around the Z axis to apply r, then un-applying U.
When M is controlled, the control must be rotated around the Z axis to
apply g.
|
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 2025-04-15 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 2025-04-15 UTC."],[],[]]