Skip to content

Commit 642c683

Browse files
committed
Add Project 9 hints and eqns
1 parent 1e0cfba commit 642c683

File tree

2 files changed

+58
-41
lines changed

2 files changed

+58
-41
lines changed

Project#09/README.md

+30-41
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,31 @@
33
The use of point-group symmetry in quantum chemical calculations can lead to exceptionally efficient programs,
44
both in terms of their memory/disk usage and their computing times. If a molecule has even one element of symmetry,
55
for example, this can reduce the number of wave function parameters that must be stored by up to a factor of two (the order of the point group)
6-
and the computing effort by up to a factor of four (the square of the order of the point group).
6+
and the computing effort by up to a factor of four (the square of the order of the point group).
77
Most quantum chemical programs can take advantage of Abelian symmetry -- more accurately,
88
D<sub>2h</sub> and its subgroups -- which means that higher symmetry structures can yield up to a factor of 64 reduction in the computational costs.
99

10-
The purpose of this project is to take advantage of basic point-group symmetry in an SCF calculation.
10+
The purpose of this project is to take advantage of basic point-group symmetry in an SCF calculation.
1111
While the most efficient programs will store only the symmetry-allowed sets of two-electron integrals,
1212
for the purposes of this project we'll deal only with the one-electron (two-index) components.
1313

1414
## Background
1515

1616
The vanishing integral rule of point-group theory may be stated as follows for Abelian groups:
1717

18-
```
19-
EQUATION
20-
\langle \phi_i | \hat{A} |\phi_j \rangle = 0 \ \ \ \ {\rm if} \ \ \ \ \Gamma_A \neq \Gamma_{\phi_i} \otimes \Gamma_{\phi_j},
21-
```
18+
<img src="./figures/point-group-rule.png" height="20">
2219

23-
where <html>&Gamma;<sub>X</sub></html> denotes the irreducible representation (irrep) of entity X.
20+
where <html>&Gamma;<sub>X</sub></html> denotes the irreducible representation (irrep) of entity X.
2421
That is, unless the direct product of the irreps of the functions or operators in the integrand contains the totally symmetric irrep, the integral must be zero.
2522

2623
The vanishing integral rule of group theory may be readily applied to the various integrals and wave-function parameters in the SCF procedure
27-
** *if* ** the AO-basis functions over which the they are evaluated have been properly symmetrized
24+
<b><i>if</i></b> the AO-basis functions over which the they are evaluated have been properly symmetrized
2825
[i.e. used to form symmetry-adapted linear combinations, normally referred to as symmetry orbitals (SOs)].
2926

30-
For example, consider the H<sub>2</sub>O test case with the STO-3G basis set as given in Project #3. The AO
27+
For example, consider the H<sub>2</sub>O test case with the STO-3G basis set as given in [Project #3](../Project%2303). The AO
3128
([contracted Gaussian](http://sirius.chem.vt.edu/wiki/lib/exe/fetch.php?media=basis_sets.pdf)) basis functions
3229
on the oxygen atom consist of 1s, 2s, 2p<sub>x</sub>, 2p<sub>y</sub>, and 2p<sub>z</sub> orbitals,
33-
which those for each hydrogen atom consist of only the 1s, giving a total of seven AOs.
30+
which those for each hydrogen atom consist of only the 1s, giving a total of seven AOs.
3431
If we take oxygen to be the first atom and ignore the C<sub>2v</sub> point group symmetry of the molecule,
3532
the resulting overlap integral matrix looks like:
3633

@@ -48,20 +45,20 @@ the resulting overlap integral matrix looks like:
4845
The first five row/column indices correspond to the basis functions on the oxygen (in the order listed above),
4946
while rows/columns six and seven correspond to the basis functions on each hydrogen.
5047
Thus, the 1-2 element is the overlap integral between the 1s and 2s orbitals on the oxygen,
51-
while element 3-7 is the overlap integral between the oxygen 2p<sub>x</sub> orbital and the second hydrogen 1s orbital.
48+
while element 3-7 is the overlap integral between the oxygen 2p<sub>x</sub> orbital and the second hydrogen 1s orbital.
5249

5350
Points to note about this matrix:
54-
- The 1s and 2s orbitals on oxygen are not orthogonal to one another, but both are orthogonal to all three p-type orbitals.
51+
- The 1s and 2s orbitals on oxygen are not orthogonal to one another, but both are orthogonal to all three p-type orbitals.
5552
This occurs because, in Cartesian Gaussian basis sets,
5653
orthogonality is generally obtained only between functions of different angular momenta on the same atomic center.
5754
- The 1s orbitals on the hydrogens have the same overlap integral (to within a sign)
58-
with all the orbitals on the oxygen because they are ** *symmetry equivalent* ** .
55+
with all the orbitals on the oxygen because they are <b><i>symmetry equivalent</i></b>.
5956
However, the 1s orbitals alone do not transform as irreps of the C<sub>2v</sub> point group.
60-
- The hydrogen 1s orbitals are orthogonal to the 2p<sub>z</sub> orbital on the oxygen (cf. elements 5-6 and 5-7).
57+
- The hydrogen 1s orbitals are orthogonal to the 2p<sub>z</sub> orbital on the oxygen (cf. elements 5-6 and 5-7).
6158
This is because the water molecule was arbitrarily oriented in the xy-plane to compute the above integrals;
6259
thus the 2p<sub>z</sub> orbital is perpendicular to the molecular plane containing the hydrogen 1s orbitals.
6360

64-
What happens if we turn on symmetry, i.e. take linear combinations of the AO to obtain SOs?
61+
What happens if we turn on symmetry, i.e. take linear combinations of the AO to obtain SOs?
6562
If we orient the molecule oriented in the yz-plane, so that the z-axis corresponds to the C<sub>2</sub> rotation axis,
6663
we find that the AOs transform as the following irreps:
6764

@@ -75,7 +72,7 @@ we find that the AOs transform as the following irreps:
7572
| H<sub>1</sub> 1s + H<sub>2</sub> 1s | A<sub>1</sub> |
7673
| H<sub>1</sub> 1s - H<sub>2</sub> 1s | B<sub>2</sub> |
7774

78-
Thus, after symmetrization, there are four A<sub>1</sub> SOs, one B<sub>1</sub> SO, and two B<sub>2</sub> SOs.
75+
Thus, after symmetrization, there are four A<sub>1</sub> SOs, one B<sub>1</sub> SO, and two B<sub>2</sub> SOs.
7976
(The STO-3G basis set contains no A<sub>2</sub> orbitals. One must include at least d-type functions on the oxygen and/or
8077
p-type functions on the hydrogens to obtain A<sub>2</sub> orbitals.) Note that a normalization factor of 1/sqrt(2) should be included for the H 1s SOs above.
8178

@@ -107,13 +104,13 @@ The PSI checkpoint file contains a great deal of useful symmetry information. To
107104

108105
## Storing One-Electron Integrals with Symmetry
109106

110-
The block-diagonal structure above implies that one need only store and use the sub-matrices of the integrals rather than the full matrix.
107+
The block-diagonal structure above implies that one need only store and use the sub-matrices of the integrals rather than the full matrix.
111108
One way of doing this is to store the one-electron integrals as an array of smaller matrices,
112109
the size of which is dictated by the number of SOs per irrep. For example, here's a code snippet that will extract the one-electron integrals
113-
from the appropriate file (as was done in [Project #7](https://github.com/CrawfordGroup/ProgrammingProjects/tree/master/Project%2307) ),
110+
from the appropriate file (as was done in [Project #7](../Project%2307) ),
114111
but stores them in an array of matrices:
115112

116-
```cpp
113+
```c++
117114
int ntri, nirreps;
118115
double *scratch;
119116
double ***S;
@@ -138,9 +135,9 @@ but stores them in an array of matrices:
138135
```
139136
140137
Notice how S is now a `double ***` -- i.e. an array of matrices. This code uses the same `INDEX()` function found in
141-
[Project #3](https://github.com/CrawfordGroup/ProgrammingProjects/tree/master/Project%2303),
142-
and the sopi array is the integer array of SOs per irrep obtained using the `chkpt_rd_sopi()` function.
143-
The `symm_offset` array is useful for converting between ** *relative* ** orbital indices and ** *absolute* ** orbital indices.
138+
[Project #3](https://github.com/CrawfordGroup/ProgrammingProjects/tree/master/Project%2303),
139+
and the sopi array is the integer array of SOs per irrep obtained using the `chkpt_rd_sopi()` function.
140+
The `symm_offset` array is useful for converting between <b><i>relative</i></b> orbital indices and <b><i>absolute</i></b> orbital indices.
144141
(For example, orbital 0 in the B<sub>2</sub> irrep block corresponds to orbital 5
145142
in the full list of orbitals; the first number is the relative index, the second is the absolute index.)
146143
@@ -149,28 +146,23 @@ in the full list of orbitals; the first number is the relative index, the second
149146
If we store the integral, MO coefficient, density, and Fock matrices in the block-diagonal structure described above,
150147
we may compute matrix products of these quantities separately for each diagonal block. For example, the matrix product may be written as:
151148
152-
```
153-
EQUATION
154-
{\mathbf C} = {\mathbf A} {\mathbf B} = \bigoplus_h {\mathbf C}_h = \bigoplus_h {\mathbf A}_h {\mathbf B}_h,
155-
```
149+
<img src="./figures/matrix-product.png" height="25">
156150
157-
where *h* denotes a particular irrep of the point group and <b><i>C</i></b><sub>h</sub> denotes the *h*-th irrep subblock of the full matrix ** *C* ** .
151+
where *h* denotes a particular irrep of the point group and <b><i>C</i></b><sub>h</sub> denotes the *h*-th irrep subblock of the full matrix <b><i>C</i></b>.
158152
(The notation of the large plus with a circle around it indicates a direct sum.)
159153
160154
## Occupied Orbitals and the Density Matrix
161155
162156
The calculation of the density matrix requires information about the number of occupied orbitals:
163157
164-
```
165-
EQUATION
166-
D_{\mu\nu} = \sum_m^{\rm occ.} \left( {\mathbf C} \right)_\mu^m \left( {\mathbf C} \right)_\nu^m
167-
```
158+
<img src="./figures/density-matrix.png" height="25">
159+
168160
In a calculation without symmetry, one need only know the number of electrons (equivalently, the atomic numbers of the atoms and the overall molecular charge)
169161
to evaluate this expression. However, if the density and MO coefficient matrices are stored in symmetry-blocked form,
170-
as above, one needs to know the number of occupied MOs in each irrep.
162+
as above, one needs to know the number of occupied MOs in each irrep.
171163
172164
For the case of the C<sub>2v</sub> water molecule, which has two <html>&sigma;</html> O-H bonds, two oxygen lone pairs,
173-
and one oxygen core orbital, the orbital occupations are not difficult to determine, given the above information about the number of SOs in each irrep.
165+
and one oxygen core orbital, the orbital occupations are not difficult to determine, given the above information about the number of SOs in each irrep.
174166
Since the MOs are constructed as linear combinations of the SOs, and only SOs of the same irrep can combine, we may rationalize the occupied orbitals of
175167
H<sub>2</sub>O as follows:
176168
@@ -184,9 +176,9 @@ H<sub>2</sub>O as follows:
184176
185177
Thus, for the water molecule, there are 3 A<sub>1</sub>, 1 B<sub>1</sub>, and 1 B<sub>2</sub> occupied orbitals.
186178
187-
Determining the occupations automatically is sometimes a difficult task, especially for molecules with unusual bonding patterns.
179+
Determining the occupations automatically is sometimes a difficult task, especially for molecules with unusual bonding patterns.
188180
Many SCF programs will simply take the core Hamiltonian matrix (often used as the initial guess for the Fock matrix),
189-
diagonalize it (in the othogonal AO basis) in each irrep block, and identify the lowest eigenvalues in each irrep as occupied.
181+
diagonalize it (in the othogonal AO basis) in each irrep block, and identify the lowest eigenvalues in each irrep as occupied.
190182
However, this approach often fails for many molecules (especially those with open shells) because of near-degeneracies
191183
that may not be adequately described by the simple core Hamiltonian. Thus, some programs will make use of more
192184
sophisticated guesses at the Fock matrix, e.g. Hueckel orbitals or other (semi)empirical forms.
@@ -195,17 +187,14 @@ sophisticated guesses at the Fock matrix, e.g. Hueckel orbitals or other (semi)e
195187
196188
The only portion of the SCF procedure involving two-electron integrals is the Fock-matrix build:
197189
198-
```
199-
EQUATION
200-
F_{\mu\nu} = H^{\rm core}_{\mu\nu} + \sum_{\lambda\sigma}^{\rm AO} D^{i-1}_{\lambda\sigma} \left[ 2 (\mu\nu | \lambda\sigma) - (\mu\lambda|\nu\sigma) \right],
201-
```
190+
<img src="./figures/fock-build.png" height="30">
202191
203-
where the notation used in [Project #3](https://github.com/CrawfordGroup/ProgrammingProjects/tree/master/Project%2303) is retained above.
192+
where the notation used in [Project #3](../Project%2303) is retained above.
204193
If the Fock matrix and density matrix are stored in a symmetry-blocked manner similar to the overlap matrix above,
205194
then one may limit the corresponding loops only to the symmetry-allowed combinations, e.g. the irreps of <html>&mu;</html> and
206195
<html>&nu;</html> must match for F<html><sub>&mu;&nu;</sub></html> to be non-zero and the irreps of <html>&lambda;</html>
207196
and <html>&sigma;</html> must match for D<html><sub>&lambda;&sigma;</sub></html> to be non-zero.
208197
Note, however, that, because of the symmetries in the two-electron integrals,
209198
the irrep of <html>&lambda;</html> and <html>&sigma;</html> do not necessarily have to match that of <html>&mu;</html> and <html>&nu;</html>.
210199
211-
* Hint: Fock-Build Code
200+
* [Hint](./hints/hint1.md): Fock-Build Code

Project#09/hint1.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
```c++
2+
for(h=0; h < nirreps; h++) {
3+
for(i=0; i < sopi[h]; i++) {
4+
I = symm_offset[h] + i;
5+
for(j=0; j < sopi[h]; j++) {
6+
J = symm_offset[h] + j;
7+
F[h][i][j] = H[h][i][j];
8+
9+
for(g=0; g < nirreps; g++) {
10+
for(k=0; k < sopi[g]; k++) {
11+
K = symm_offset[g] + k;
12+
for(l=0; l < sopi[g]; l++) {
13+
L = symm_offset[g] + l;
14+
15+
ij = INDEX(I,J); kl = INDEX(K,L);
16+
ijkl = INDEX(ij,kl);
17+
ik = INDEX(I,K); jl = INDEX(J,L);
18+
ikjl = INDEX(ik,jl);
19+
20+
F[h][i][j] += D[g][k][l] * (2.0 * TEI[ijkl] - TEI[ikjl]);
21+
}
22+
}
23+
24+
}
25+
}
26+
}
27+
}
28+
```

0 commit comments

Comments
 (0)