Manifolds#
The manifold geometry used by the optimizers: projections, retractions and batched linear algebra over stacked gate tensors.
Riemannian manifold abstraction with batched (d, d, n) operations.
Mirror of upstream src/manifolds.jl. Device-agnostic: works on CPU and GPU
via JAX; no similar, copyto!, or mutable updates — pure functional.
Contents
Interface the optimizers need from a manifold: |
|
U(d) unitary group manifold; tensors are d × d unitary matrices. |
|
U(1)^d: each element is a unit complex number. |
|
O(d) for real-valued d×d unitaries (subset of UnitaryManifold). |
|
U(4) manifold for 2-qubit gates stored in (2, 2, 2, 2) tensor form. |
|
O(4) for real-valued 2-qubit gates stored as (2, 2, 2, 2). |
|
Return the manifold appropriate to |
|
|
|
Pack selected matrices into a |
|
Unpack a |
|
|
|
|
|
Batched matrix inverse via a transpose-and-invert trick. |
|
True for a (2, 2, 2, 2) tensor whose 4x4 reshape is unitary. |
|
True if |