einsum

einsum(subscripts: str, *operands: PolyArray | ndarray) Poly | PolyArray[Dim]

Einstein summation for polynomial arrays and NumPy arrays.

Compute the expression defined by subscripts using PolyArray and/or NumPy operands, similar to numpy.einsum.

Parameters:
  • subscripts (str) – Subscript notation. For example, 'ij,jk->ik' for matrix multiplication or 'i,i->' for dot product.

  • *operands (PolyArray | ndarray) – Operands (PolyArray or numpy.ndarray).

Returns:

Computed result for subscripts.

Return type:

Poly | PolyArray[Dim]

Raises:

TypeError – If no operand is provided or an operand type is invalid.