Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cd400c3
Open Pull Request for add-hints
kcpearce Jan 30, 2017
307370e
Check image height specification
kcpearce Jan 30, 2017
64577cb
Check image height specification again
kcpearce Jan 30, 2017
3d99673
Change images to height specifications
kcpearce Jan 30, 2017
8d3759a
Change images to height specifications again
kcpearce Jan 30, 2017
45c0a56
Change images to height specifications again
kcpearce Jan 30, 2017
f96835e
Change images to height specifications again
kcpearce Jan 30, 2017
68bbcec
Test new links for Project2 readme
kcpearce Jan 30, 2017
deb76a4
Change links to relative for input/output
kcpearce Jan 30, 2017
2a65459
Project 2 hints and links to hints added
kcpearce Jan 30, 2017
8209197
Project 3 hints and links to hints added
kcpearce Jan 30, 2017
a1cbc4e
Fix Project 2 instructions errors
kcpearce Jan 30, 2017
408a5fb
Fix Project 2 instructions errors
kcpearce Jan 30, 2017
2635dec
Fix Project 2 Readme
kcpearce Jan 30, 2017
022b6c9
More errors in Project 2
kcpearce Jan 30, 2017
d639654
More Errors in Project 2
kcpearce Jan 30, 2017
f89a521
Broken Link fixed
kcpearce Jan 30, 2017
21cebef
Fix Project 3 Errors
kcpearce Jan 30, 2017
b910d1a
Embed Project 2 equations
kcpearce Jan 30, 2017
37d19bb
Delete MacOSX file
kcpearce Jan 30, 2017
1b37397
Correct equation sizes
kcpearce Jan 30, 2017
7809ef5
Correct equation sizes again
kcpearce Jan 30, 2017
49e7077
Minor Changes
kcpearce Feb 1, 2017
17b9436
Embed Project 3 Equations
kcpearce Feb 3, 2017
de0e92c
Fix Equation Sizes
kcpearce Feb 3, 2017
e57dc8d
Fix Equation Sizes Again
kcpearce Feb 3, 2017
67a049f
Embed Hint Equations
kcpearce Feb 3, 2017
194c8e6
Fix Hints Equations Links
kcpearce Feb 3, 2017
09e8e6f
Fix Hints Equations Links Again
kcpearce Feb 3, 2017
415fda0
Fix Hints Equations Sizes
kcpearce Feb 3, 2017
cbc2338
Fix Hints Equation Sizes Again
kcpearce Feb 3, 2017
c402fec
Fix Hints Equations Sizes Again
kcpearce Feb 3, 2017
3e8387d
Remove .DS_Store File
kcpearce Feb 3, 2017
f23d2df
Remove .DS_Store File
kcpearce Feb 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
Binary file added Project#01/.DS_Store
Binary file not shown.
12 changes: 6 additions & 6 deletions Project#01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ After downloading the file to your computer (to a file called “geom.dat”, fo
## Step 2: Bond Lengths
Calculate the interatomic distances using the expression:

<img src="./figures/distances.png" width="400">
<img src="./figures/distances.png" height="40">

where x, y, and z are Cartesian coordinates and i and j denote atomic indices.

Expand All @@ -40,11 +40,11 @@ where x, y, and z are Cartesian coordinates and i and j denote atomic indices.
## Step 3: Bond Angles
Calculate all possible bond angles. For example, the angle, &phi;<sub>ijk</sub>, between atoms i-j-k, where j is the central atom is given by:

<img src="./figures/bond-angle.png" width="150">
<img src="./figures/bond-angle.png" height="25">

where the e&#8407;<sub>ij</sub> are unit vectors between the atoms, e.g.,
where the e<sub>ij</sub> are unit vectors between the atoms, e.g.,

<img src="./figures/unit-vectors.png" width="600">
<img src="./figures/unit-vectors.png" height="30">

- [Hint 1](./hints/hint3-1.md): Memory allocation for the unit vectors
- [Hint 2](./hints/hint3-2.md): Avoiding a divide-by-zero
Expand All @@ -56,7 +56,7 @@ where the e&#8407;<sub>ij</sub> are unit vectors between the atoms, e.g.,
## Step 4: Out-of-Plane Angles
Calculate all possible out-of-plane angles. For example, the angle &theta;<sub>ijkl</sub> for atom i out of the plane containing atoms j-k-l (with k as the central atom, connected to i) is given by:

<img src="./figures/oop-angle.png" width="200">
<img src="./figures/oop-angle.png" height="60">

- [Hint 1](./hints/hint4-1.md): Memory allocation?
- [Hint 2](./hints/hint4-2.md): Cross products
Expand All @@ -67,7 +67,7 @@ Calculate all possible out-of-plane angles. For example, the angle &theta;<sub>i
## Step 5: Torsion/Dihedral Angles
Calculate all possible torsional angles. For example, the torsional angle &tau;<sub>ijkl</sub> for the atom connectivity i-j-k-l is given by:

<img src="./figures/torsion-angle.png" width="250">
<img src="./figures/torsion-angle.png" height="60">

Can you also determine the sign of the torsional angle?

Expand Down
76 changes: 26 additions & 50 deletions Project#02/README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,72 @@
# Project #2: Harmonic Vibrational Analysis

The purpose of this project is to extend your fundamental C-language programming techniques through a normal coordinate/harmonic vibrational frequency calculation. The theoretical background and a concise set of instructions for this project may be found [here](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/project2-instructions.pdf)
The purpose of this project is to extend your fundamental C-language programming techniques through a normal coordinate/harmonic vibrational frequency calculation. The theoretical background and a concise set of instructions for this project may be found [here](./project2-instructions.pdf)

We thank Dr. Yukio Yamaguchi of the University of Georgia for the original version of this project.

## Step 1: Read the Coordinate Data

The coordinate data are given in a format identical to that for [Project#1](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2301). The test case
The coordinate data are given in a format identical to that for [Project #1](../Project%2301). The test case
for the remainder of this project is the water molecule, optimized at the SCF/DZP level of theory. You can find the coordinates (in bohr) in the input directory.

## Step 2: Read the Cartesian Hessian Data

The primary input data for the harmonic vibrational calculation is the Hessian matrix,
which consists of second derivatives of the energy with respect to atomic positions.

```
EQUATION
F_{ij} = \frac{\partial^{2}V}{\partial q_i \partial q_j}
```
The Hessian matrix (in units of Eh/a02) can be downloaded here for the H2O test case.
<img src="./figures/hessian.png" height="50">

The Hessian matrix (in units of E<sub>h</sub>/a<sub>0</sub><sup>2</sup>) can be downloaded [here](./input/h2o_hessian.txt) for the H<sub>2</sub>O test case.
The first integer in the file is the number of atoms (which you should compare to the corresponding value from the geometry file as a test of consistency),
while the remaining values have the following format:

```
EQUATION
\begin{array}{ccc}
F_{x_1,x_1} & F_{x_1,y_1} & F_{x_1,z_1} \\
F_{x_1,x_2} & F_{x_1,y_2} & F_{x_1,z_2} \\
& \\
\ldots & \ldots & \dots \\
& \\
F_{x_2,x_1} & F_{x_2,y_1} & F_{x_2,z_1} \\
& \\
\ldots & \ldots & \ldots \\
\end{array}
```

* Hint 1: Reading the Hessian
<img src="./figures/hessian-file-format.png" width="200">

* [Hint 1](./hints/hint1.md): Reading the Hessian

## Step 3: Mass-Weight the Hessian Matrix

Divide each element of the Hessian matrix by the product of square-roots of the masses of the atoms associated with the given coordinates:

```
EQUATION
F^{M}_{ij} = \frac{F_{ij}}{\sqrt{m_i m_j}}
<img src="./figures/mass-weighted-hessian.png" height="50">

```
where m<sub>i</sub> represents the mass of the atom corresponding to atom *i*. Use atomic mass units (amu) for the masses, just as
for [Project #1](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2301).
for [Project #1](../Project%2301).

* Hint 2: Solution
* [Hint 2](./hints/hint2.md): Solution

## Step 4: Diagonalize the Mass-Weighted Hessian Matrix

Compute the eigenvalues of the mass-weighted Hessian:

```
EQUATION

F^{M}\mathbf{L} = \mathbf{L}\Lambda
```
<img src="./figures/diag-mass-weighted-hessian.png" height="20">

You should consider using the same canned diagonalization function
you used in [Project #1](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2301).
you used in [Project #1](../Project%2301).

* Hint 3: Solution
* [Hint 3](./hints/hint3.md): Solution

## Step 5: Compute the Harmonic Vibrational Frequencies

The vibrational frequencies are proportional to the squareroot of the eigenvalues of the mass-weighted Hessian:

```
EQUATION
\omega_{i}= {\rm_constant} \times \sqrt{\lambda_i}
```
<img src="./figures/vib-freq.png" height="25">

The most common units to use for vibrational frequencies is cm<sup>-1</sup>.

* Hint 4: Solution
* [Hint 4](./hints/hint4.md): Solution

## Reference
E.B. Willson, J.C. Decius, and P.C. Cross, *Molecular Vibrations*, McGraw-Hill, 1955.
E.B. Willson, J.C. Decius, and P.C. Cross, __Molecular Vibrations__, McGraw-Hill, 1955.

## Test Cases

* Water: [Coordinates](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/h2o_geom.txt)
| [Hessian](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/h2o_hessian.txt)
| [Output](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/output/h2o_vib_out.txt)
* Benzene: [Coordinates](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/benzene_geom.txt)
| [Hessian](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/benzene_hessian.txt)
| [Output](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/output/benzene_vib_out.txt)
* 3-chloro-1-butene: [Coordinates](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/3c1b_geom.txt)
| [Hessian](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/3c1b_hessian.txt)
| [Output](https://github.com/CrawfordGroup/ProgrammingProjects/blob/master/Project%2302/input/3c1b_vib_out.txt)
* Water: [Coordinates](./input/h2o_geom.txt)
| [Hessian](./input/h2o_hessian.txt)
| [Output](./output/h2o_vib_out.txt) (see the note at the bottom of [Hint 4](./hints/hint4.md))
* Benzene: [Coordinates](./input/benzene_geom.txt)
| [Hessian](./input/benzene_hessian.txt)
| [Output](./output/benzene_vib_out.txt)
* 3-chloro-1-butene: [Coordinates](./input/3c1b_geom.txt)
| [Hessian](./input/3c1b_hessian.txt)
| [Output](./output/3c1b_vib_out.txt)
Binary file added Project#02/figures/.DS_Store
Binary file not shown.
Binary file added Project#02/figures/diag-mass-weighted-hessian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Project#02/figures/hessian-file-format.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Project#02/figures/hessian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Project#02/figures/mass-weighted-hessian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Project#02/figures/vib-freq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Project#02/hints/hint1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The Hessian stored in memory should be a square matrix, while the format of the input file is rectangular. Understanding the translation between the two takes a bit of thinking. Here's a partial code block that works for this purpose:
```c++
...
FILE *hessian;
int natom;
...

double **H = new double* [natom*3];
for(int i=0; i < natom*3; i++)
H[i] = new double[natom*3];

for(int i=0; i < natom*3; i++) {
for(int j=0; j < natom; j++) {
fscanf(hessian, "%lf %lf %lf", &H[i][3*j], &H[i][3*j+1], &H[i][3*j+2]);
}
}
```
14 changes: 14 additions & 0 deletions Project#02/hints/hint2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
For the H<sub>2</sub>O test case, the 9×9 mass-weighted Hessian is:
```
1 2 3 4 5 6 7 8 9

1 0.0057996 0.0000000 0.0000000 -0.0115523 0.0000000 0.0000000 -0.0115523 0.0000000 0.0000000
2 0.0000000 0.0198271 0.0000000 0.0000000 -0.0394937 0.0199304 0.0000000 -0.0394937 -0.0199304
3 0.0000000 0.0000000 0.0175112 0.0000000 0.0086617 -0.0348807 0.0000000 -0.0086617 -0.0348807
4 -0.0115523 0.0000000 0.0000000 0.0510672 0.0000000 0.0000000 -0.0050452 0.0000000 0.0000000
5 0.0000000 -0.0394937 0.0086617 0.0000000 0.1716643 -0.0569527 0.0000000 -0.0143291 0.0224462
6 0.0000000 0.0199304 -0.0348807 0.0000000 -0.0569527 0.1258526 0.0000000 -0.0224462 0.0131055
7 -0.0115523 0.0000000 0.0000000 -0.0050452 0.0000000 0.0000000 0.0510672 0.0000000 0.0000000
8 0.0000000 -0.0394937 -0.0086617 0.0000000 -0.0143291 -0.0224462 0.0000000 0.1716643 0.0569527
9 0.0000000 -0.0199304 -0.0348807 0.0000000 0.0224462 0.0131055 0.0000000 0.0569527 0.1258526
```
12 changes: 12 additions & 0 deletions Project#02/hints/hint3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The eigenvalues of the mass-weighted Hessian for the H<sub>2</sub>O test case (in atomic units) are:
```
8 0.2351542439
7 0.2107113210
6 0.1317512832
5 0.0561123974
4 0.0547551476
3 0.0518216614
2 0.0000000000
1 0.0000000000
0 0.0000000000
```
13 changes: 13 additions & 0 deletions Project#02/hints/hint4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The harmonic vibrational frequencies for the H<sub>2</sub>O test case (in cm<sup>-1</sup>) are:
```
8 2492.7600
7 2359.6522
6 1865.8704
5 1217.6808
4 1202.8640
3 1170.1990
2 0.0210
1 0.0000
0 0.0000
```
Note that there are only three zero frequencies in this case when there should be six. This is because the structure used in the computation is not a stationary point on the potential energy surface, and thus the three “rotational frequencies” are non-zero.
Binary file added Project#02/project2-instructions.pdf
Binary file not shown.
Loading