pdft.manifolds.is_unitary_2qubit

pdft.manifolds.is_unitary_2qubit#

pdft.manifolds.is_unitary_2qubit(t, atol=1e-06)[source]#

True for a (2, 2, 2, 2) tensor whose 4x4 reshape is unitary.

The (2, 2, 2, 2) layout is the canonical storage of a 2-qubit gate (axes: out_ctrl, out_tgt, in_ctrl, in_tgt). We reshape to 4x4 and apply the standard unitarity check.

Parameters:
Return type:

bool