Module singleton_contractors

Module singleton_contractors 

Source
Expand description

Contains the specific implementations of SingletonContractor and SingletonViewer that represent the base-case ways to contract or simplify a single tensor.

All the structs here perform perform some combination of permutation of the input axes (e.g. ijk->jki), diagonalization across repeated but un-summed axes (e.g. ii->i), and summation across axes not present in the output index list (e.g. ijk->j).

Structs§

Diagonalization
Returns the elements of the input tensor where all instances of the repeated indices are equal to one another. Optionally permutes the axes of the tensor as well.
DiagonalizationAndSummation
Returns the elements of the input tensor where all instances of the repeated indices are equal to one another, optionally permuting the axes, and sums across indices that don’t appear in the output.
Identity
Returns a view or clone of the input tensor.
Permutation
Permutes the axes of the input tensor and returns a view or clones the elements.
PermutationAndSummation
Permutes the elements of the input tensor and sums across elements that don’t appear in the output.
Summation
Sums across the elements of the input tensor that don’t appear in the output tensor.