Calculation of high-rank tensor contractions plays a central role in computational physics, quantum chemistry, and computer science. The ability to perform a tensor contraction within a given computational budget poses a challenge to feasibility and restricts the types of systems that can be investigated computationally. We present the development and implementation of the Stratified Stochastic Tensor Contraction (SSTC) method as an alternative to sequential evaluation of tensor contraction. The SSTC approach partitions the tensor indices into stratified segments and employs composite index mappings to guide efficient sampling. By leveraging intrinsic structure within tensors, SSTC achieves rapid convergence to exact results with controllable sampling errors. We demonstrate the method on representative cases, two-point Coulomb integrals, four-point kernels, and correlation energy calculations using 2nd order Møller–Plesset perturbation theory, all of which are relevant to explicitly correlated electronic structure theory. In all examples, the SSTC method provides an accurate estimate of the tensor contraction with systematically reducible errors. We present the theory of exact tensor contractions as a foundation for the stochastic approach, followed by the mathematical derivation of the SSTC framework. Key components include the construction of a composite index to enable loop compression, and the application of functional minimization techniques for variance reduction. A discussion comparing sequential and stochastic contraction strategies, analysis of the distribution of sampling points through cumulative distribution functions and correlations between sampling assignments and kernel values are presented. A description of the SSTC method’s impact on computational clock times and dependence on segment number is included. Additional considerations include sampling with vs without replacement and the computational advantages of index mapping. These results highlight the effectiveness of the SSTC method as a versatile and scalable alternative to the conventional sequential tensor contraction approach, with broad applicability to quantum chemistry, many-body physics, stochastic quantum mechanics, and tensor-based machine learning.
Second-order Moller--Plesset perturbation theory (MP2) is one of the simplest correlated wave-function methods, but its conventional
O(N5) cost limits its application to large systems. Stochastic tensor contraction (STC) has recently appeared as a general technique to evaluate high-order tensor contractions in quantum chemistry. Here, we apply STC to the exchange contribution of Laplace-transformed MP2, which is the source of
O(N5) scaling in the formulation. The resulting STC exchange algorithm has an
O(N3) deterministic setup cost and an
O(N2) stochastic cost at fixed absolute error. The estimator is unbiased and provides a way to specify the target stochastic error by estimating the number of required samples before the full calculation. We implement the algorithm using a hybrid deterministic--stochastic evaluation strategy, with grouped index sampling, to reduce the computational prefactor. Over a range of benchmark molecules containing up to
∼7000 basis functions, the stochastic exchange evaluation takes as little as
1/270 of the time of a complete DF-MP2 calculation on the same system. Within the Laplace-transformed formulation, the
O(N4) scaling direct contribution is thus the only significant cost. Our results further substantiate the power of STC to serve as a general tensor-contraction engine for quantum chemistry.
The tensor flattenings appear naturally in quantum information when one produces a density matrix by partially tracing the degrees of freedom of a pure quantum state. In this paper, we study the joint
∗-distribution of the flattenings of large random tensors under mild assumptions, in the sense of free probability theory. We show the convergence toward an operator-valued circular system with amalgamation on permutation group algebras for which we describe the covariance structure. As an application we describe the law of large random density matrix of bosonic quantum states.