Expand description
Contains functions and structs related to parsing an einsum-formatted string
This module has the implementation of Contraction and SizedContraction. SizedContraction
is used throughout the library to store the details of a full contraction (corresponding
to a string supplied by the caller) or a mini-contraction (corresponding to a simplification of
a single tensor or a pairwise contraction between two tensors) produced by the optimizer in order
to perform the full contraction.
Structsยง
- Contraction
- A
Contractioncontains the result of parsing aneinsum-formatted string. - Einsum
Parse ๐ - The result of running an
einsum-formatted string through the regex. - Sized
Contraction - A
SizedContractioncontains aContractionas well as aHashMap<char, usize>specifying the axis lengths for each index in the contraction.
Traitsยง
- Output
Size ๐Methods - Enables
OutputSize::from_contraction_and_shapes()
Functionsยง
- get_
operand_ ๐shapes - Returns a vector holding one
Vec<usize>for each operand. - parse_
einsum_ ๐string - Runs an input string through a regex and convert it to an EinsumParse.
- validate
- Wrapper around Contraction::new().
- validate_
and_ optimize_ order - Create a SizedContraction and then optimize the order in which pairs of inputs will be contracted.
- validate_
and_ size - Wrapper around SizedContraction::new().
Type Aliasesยง
- Output
Size - Alias for
HashMap<char, usize>. Contains the axis lengths for all indices in the contraction. Contrary to the name, does not only hold the sizes for output indices.