cirq.single_qubit_op_to_framed_phase_form

Decomposes a 2x2 unitary M into U^-1 * diag(1, r) * U * diag(g, g).

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.

mat The qubit operation as a 2x2 unitary matrix.

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.