The efficient evaluation of tensor expressions involving sums over multiple
indices is of significant importance to many fields of research, including
quantum many-body physics, loop quantum gravity, and quantum chemistry. The
computational cost of evaluating an expression may depend strongly upon the
order in which the index sums are evaluated, and determination of the
operation-minimising contraction sequence for a single tensor network (single
term, in quantum chemistry) is known to be NP-hard. The current preferred
solution is an exhaustive search, using either an iterative depth-first
approach with pruning or dynamic programming and memoisation, but these
approaches are impractical for many of the larger tensor network Ansaetze
encountered in quantum many-body physics. We present a modified search
algorithm with enhanced pruning which exhibits a performance increase of
several orders of magnitude while still guaranteeing identification of an
optimal operation-minimising contraction sequence for a single tensor network.
A reference implementation for MATLAB, compatible with the ncon() and
multienv() network contractors of arXiv:1402.0939 and arXiv:1310.8023
respectively, is supplied.Comment: 25 pages, 12 figs, 2 tables, includes reference implementation of
algorithm, v2.01. Update corrects the display of contraction sequences
involving single-tensor traces (i.e. where an index in the input appears
twice on the same tensor