[][src]Module ndarray_einsum_beta::optimizers

Methods to produce a ContractionOrder, specifying what order in which to perform pairwise contractions between tensors in order to perform the full contraction.

Structs

OperandNumPair

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

ContractionOrder

The order in which to contract pairs of tensors and the specific contractions to be performed between the pairs.

OperandNumber

Either an input operand or an intermediate result

OptimizationMethod

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 by tensor_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.