This material has been prepared and made freely available by the financial support of National Science Foundation (CAREER, CHE-0844448 and CHE-1118616) and Camille and Henry Dreyfus Foundation, Inc. Any opinions, findings, and conclusions or recommendations expressed in this materials are those of the author and do not necessarily reflect the views of the sponsoring agencies. © So Hirata, University of Illinois at Urbana-Champaign.

 

CHM 548 PROGRAMMING HOMEWORK 1

(1) Write a program that solves the one-dimensional Schrödinger equation for an arbitrary bound potential using a finite-difference method.

(2) Solve the particle in a box problem numerically with this program and compare the results with the analytical solutions. Plot the wave functions if possible.

(3) Solve the particle in a finite depth well problem. Examine the degree of permeation of wave functions into the wall.

(4) Solve the particle in a box problem with a rectangular barrier in the middle. Observe the tunneling splitting of energies.

(5) Solve the harmonic and Morse oscillator problems. Compute Franck–Condon factors across two (displaced) potentials and simulate a vibrational progression in an electronic absorption spectrum.

 

PuTTY (download this program and use it to connect to a remote computer through secure shell)

LINUX tutorial (a common operating system for scientific computing)

Vi tutorial (a widely used text editor on Linux)

Fortran 90 tutorial

C/C++ tutorial

Numerical Recipes (theories and sample codes of numerical analysis)

Gnuplot (a graphics utility)

Software Carpentry (software engineering tutorials)

 

Fortran77/90/95

[sohirata@inferno ~]$ mkdir proj1

[sohirata@inferno ~]$ cd proj1

[sohirata@inferno ~/proj1]$ cp /mnt/people/sohirata/chem548/oned/tqli.f .

[sohirata@inferno ~/proj1]$ cp /mnt/people/sohirata/chem548/oned/sort.f .

[sohirata@inferno ~/proj1]$ cp /mnt/people/sohirata/chem548/oned/pythag.f .

[sohirata@inferno ~/proj1]$ vi oned.f

[sohirata@inferno ~/proj1]$ ls

oned.f  pythag.f  sort.f  tqli.f

[sohirata@inferno ~/proj1]$ ifort oned.f pythag.f sort.f tqli.f

[sohirata@inferno ~/proj1]$ ls

a.out  oned.f  pythag.f  sort.f  tqli.f

[sohirata@inferno ~/proj1]$ a.out

 mass =    100.000000000000

 analytical

           1  4.934825280000000E-002

           2  0.197393011200000

           3  0.444134275200000

           4  0.789572044800000

           5   1.23370632000000

 numerical

           1  4.740917256227306E-002

           2  0.189590824936438

           3  0.426407405556491

           4  0.757629809675279

           5   1.18293760100845

 

C/C++

[sohirata@inferno ~]$ mkdir proj1

[sohirata@inferno ~]$ cd proj1

[sohirata@inferno ~/proj1]$ cp /mnt/people/sohirata/chem548/oned/tqli.f .

[sohirata@inferno ~/proj1]$ cp /mnt/people/sohirata/chem548/oned/sort.f .

[sohirata@inferno ~/proj1]$ cp /mnt/people/sohirata/chem548/oned/pythag.f .

[sohirata@inferno ~/proj1]$ vi oned.c

[sohirata@inferno ~/proj1]$ icc -c oned.c

[sohirata@inferno ~/proj1]$ ifort -c pythag.f sort.f tqli.f

[sohirata@inferno ~/proj1]$ ls

oned.c  oned.f  oned.o  pythag.f  pythag.o  sort.f  sort.o  tqli.f  tqli.o

[sohirata@inferno ~/proj1]$ icc -L/opt/intel/Compiler/11.1/064/lib -lifcore oned.o sort.o tqli.o pythag.o

/opt/intel/Compiler/11.1/064/lib/intel64/libimf.so: warning: warning: feupdateenv is not implemented and will always fail

[sohirata@inferno ~/proj1]$ a.out

mass = 100.000000

analytical

1    0.0493482528

2    0.1973930112

3    0.4441342752

4    0.7895720448

5    1.2337063200

numerical

1    0.0474091726

2    0.1895908249

3    0.4264074056

4    0.7576298097

5    1.1829376010