DecompositionOptions

class trainsum.options.DecompositionOptions(*, namespace, decomposition, strategy, optimizer='greedy', direction=Direction.TO_RIGHT)

Context manager for decomposition based einsum options. The decomposition and strategy are used to determine the ranks and the approximation of the einsum result.

Parameters:
  • namespace (ArrayNamespace)

  • decomposition (T)

  • strategy (SweepingStrategy)

  • optimizer (Literal['optimal', 'dp', 'greedy', 'random-greedy', 'random-greedy-128', 'branch-all', 'branch-2', 'auto', 'auto-hq'])

  • direction (Direction)

decomposition: T

Decomposition method for determining the approximation of the einsum result.

strategy: SweepingStrategy

Sweeping strategy for determining the path of the algorithm.

optimizer: Literal['optimal', 'dp', 'greedy', 'random-greedy', 'random-greedy-128', 'branch-all', 'branch-2', 'auto', 'auto-hq']

Optimizer for the local einsum contraction paths.

direction: Direction

Direction for the contraction