Returns . The space parameter should be either a bipartite qubit ket space or operator space.
Decomposes a bipartite qubit unitary into the form where . Five values are returned from this function: (UA, UB, VA, VB, alpha).
>>> from qitensor import qubit
>>> from qitensor.experimental.cartan_decompose import unitary_to_cartan
>>> from qitensor.experimental.cartan_decompose import unitary_from_cartan
>>> ha = qubit('a')
>>> hb = qubit('b')
>>> U = (ha*hb).O.random_unitary()
>>> (UA, UB, VA, VB, alpha) = unitary_to_cartan(U)
>>> Ud = unitary_from_cartan(ha*hb, alpha)
>>> # experimental module doesn't always work, so skip doctest
>>> (UA * UB * Ud * VA * VB - U).norm() < 1e-12
True