Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

The Journal of Physical Chemistry A

Tensor Contraction Engine: Abstraction and Automated Parallel Implementation of Configuration-Interaction, Coupled-Cluster, and Many-Body Perturbation Theories

So Hirata

Published Oct 28, 2003• 387 citations
Publisher

Abstract

We have developed a symbolic manipulation program and program generator (tensor contraction engine or TCE) that abstracts and automates the time-consuming, error-prone processes of deriving the working equations of a well-defined model of second-quantized many-electron theories and synthesizing efficient parallel computer programs on the basis of these equations. Provided an ansatz of a many-electron theory model, TCE performs valid contractions of creation and annihilation operators according to Wick's theorem, consolidates identical terms, and reduces the expressions into the form of multiple tensor contractions acted upon by permutation operators. It subsequently determines the binary contraction order for each multiple tensor contraction with the minimal operation and memory cost, factorizes common binary contractions (defines intermediate tensors), and identifies reusable intermediates. The resulting ordered list of binary tensor contractions, additions, and index permutations is translated into an optimized program that is combined with the NWCHEM and UTCHEM computational chemistry software packages. The programs synthesized by TCE take advantage of spin symmetry (within the spin−orbital formalisms), real Abelian point-group symmetry, and index permutation symmetry at every stage of the calculations to minimize the number of arithmetic operations and storage requirement, adjust the peak local memory usage by index-range tiling, and support parallel I/O interfaces and dynamic load balancing for parallel executions. We demonstrate the utility of TCE through automatic derivation and implementation of parallel programs for a range of predictive computational methods configuration-interaction theory (CISD, CISDT, CISDTQ), generalized many-body perturbation theory [MBPT(2), MBPT(3), MBPT(4)], and coupled-cluster theory (LCCD, CCD, LCCSD, CCSD, QCISD, CCSDT, and CCSDTQ), some for the first time and discuss the performance of the implemented programs.

DOI
10.1021/jp034596z

Related papers

A Non-antisymmetric Tensor Contraction Engine for the Automated Implementation of Spin-Adapted Coupled Cluster Approaches

Dipayan Datta, Jürgen Gauß

We present a symbolic manipulation algorithm for the efficient automated implementation of rigorously spin-free coupled cluster (CC) theories based on a unitary group parametrization. Due to the lack of antisymmetry of the unitary group generators under index permutations, all quantities involved in the equations are expressed in terms of non-antisymmetric tensors. Given two tensors, all possible contractions are first generated by applying Wick's theorem. Each term is then put down in the form of a non-antisymmetric Goldstone diagram by assigning its contraction topology. The subsequent simplification of the equations by summing up equivalent terms and their factorization by identifying common intermediates is performed via comparison of these contraction topologies. The definition of the contraction topology is completely general for non-antisymmetric Goldstone diagrams, which enables our algorithm to deal with noncommuting excitations in the cluster operator that arises in the unitary group based CC formulation for open-shell systems. The resulting equations are implemented in a new code, in which tensor contractions are performed by successive application of matrix-matrix multiplications. Implementation of the unitary group adapted CC equations for closed-shell systems and for the simplest open-shell case, i.e., doublets, is discussed, and representative calculations are presented in order to assess the efficiency of the generated codes.

Journal of Chemical Theory and Computation•Apr 29, 2013•20 citations

Automatic code generation for many-body electronic structure methods: the tensor contraction engine‡‡

Alexander A. Auer, Gerald Baumgartner, David E. Bernholdt +14 more

As both electronic structure methods and the computers on which they are run become increasingly complex, the task of producing robust, reliable, high-performance implementations of methods at a rapid pace becomes increasingly daunting. In this paper we present an overview of the Tensor Contraction Engine (TCE), a unique effort to address issues of both productivity and performance through automatic code generation. The TCE is designed to take equations for many-body methods in a convenient high-level form and acts like an optimizing compiler, producing an implementation tuned to the target computer system and even to the specific chemical problem of interest. We provide examples to illustrate the TCE approach, including the ability to target different parallel programming models, and the effects of particular optimizations.

Molecular Physics•Jan 20, 2006•138 citations

Automated Implementation of Advanced Electronic Structure Methods

Bimal Gaudel

The continuous demand for higher accuracy in computational chemistry necessitates the development of advanced many-body electronic structure methods. However, the derivation and efficient implementation of these theories constitute a significant bottleneck. As the rank of the associated tensors increases, the governing equations explode in complexity, rendering manual implementation labor-intensive, error-prone, and difficult to optimize for modern hardware. To address this challenge, this dissertation presents SeQuant, a comprehensive framework for the automated derivation and parallel implementation of many-body quantum chemistry methods. Built upon a robust symbolic algebra engine, SeQuant allows for the expression of theories in the natural language of second quantization. It automates the transformation of high-level theoretical ansatzes into explicit tensor contraction expressions and subsequently generates optimized, high-performance C++ code. A central innovation of this work is the extension of automated implementation to reduced-scaling methods, which exploit the sparsity inherent in electronic correlation. We introduce a novel "tensor-of-tensors" data structure designed to manage the irregular sparsity patterns of Pair Natural Orbital (PNO) formulations. This development enables the first fully automated implementation of PNO-Coupled Cluster (PNO-CC) methods, bridging the gap between symbolic abstraction and the runtime requirements of sparse tensor algebra. The results demonstrate that SeQuant not only reproduces established dense methods (such as CCSD and CCSDT) with high fidelity but also effectively handles the complexity of sparse, local correlation approaches. By decoupling the complexity of the physics from the details of the implementation, this framework establishes a new paradigm for method development, dramatically accelerating the translation of theoretical insights into computational reality.

•Feb 4, 2026•0 citations

Automated Code Engine for Tensor HyperContraction: Derivation, Optimization and Implementation of Rank-reduced Coupled Cluster Theories

Zhao Yao

The ultimate goal of electronic structure theory is solving the electronic Schr¨odinger Equation. However, even accurate approximations of solving Schr¨odinger Equation, such as high order coupled cluster theories, require computational efforts that are too demanding to be applied on large chemical systems. This thesis tackles the problem of curse of dimensionality: how to reduce the time complexity of high-accuracy coupled cluster methods in order to accelerate computations of molecular energy. On one hand, we believe that low-rank approximation (i.e. Tensor HyperContraction) of high-order tensors appearing in coupled cluster theory is a promising way to achieve rank-reduced coupled cluster theory. On the other hand, we think that the work of deriving, optimizing and implementing low-rank approximated coupled cluster theory is both tedious and repetitious, and shall be performed by an automatic code engine other than chemists. In this thesis, we introduce our chemistry equation compiler, Autom: a code engine that is designed for automatically deriving, optimizing and implementing low-rank approximated coupled cluster theories. With Autom, the development of electronic theories is greatly simplified. Autom can easily generate runnable codes in minutes for tensor-algebra based chemistry equations with customized low-rank approximation rules; conventionally, such procedure may take an expert weeks or even months to manually program. This thesis roughly consists of two parts. In the first part, we aim to cover the lowrank approximation techniques for high-accuracy coupled cluster theories, emphasizing on two new factorization techniques we developed especially for several coupled cluster theories including triple contributions. In the second part, we demonstrate the algorithms of our automatic code engine. We also summarize recent advances of domain specific compilers in Machine Learning community and discuss future directions for compute graph optimization. We believe that this new software infrastructure holds great promise for future chemistry package designs.

•Jan 1, 2021•0 citations

An Efficient Implementation of Second Quantization-Based Many-Body Methods for Electrons and its Application to Coupled-Cluster with Arbitrary Excitation Level

Anna Engels-Putzka

This thesis deals with selected aspects of a new implementation of many-body methods which can be formulated in the framework of second quantization, in particular the coupled-cluster (CC) method with arbitrary excitation level. Coupled-cluster is one of the most successful and widely used quantum chemical methods for accurate calculations on small to medium-sized molecules. Since it employs a nonlinear parametrization of the wave function, its implementation is rather difficult, in particular if higher (i.e. more than double) excitations are to be included. The latter is necessary to obtain highly accurate results and also as a prerequisite for the generalization to multi-reference cases. The implementation described here has a twofold focus. One is on generality and flexibility regarding the method to be implemented, the other is on efficiency. To achieve flexibility, it is useful to have a machinery which automatically derives working equations for a given method. We realize this by applying techniques of second quantization. This work treats in particular the last step of this procedure, namely the simplification of the resulting equations by the identification of equivalent terms. The algorithm used here is based on the interpretation of algebraic terms as graphs. The derived CC equations then have to be solved iteratively. The efficiency of the program is mainly determined by the evaluation of the occurring expressions, which has to be done in each iteration step. The evaluation is split up in a sequence of tensor contractions. Their generic implementation is complicated by the particular structure of the involved tensors. We reduce each contraction to a sequence of matrix multiplications, which requires a previous data rearranging. But since matrix multiplication is the most efficient operation on modern computers, this additional effort pays off. Preliminary tests show that our program is at least as fast as the most efficient general coupled-cluster implementation so far, and the relation is expected to improve for calculations with larger basis sets where the matrix multiplication becomes the time-determining step. Finally, we give an outlook to possible further developments. In particular, the preparation of the equations before the actual evaluation (factorization) offers much potential for optimizations which we do not exploit at the moment, in contrast to the program with which we compare, which employs at least a partial optimization at this point.

•Jan 1, 2009•0 citations

Effective Utilization of Tensor Symmetry in Operation Optimization of Tensor Contraction Expressions

Pai-Wei Lai, Huaijian Zhang, Samyam Rajbhandari +3 more

The optimization of tensor expressions with hundreds of terms is required for the development of accurate quantum chemistry models such as the coupled cluster method. In this paper, we address the effective exploitation of symmetry properties of tensors in performing algebraic transformations for minimizing operation count of tensor expressions. We develop rules to detect symmetries in intermediate tensors, cost models for tensor contractions with symmetries, and a canonical representation to facilitate effective common subexpression elimination. We demonstrate significant improvements to the operation counts for the coupled cluster method when compared to several state-of-the-art im-plementations. Furthermore, we show that tensor expressions optimized for a few input parameter combinations can be used to achieve operation counts within 3% of the optimal, for the entire parameter space of interest.

Procedia Computer Science•Jan 1, 2012•14 citations
We have developed a symbolic manipulation program and program generator (tensor contraction engine or TCE) that abstracts and automates the time-consuming, error-prone processes of deriving the working equations of a well-defined model of second-quantized many-electron theories and synthesizing efficient parallel computer programs on the basis of these equations. Provided an ansatz of a many-electron theory model, TCE performs valid contractions of creation and annihilation operators according to Wick's theorem, consolidates identical terms, and reduces the expressions into the form of multiple tensor contractions acted upon by permutation operators. It subsequently determines the binary contraction order for each multiple tensor contraction with the minimal operation and memory cost, factorizes common binary contractions (defines intermediate tensors), and identifies reusable intermediates. The resulting ordered list of binary tensor contractions, additions, and index permutations is translated into an optimized program that is combined with the NWCHEM and UTCHEM computational chemistry software packages. The programs synthesized by TCE take advantage of spin symmetry (within the spin−orbital formalisms), real Abelian point-group symmetry, and index permutation symmetry at every stage of the calculations to minimize the number of arithmetic operations and storage requirement, adjust the peak local memory usage by index-range tiling, and support parallel I/O interfaces and dynamic load balancing for parallel executions. We demonstrate the utility of TCE through automatic derivation and implementation of parallel programs for a range of predictive computational methods configuration-interaction theory (CISD, CISDT, CISDTQ), generalized many-body perturbation theory [MBPT(2), MBPT(3), MBPT(4)], and coupled-cluster theory (LCCD, CCD, LCCSD, CCSD, QCISD, CCSDT, and CCSDTQ), some for the first time and discuss the performance of the implemented programs.
We present a symbolic manipulation algorithm for the efficient automated implementation of rigorously spin-free coupled cluster (CC) theories based on a unitary group parametrization. Due to the lack of antisymmetry of the unitary group generators under index permutations, all quantities involved in the equations are expressed in terms of non-antisymmetric tensors. Given two tensors, all possible contractions are first generated by applying Wick's theorem. Each term is then put down in the form of a non-antisymmetric Goldstone diagram by assigning its contraction topology. The subsequent simplification of the equations by summing up equivalent terms and their factorization by identifying common intermediates is performed via comparison of these contraction topologies. The definition of the contraction topology is completely general for non-antisymmetric Goldstone diagrams, which enables our algorithm to deal with noncommuting excitations in the cluster operator that arises in the unitary group based CC formulation for open-shell systems. The resulting equations are implemented in a new code, in which tensor contractions are performed by successive application of matrix-matrix multiplications. Implementation of the unitary group adapted CC equations for closed-shell systems and for the simplest open-shell case, i.e., doublets, is discussed, and representative calculations are presented in order to assess the efficiency of the generated codes.
As both electronic structure methods and the computers on which they are run become increasingly complex, the task of producing robust, reliable, high-performance implementations of methods at a rapid pace becomes increasingly daunting. In this paper we present an overview of the Tensor Contraction Engine (TCE), a unique effort to address issues of both productivity and performance through automatic code generation. The TCE is designed to take equations for many-body methods in a convenient high-level form and acts like an optimizing compiler, producing an implementation tuned to the target computer system and even to the specific chemical problem of interest. We provide examples to illustrate the TCE approach, including the ability to target different parallel programming models, and the effects of particular optimizations.
The continuous demand for higher accuracy in computational chemistry necessitates the development of advanced many-body electronic structure methods. However, the derivation and efficient implementation of these theories constitute a significant bottleneck. As the rank of the associated tensors increases, the governing equations explode in complexity, rendering manual implementation labor-intensive, error-prone, and difficult to optimize for modern hardware. To address this challenge, this dissertation presents SeQuant, a comprehensive framework for the automated derivation and parallel implementation of many-body quantum chemistry methods. Built upon a robust symbolic algebra engine, SeQuant allows for the expression of theories in the natural language of second quantization. It automates the transformation of high-level theoretical ansatzes into explicit tensor contraction expressions and subsequently generates optimized, high-performance C++ code. A central innovation of this work is the extension of automated implementation to reduced-scaling methods, which exploit the sparsity inherent in electronic correlation. We introduce a novel "tensor-of-tensors" data structure designed to manage the irregular sparsity patterns of Pair Natural Orbital (PNO) formulations. This development enables the first fully automated implementation of PNO-Coupled Cluster (PNO-CC) methods, bridging the gap between symbolic abstraction and the runtime requirements of sparse tensor algebra. The results demonstrate that SeQuant not only reproduces established dense methods (such as CCSD and CCSDT) with high fidelity but also effectively handles the complexity of sparse, local correlation approaches. By decoupling the complexity of the physics from the details of the implementation, this framework establishes a new paradigm for method development, dramatically accelerating the translation of theoretical insights into computational reality.
The ultimate goal of electronic structure theory is solving the electronic Schr¨odinger Equation. However, even accurate approximations of solving Schr¨odinger Equation, such as high order coupled cluster theories, require computational efforts that are too demanding to be applied on large chemical systems. This thesis tackles the problem of curse of dimensionality: how to reduce the time complexity of high-accuracy coupled cluster methods in order to accelerate computations of molecular energy. On one hand, we believe that low-rank approximation (i.e. Tensor HyperContraction) of high-order tensors appearing in coupled cluster theory is a promising way to achieve rank-reduced coupled cluster theory. On the other hand, we think that the work of deriving, optimizing and implementing low-rank approximated coupled cluster theory is both tedious and repetitious, and shall be performed by an automatic code engine other than chemists. In this thesis, we introduce our chemistry equation compiler, Autom: a code engine that is designed for automatically deriving, optimizing and implementing low-rank approximated coupled cluster theories. With Autom, the development of electronic theories is greatly simplified. Autom can easily generate runnable codes in minutes for tensor-algebra based chemistry equations with customized low-rank approximation rules; conventionally, such procedure may take an expert weeks or even months to manually program. This thesis roughly consists of two parts. In the first part, we aim to cover the lowrank approximation techniques for high-accuracy coupled cluster theories, emphasizing on two new factorization techniques we developed especially for several coupled cluster theories including triple contributions. In the second part, we demonstrate the algorithms of our automatic code engine. We also summarize recent advances of domain specific compilers in Machine Learning community and discuss future directions for compute graph optimization. We believe that this new software infrastructure holds great promise for future chemistry package designs.
This thesis deals with selected aspects of a new implementation of many-body methods which can be formulated in the framework of second quantization, in particular the coupled-cluster (CC) method with arbitrary excitation level. Coupled-cluster is one of the most successful and widely used quantum chemical methods for accurate calculations on small to medium-sized molecules. Since it employs a nonlinear parametrization of the wave function, its implementation is rather difficult, in particular if higher (i.e. more than double) excitations are to be included. The latter is necessary to obtain highly accurate results and also as a prerequisite for the generalization to multi-reference cases. The implementation described here has a twofold focus. One is on generality and flexibility regarding the method to be implemented, the other is on efficiency. To achieve flexibility, it is useful to have a machinery which automatically derives working equations for a given method. We realize this by applying techniques of second quantization. This work treats in particular the last step of this procedure, namely the simplification of the resulting equations by the identification of equivalent terms. The algorithm used here is based on the interpretation of algebraic terms as graphs. The derived CC equations then have to be solved iteratively. The efficiency of the program is mainly determined by the evaluation of the occurring expressions, which has to be done in each iteration step. The evaluation is split up in a sequence of tensor contractions. Their generic implementation is complicated by the particular structure of the involved tensors. We reduce each contraction to a sequence of matrix multiplications, which requires a previous data rearranging. But since matrix multiplication is the most efficient operation on modern computers, this additional effort pays off. Preliminary tests show that our program is at least as fast as the most efficient general coupled-cluster implementation so far, and the relation is expected to improve for calculations with larger basis sets where the matrix multiplication becomes the time-determining step. Finally, we give an outlook to possible further developments. In particular, the preparation of the equations before the actual evaluation (factorization) offers much potential for optimizations which we do not exploit at the moment, in contrast to the program with which we compare, which employs at least a partial optimization at this point.
The optimization of tensor expressions with hundreds of terms is required for the development of accurate quantum chemistry models such as the coupled cluster method. In this paper, we address the effective exploitation of symmetry properties of tensors in performing algebraic transformations for minimizing operation count of tensor expressions. We develop rules to detect symmetries in intermediate tensors, cost models for tensor contractions with symmetries, and a canonical representation to facilitate effective common subexpression elimination. We demonstrate significant improvements to the operation counts for the coupled cluster method when compared to several state-of-the-art im-plementations. Furthermore, we show that tensor expressions optimized for a few input parameter combinations can be used to achieve operation counts within 3% of the optimal, for the entire parameter space of interest.