Expand description
Methods to produce a ContractionOrder
, specifying what order in which to perform pairwise contractions between tensors
in order to perform the full contraction.
Structs§
- Operand
NumPair - Which two tensors to contract
- Pair
- A single pairwise contraction between two input operands, an input operand and an intermediate result, or two intermediate results.
Enums§
- Contraction
Order - The order in which to contract pairs of tensors and the specific contractions to be performed between the pairs.
- Operand
Number - Either an input operand or an intermediate result
- Optimization
Method - Strategy for optimizing the contraction. The only currently supported options are “Naive” and “Reverse”.
Functions§
- generate_
optimized_ order - Given a
SizedContraction
and an optimization strategy, returns an order in which to perform pairwise contractions in order to produce the final result - generate_
path 🔒 - Generate the actual path consisting of all the mini-contractions. Currently always contracts two input operands and then repeatedly uses the result as the LHS of the next pairwise contraction.
- generate_
permuted_ 🔒contraction - Returns a permuted version of
sized_contraction
, specified bytensor_order
- generate_
sized_ 🔒contraction_ pair - Generates a mini-contraction corresponding to
lhs_operand_indices
,rhs_operand_indices
->output_indices
- get_
existing_ 🔒indices - Returns a set of all the indices in the LHS or the RHS
- get_
remaining_ 🔒indices - Returns a set of all the indices in any of the remaining operands or in the output
- naive_
order 🔒 - Contracts the first two operands, then contracts the result with the third operand, etc.
- reverse_
order 🔒 - Contracts the last two operands, then contracts the result with the third-to-last operand, etc.