You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/technical_notes/fock_build.tex
+20-7Lines changed: 20 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ \section{Introduction}
51
51
B^{P}_{\mu\nu} = \sum_Q (P|Q)^{-1/2} (Q|\mu\nu).
52
52
\end{equation}
53
53
54
-
The matrix inverse and inverse square root of the Coulomb metric $A\equiv (P|Q)$ can be computed by Cholesky decomposition:
54
+
The matrix inverse square root of the Coulomb metric $A\equiv (P|Q)$ can be computed by Cholesky decomposition:
55
55
\begin{equation}
56
56
A = L L^T,
57
57
\end{equation}
@@ -60,12 +60,7 @@ \section{Introduction}
60
60
\label{eq:inv}
61
61
A^{-1} = L^{-T} L^{-1},
62
62
\end{equation}
63
-
which can be obtained by two triangular solves (\textit{e.g.}, with \texttt{scipy.linalg.solve\_triangular}):
64
-
\begin{equation}
65
-
Lx = I, \quad L^T y = x
66
-
\end{equation}
67
-
where $x = L^{-1}$ and $y = A^{-1}$.
68
-
From \cref{eq:inv}, we can also identify $L^{-1}$ as a valid choice for $A^{-1/2}$ in our context, since $L^{-1}_{PR}(R|\rho\sigma) = B^{P}_{\rho\sigma}$, and the contraction of the B tensors yields the original four-center integrals:
63
+
From \cref{eq:inv}, we can identify $L^{-1}$ as a valid choice for $A^{-1/2}$ in our context, since $L^{-1}_{PR}(R|\rho\sigma) = B^{P}_{\rho\sigma}$, and the contraction of the B tensors yields the original four-center integrals:
In this step, one can apply integral screening of $(\mu\nu | P)$ to reduce the evaluation cost.
119
115
\end{enumerate}
120
116
117
+
Note in \cref{eq:bp}, we require the application of the inverse of the Coulomb metric to a vector.
118
+
There are at least four, in principle equivalent, ways to do this:
119
+
\begin{enumerate}
120
+
\item Use the pre-computed $L^{-1}$ to form $A^{-1}=L^{-T} L^{-1}$ and do a matrix-vector product with the problem vector: $b_Q = A^{-1} a_Q$.
121
+
\item Two triangular solves with $L$ on the problem vector $a_Q$: first solve $L z = a_Q$ for $z$ and then solve $L^T b_P = z$ for $b_P$.
122
+
\item Compute the eigen-decomposition of the Coulomb metric $A = U s U^T$ and threshold the eigenvalues to get $A_{\eta}^{-1} = U_{\eta} s_{\eta}^{-1} U_{\eta}^T$ where $s_{\eta}$ are the eigenvalues above some threshold $\eta$ and $U_{\eta}$ are the corresponding eigenvectors. Then do a matrix-vector product with the problem vector: $b_P = A_{\eta}^{-1}a_Q$.
123
+
\item Compute the same $U_{\eta}$ and $s_{\eta}$ as above, but apply it to each problem vector without forming $A_{\eta}^{-1}$: $b_P = U_{\eta} (U_{\eta}^T a_Q / s_{\eta})$.
124
+
\end{enumerate}
125
+
The first two methods cannot deal with Coulomb metrics that have large condition numbers. The first and third methods at first seem appealing, since we pre-compute a `universal' $A^{-1}$ and just do matrix-vector products later.
126
+
Turns out, forming of $A^{-1}$ directly, as in the first and third methods is not numerically stable, since the error of these operations is on the order of $\text{cond}(A)^2\epsilon$, whereas the error of the second and fourth methods is on the order of $\text{cond}(A)\epsilon$.
127
+
128
+
If ill-conditioning is not a problem, then \texttt{scipy} offers a very succint way to carry out method 2:
0 commit comments