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: Project#03/hints/hint3-1.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,24 +2,24 @@
2
2
How do we conveniently store the elements of the four-dimensional two-electron integral array in a one-dimensional array? Consider the lower triangle of an *n x n* symmetric matrix:
The total number of elements in the lower triangle is *M = n(n+1)/2*. We could store these in a one-dimensional array by ordering them from top-to-bottom, left-to-right:
@@ -41,15 +41,15 @@ Here's an equivalent piece of code that requires fewer keystrokes:
41
41
The eight-fold permutational symmetry of the two-electron repulsion integrals can be viewed similarly. The Mulliken-notation integrals are symmetric to permutations of the bra indices or of the ket indices. Hence, we can view the integral list as a symmetric "super-matrix" of the form:
Thus, just as for the two-dimensional case above, we only need to store the lower triangle of this matrix, and a one-dimensional array of length *M(M+1)/2* will do the trick. Given four AO indices, *i*, *j*, *k*, and *l* corresponding to the integral, (ij|kl), we can translate these into compound row (*ij*) and column (*kl*) indices using the expression above, as well as the final compound index:
Copy file name to clipboardExpand all lines: Project#03/hints/hint3-2.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
If you've written your program so that the two-electron integrals are stored in a one-dimensional array, you may have recognized that your program spends quite a bit of its time calculating compound indices. Is there a way to speed up this process? Sure! Pre-compute the indices instead. Look again at the structure of a symmetric matrix, with the elements of the lower triangle numbered top-to-bottom/left-to-right:
0 commit comments