pdft.manifolds.classify_manifold

pdft.manifolds.classify_manifold#

pdft.manifolds.classify_manifold(t)[source]#

Return the manifold appropriate to t based on its shape and unitarity.

  • rank-2 unitary (d × d) → UnitaryManifold(d=d)

  • (2, 2, 2, 2) tensor whose 4×4 reshape is unitary → Unitary2qManifold

  • otherwise → PhaseManifold

Note: OrthogonalManifold and Orthogonal2qManifold are defined in this module for callers that want an explicit O(d) constraint, but nothing selects them: not this function, and no basis or trainer in the package. A basis whose tensors are all exactly real stays real through UnitaryManifold under a real objective (the Cayley retraction with a real W preserves it), which is how RealRichBasis trains. One complex tensor in the circuit is enough to make the others complex.

Parameters:

t (Array)

Return type:

AbstractRiemannianManifold