opt\_einsum - A Python package for optimizing contraction order for einsum-like expressions

Daniel G. A. Smith, Johnnie Gray · The Journal of Open Source Software · 2018

einsum is a powerful Swiss army knife for arbitrary tensor contractions and general linear algebra found in the popular numpy (Walt, Colbert, and Varoquaux 2011) package.While these expressions can be used to form most mathematical operations found in NumPy, the optimization of these expressions becomes increasingly important as naive implementations increase the overall scaling of these expressions resulting in a dramatic increase in overall execution time.Expressions with many tensors are particularly prevalent in many-body theories such as quantum chemistry, particle physics, and nuclear physics in addition to other fields such as machine learning.At the extreme case, matrix product state theory can have thousands of tensors meaning that the computation cannot procede in a naive fashion.

Read the paper · More papers on PaperTik