flatten_for_tensor_contraction#

Flatten a (composite) bloq as much as possible to enable efficient tensor contraction.

bloq

The bloq to flatten.

full_flatten

Whether to completely flatten the bloq into the smallest possible bloqs. Otherwise, stop flattening if custom tensors are encountered.