tensor_data_from_unitary_and_signature#

Returns tensor data respecting signature corresponding to unitary

For a given input unitary, we extract the action of the unitary on a subspace where input qubits corresponding to LEFT registers and output qubits corresponding to RIGHT registers in signature are 0.

The input unitary is assumed to act on _n_qubits(signature), and thus is of shape (2 ** _n_qubits(signature), 2 ** _n_qubits(signature)) where _n_qubits(signature) is sum(reg.total_bits() for reg in signature).

The shape of the returned tensor matches tensor_shape_from_signature(signature).