pyUni10.contract

pyUni10.contract(Ta, Tb, fast=False)
Contract out the bonds with common labels in UniTensors Ta and Tb. Ta and Tb are not copied and are permuted in-place, thus the process uses less memory than (Ta * Tb).
Parameters:
  • Ta (UniTensor) – a UniTensor
  • Tb (UniTensor) – a UniTensor
  • fast (bool) – if fast set to True, the tensors Ta and Tb will not be permuted back to the origin labels after contraction.
Returns:

a new UniTensor with remaining bonds

Return type:

UniTensor