- TrainSum.einsum(eq, *ops, result_shape=None)
Perform an einsum operation. The resulting tensor train will always be as exact as possible (in the sense of the least indices are contracted together) unless a result shape is provided. In that case, the resulting tensor train will be decomposed to fit the provided shape. Disconnected einsum graphs like ‘i,j->i,j’ are not allowed due to the ambiguity of the resulting shape. For this type of operation either use the extend method of TensorTrain or explicitely formulate the expression ‘ij,i,j->ij’ with ij as tensor train that only has ones. Affected by einsum context manager.
- Parameters:
eq (str)
ops (TensorTrain)
result_shape (None | TrainShape)
- Return type:
float | complex | TensorTrain