From d62a0e45b41c2b3f028cd1efe1c0a018febb0b6e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 18 May 2023 21:00:09 +0200 Subject: [PATCH] References DGEMM --- stochastic_triples.bib | Bin 1024 -> 1709 bytes stochastic_triples.tex | 26 ++++++++++++++++++++++++++ triples.org | 20 ++++++++++++-------- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/stochastic_triples.bib b/stochastic_triples.bib index 06d7405020018ddf3cacee90fd4af10487da3d20..da5b96d82961e098e884839f182d1d81e44a3937 100644 GIT binary patch literal 1709 zcmai!U2h^c6o#*xUvci*O3Y-wfKaK@5=gVV3A^k<+nY$$Va6~{JT|gDYyk1!d+dSm zkxIQ7X>6Z!Y`@QW{Q7W6k8tN>*JLnRk2 zm~y#zrO!`2)@GA$*h>q>Tv_esrm9k_7ECNkUUALda#3q+!Dq~0cC?e_Rxr2G_7-hk zvH~i!n!iG>s%34_awQEY2_@>{2f8|W&IHqFl{PR#Ln*X;KmOC~T)}5mYl*^@{3LA% zpF{Y_7bT3Do-192Fz|&#=r5NdbQvop>dK!X>AA72s~Pi`Puy^c3uauoxR(Y&65Y7T zHNz%?^m5}$Nn29ToXu#&jgdYh>SaNiC6TXF&jdGRQ+d+Azk{)x$@f=$v;|D2BNtgH z-eiYy-0fb+RK*pEvv#N3&N{oR-PP5H1Gowuw3yP4&_*Qi-%LIq_&jLZSYoA=w&j|j zXs-7(|KdVW^jFP{Z5TbMA1KTVZ@~j)@%N$S_)P%`G#l?wq)={Np2k- zzGCp5Eoy<9Z&(ow29x10(_cw`ty%7|{^l9HDPR?Ki>B@p>n2K|CAgC{oveBXm$(i} zMm(n_Q`%*?ez^eJb*De_^r((J)3_4^ahmw36QZ%pIuNaJO`|uW?W`B{I{rNOSPO5ZTTa?@ z$qa!SqY~;I)Q}by64V^f_kXbOf0Q|c`@7L75d4L~lu4uX_Q|qW%VdG3+%;1$s)gmt zLw{act3MdQRHHN@jL?=LU3PArJ>4mehRQNGJ_1PH@CbnH$M literal 1024 ScmZQz7zLvtFd70QH3R?z00031 diff --git a/stochastic_triples.tex b/stochastic_triples.tex index c82e07c..83a8f19 100644 --- a/stochastic_triples.tex +++ b/stochastic_triples.tex @@ -130,6 +130,26 @@ In the following sections of this paper, we will provide a brief introduction to %c. Challenges and limitations of traditional approaches +The perturbative triples correction, +\begin{equation} +E_{(T)} = \sum_{ijkabc} E_{ijk}^{abc} +\end{equation} +is a sum of $N=N_o^3 \times N_v^3$ terms, +\begin{equation} + E_{ijk}^{abc} = \frac{(4 W_{ijk}^{abc} + + W_{ijk}^{bca} + W_{ijk}^{cab}) + (V_{ijk}^{abc} - V_{ijk}^{cba})}{\epsilon_i + \epsilon_j + \epsilon_k - +\epsilon_a - \epsilon_b - \epsilon_c} +\end{equation} +which depend on the canonical orbital energies $\epsilon$, and the tensors $W$ and $V$. +The indices $i,j,k$ and $a,b,c$ denote respectively occupied and virtual orbitals. + +The bottleneck is the computation of $W$, which requires $\order{N_o^3 \times +N_v^4}$ operations. However, most of the operations involved in the computation of $W$ +can be recast into matrix multiplications, which are among the most efficient +operations than can be executed on modern CPUs and +accelerators.\cite{ma_2011,haidar_2015,dinapoli_2014,springer_2018} + %=================================================================% \section{Semi-Stochastic Algorithm} \label{sec:algorithm} @@ -145,6 +165,12 @@ In the following sections of this paper, we will provide a brief introduction to %c. Discussion of the algorithm's advantages and potential trade-offs %d. Detailed pseudocode or algorithmic steps, if applicable +\subsection{Stochastic formulation} + +\subsection{Test code} +\label{subsec:test_code} +% Include the test code here, if applicable. + %=================================================================% \section{Implementation Details} diff --git a/triples.org b/triples.org index 381e5df..e4773c1 100644 --- a/triples.org +++ b/triples.org @@ -2,7 +2,7 @@ * Stochastic formulation -The perturbative correction is expressed as: +The perturbative correction reads: \[ E_{(T)} = \sum_{ijkabc} E_{ijk}^{abc} = \sum_{ijkabc} \frac{(4 W_{ijk}^{abc} + @@ -12,14 +12,19 @@ E_{(T)} = \sum_{ijkabc} E_{ijk}^{abc} = \sum_{ijkabc} \frac{(4 W_{ijk}^{abc} + \epsilon_a - \epsilon_b - \epsilon_c} \] - -If $E_{(T)}$ is computed as +where the indices $i,j,k$ run over the $N_o$ occupied orbitals, and +the indices $a,b,c$ run over the $N_v$ virtual orbitals. + +If $E_{(T)}$ is re-expressed as \[ E_{(T)} = \sum_{ijkabc} \frac{1}{N} \left( E_{ijk}^{abc} \times N \right) \] -where $N$ is the total number of terms, it can be computed by drawing -uniformly samples $E_{ijk}^{abc}$ and computing the statistical -average. +where $N=N_o^3 N_v^3$ is the total number of terms, it can be computed by drawing +uniformly samples $E_{ijk}^{abc}$ and using the statistical average as + + \[ +E_{(T)} = N \times \langle E_{ijk}^{abc} \rangle + \] The stochastic calculation is unbiased, but the rate of convergence of the statistical error is be governed by the variance of the @@ -115,8 +120,7 @@ $E_B$ stochastically and we can separate the buckets into stochastic \[ E_{(T)} = \sum_{B \in \mathcal{D}} E_B + \frac{1}{|\mathcal{S}|} \sum_{B \in \mathcal{S}} -\left \langle E^B_{abc} \times \frac{\epsilon_{\text{occ}} - -\epsilon_a - \epsilon_b - \epsilon_c}{\mathcal{N}} \right \rangle_{P(a,b,c), (a,b,c) \in B} +\left \langle E^B_{abc} \times \frac{- \epsilon_a - \epsilon_b - \epsilon_c}{\mathcal{N}} \right \rangle_{P(a,b,c), (a,b,c) \in B} \] All the buckets don't have the same size: the number of triplets per