pdft.bases.cp_phases

Contents

pdft.bases.cp_phases#

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

The angle of every controlled-phase gate, in stored order: the phase-only parameters.

A compact controlled-phase tensor is [[1, 1], [1, exp(i*phi)]]; this reads phi off each one. with_cp_phases is the way back. Together they are the view a phase-only model trains through: the angles are ordinary real parameters, the basis and its circuit stay what they are.

The view is exact for tensors of that form, which is what every basis starts with and what with_cp_phases writes. The package’s Riemannian trainers move all four entries of such a tensor around the unit circle (the phase manifold is U(1)^4); on a basis trained that way this reads one of the four phases, and writing it back resets the other three. cp_diagonals is the view of all four.

Return type:

Array