symmetric#

hypercoil.functional.matrix.symmetric(X: Tensor, skew: bool = False, axes: Tuple[int, int] = (-2, -1)) Tensor[source]#

Impose symmetry on a tensor block.

The input tensor block is averaged with its transpose across the slice delineated by the specified axes.

Parameters:
XTensor

Input to be symmetrised.

skewbool (default False)

Indicates whether skew-symmetry (antisymmetry) should be imposed on the input.

axestuple(int, int) (default (-2, -1))

Axes that delineate the square slices of the input on which symmetry is imposed. By default, symmetry is imposed on the last 2 slices.

Returns:
outputTensor

Input with symmetry imposed across specified slices.