pdft.bases.cp_diagonals

Contents

pdft.bases.cp_diagonals#

pdft.bases.cp_diagonals(basis)[source]#

The four phases of every controlled-phase tensor, in stored order: shape (gates, 2, 2).

The tensor of a controlled-phase gate holds the diagonal of a two-qubit gate. Freeing all four of its entries on the unit circle keeps the gate diagonal, and with it the flat modulus of the basis; this reads their angles, and with_cp_diagonals is the way back. Unlike cp_phases the view is exact for every tensor with unit-modulus entries, so it also round-trips a basis the Riemannian trainers have moved.

Return type:

Array