pdft.bases.tensors_view#
- pdft.bases.tensors_view = ParameterView(name='tensors')#
What a trainer moves in place of a basis’s tensors.
read(basis)gives the parameters as a list of arrays,write(basis, params)a copy of the basis that holds them, andmanifolds(params)the manifold each one lives on, orNoneto have it read off their values asclassify_manifolddoes.writeis traceable, so a loss differentiates through it and the parameters are trained like any others: the basis and its circuit stay what they are, and whatever the view does not read is not trained.The package’s views:
tensors_view, the tensors themselves, each on the manifold its values put it on (what the trainers move when no view is named);cp_phases_view, one angle per controlled-phase gate (cp_phases);cp_diagonals_view, all four phases of every controlled-phase tensor (cp_diagonals). The last two are free real numbers onEuclideanManifold, read in double precision whatever the precision of the tensors, and written back in the tensors’ own.