jet.contract_tensors

contract_tensors(*args, **kwargs)

Overloaded function.

  1. contract_tensors(A: jet.bindings.TensorC64, B: jet.bindings.TensorC64) -> jet.bindings.TensorC64

Contracts two tensor objects over the intersection of their index sets. The resulting tensor will be formed with indices given by the symmetric difference of the index sets.

Parameters
  • A (Tensor) – Tensor on the LHS of the contraction.

  • B (Tensor) – Tensor on the RHS of the contraction.

Returns

Contraction of the tensors.

Return type

Tensor

Example

Given a 3x2x4 tensor \(A(i,j,k)\) and a 2x4x2 tensor \(B(j,k,l)\), the common indices are \(\{j,k\}\) and the symmetric difference of the sets is \(\{i,l\}\). The result of the contraction will be a tensor 3x2 tensor \(C(i,l)\).

  1. contract_tensors(A: jet.bindings.TensorC128, B: jet.bindings.TensorC128) -> jet.bindings.TensorC128

Contracts two tensor objects over the intersection of their index sets. The resulting tensor will be formed with indices given by the symmetric difference of the index sets.

Parameters
  • A (Tensor) – Tensor on the LHS of the contraction.

  • B (Tensor) – Tensor on the RHS of the contraction.

Returns

Contraction of the tensors.

Return type

Tensor

Example

Given a 3x2x4 tensor \(A(i,j,k)\) and a 2x4x2 tensor \(B(j,k,l)\), the common indices are \(\{j,k\}\) and the symmetric difference of the sets is \(\{i,l\}\). The result of the contraction will be a tensor 3x2 tensor \(C(i,l)\).