Você está na página 1de 119

Finding the Energy Spectrum of the Quantum Hindered

Rotor by the Lanczos Method


by
George Hang
Submitted to the Department of Physics and Astronomy
in partial fulllment of the requirements for the degree of
Bachelor of Arts in Physics
at
SWARTHMORE COLLEGE
June 2007
c _George Hang, MMVII. All rights reserved.
The author hereby grants to Swarthmore College permission to
reproduce and distribute publicly paper and electronic copies of this
thesis document in whole or in part.
Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Department of Physics and Astronomy
March 19, 2007
Certied by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Amy L. R. Bug
Professor
Thesis Supervisor
Accepted by. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Carl H. Grossman
Chair, Department of Physics and Astronomy
Finding the Energy Spectrum of the Quantum Hindered Rotor by the
Lanczos Method
by
George Hang
Submitted to the Department of Physics and Astronomy
on March 19, 2007, in partial fulllment of the
requirements for the degree of
Bachelor of Arts in Physics
Abstract
In this thesis, the phenomenon of tunnel splitting in quantum hindered rotors is ex-
amined in detail. The mathematical basis for Lanczos methods, a family of algorithms
ecient for nding extremal eigenvalues in a sparse Hermitian matrix, is investi-
gated. An implementation of the block Lanczos method with total orthogonalization
in FORTRAN 77 is upgraded and redesigned in modern FORTRAN 95. Benchmarking
against analytical solutions and literature values suggest that the code is robust and
the computational results show quantitative tunnel splitting results that match the
qualitative predictions from quantum theory.
Thesis Supervisor: Amy L. R. Bug
Title: Professor
Acknowledgments
To my family and friends for everything I have been and will be.
To my advisor Professor Amy Bug for all the wonderful advice and her innite
patience.
To Ishmael Jennifer Barry, Nathaniel Donnie Erb-Satullo, and Michelle gwnn
Tomasik for entertainment and encouragement throughout the research process.
To my friend and former roommate Alexandr Pshenichkin for program redesign
concepts and programming tricks.
To Professor John Boccio for teaching me everything I have learned about quan-
tum mechanics.
To the Howard Hughes Medical Institute and its Undergraduate Summer Re-
search Fellowship program and the Oce of the Provost at Swarthmore College for
making this research possible.
Contents
1 Introduction 10
1.1 Hydrogen Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2 Neutron Scattering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 Organization of Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2 Quantum Rigid Rotor 19
2.1 Eigenspectrum of a Free Rotor . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 Hindered Rotor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3 Tunnel Splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4 Rotational Tunnel Splitting . . . . . . . . . . . . . . . . . . . . . . . . . 32
3 Lanczos Methods 37
3.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Rayleigh Quotient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 Lanczos Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.4 Termination, Error, and Limitations . . . . . . . . . . . . . . . . . . . . 44
3.5 Lanczos Toy Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.6 Trotter Approximations . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4 Methods 55
4.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.2 FORTRAN 77 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4
CONTENTS Hang 5
4.2.2 Complex Fast Fourier Transform . . . . . . . . . . . . . . . . . 58
4.2.3 Pseudo-Random Number Generators . . . . . . . . . . . . . . . 62
4.3 FORTRAN 95 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.3.1 Design Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.3.2 Derived Type and Data Encapsulation . . . . . . . . . . . . . . 66
4.3.3 Interface and Function Overloading . . . . . . . . . . . . . . . . 68
4.3.4 Arrays in FORTRAN 95 . . . . . . . . . . . . . . . . . . . . . . . 71
5 Results 74
5.1 Free Rotor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.2 Librator Potential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.3 Rotor Potentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.3.1 Out-of-plane Hindrance . . . . . . . . . . . . . . . . . . . . . . 78
5.3.2 In-plane Hindrance . . . . . . . . . . . . . . . . . . . . . . . . . 81
6 Conclusions 86
A Associated Legendre Polynomials 88
B Code 90
B.1 Modules and External Routines . . . . . . . . . . . . . . . . . . . . . . 90
B.1.1 datatype mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
B.1.2 input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
B.1.3 fft mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
B.1.4 overlap mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
B.1.5 prop mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
B.1.6 trans mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
B.1.7 gasleg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
B.1.8 zbes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
B.2 Central Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
B.2.1 estates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
B.2.2 lanch2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
B.2.3 gett . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
B.2.4 upn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
B.2.5 fourier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
B.2.6 getProp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
B.2.7 fullProp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
B.2.8 trans p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
B.2.9 sltb and sltf . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
References 114
Glossary 118
Index 119
List of Figures
1-1 IINS Data (Nicol, et. al. 1) . . . . . . . . . . . . . . . . . . . . . . . . . 13
1-2 IINS Data (Nicol, et. al. 2) . . . . . . . . . . . . . . . . . . . . . . . . . 14
1-3 Energy Level Predictions from Nicol, et. al. . . . . . . . . . . . . . . . . 14
1-4 Ligand Stucture Model from Eckert and Kubas . . . . . . . . . . . . . . 15
1-5 IINS Data (Eckert and Kubas) . . . . . . . . . . . . . . . . . . . . . . . 16
1-6 IINS Data (Rowsell, et. al.) . . . . . . . . . . . . . . . . . . . . . . . . . 17
2-1 Potential of Curl, et. al. (V
0
= 10) . . . . . . . . . . . . . . . . . . . . . 24
2-2 Librator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2-3 Potential of MacRury and Sams ( = 10) . . . . . . . . . . . . . . . . . 26
2-4 Potential of MacRury and Sams ( = 10, = 16) . . . . . . . . . . . . . 27
2-5 Solution to Potential Well with Dirac-Delta Barrier . . . . . . . . . . . 30
2-6 Energy Levels of Curl Potential . . . . . . . . . . . . . . . . . . . . . . 34
2-7 Energy Levels of MacRury and Sams Potential . . . . . . . . . . . . . . 35
4-1 Input for FFTPACK5 Testing . . . . . . . . . . . . . . . . . . . . . . . . . 60
4-2 Fourier Transform Testing Using FFTPACK5 . . . . . . . . . . . . . . . . 60
4-3 Fourier Transform Testing Using FFTPACK5 (close-up) . . . . . . . . . . 61
4-4 Inverse Fourier Transform Testing Using FFTPACK5 . . . . . . . . . . . 61
4-5 Subroutine Call Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5-1 Free Rotor Solution E
1
. . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5-2 Free Rotor Solution E
3
. . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5-3 Fractional Error of E
0
in Curl Potential . . . . . . . . . . . . . . . . . . 76
7
LIST OF FIGURES Hang 8
5-4 Fractional Error of E
8
in Curl Potential . . . . . . . . . . . . . . . . . . 77
5-5 Tunnel Splitting of the First Two Eigenstates . . . . . . . . . . . . . . . 81
5-6 Ground State Eigenfunction . . . . . . . . . . . . . . . . . . . . . . . . 82
5-7 Ground State Eigenfunction . . . . . . . . . . . . . . . . . . . . . . . . 82
5-8 Ground State Eigenfunction . . . . . . . . . . . . . . . . . . . . . . . . 83
5-9 Ground State Eigenfunction . . . . . . . . . . . . . . . . . . . . . . . . 84
5-10 Ground State Eigenfunction . . . . . . . . . . . . . . . . . . . . . . . . 84
5-11 Ground State Eigenfunction . . . . . . . . . . . . . . . . . . . . . . . . 85
5-12 Degeneracy of J = 1 States . . . . . . . . . . . . . . . . . . . . . . . . . 85
List of Tables
3.1 Extremal Eigenvalues with q
1
=r
1
. . . . . . . . . . . . . . . . . . . . . 49
3.2 Extremal Eigenvalues with q
1
=r
3
. . . . . . . . . . . . . . . . . . . . . 50
5.1 Comparison with Direct Diagonalization and 2nd Order TIPT for = 1 79
5.2 Comparison with Direct Diagonalization and 2nd Order TIPT for = 5 80
5.3 Comparison with Direct Diagonalization and 2nd Order TIPTfor =10 80
9
Chapter 1
Introduction
1.1 Hydrogen Storage
As fossil fuels become increasing scarce and problematic for the environment, the
search for alternative energy sources becomes increasingly urgent. Some of these al-
ternative energy sources utilize molecular hydrogen. However, the hydrogen molecule,
being both small and volatile, requires ecient and inexpensive means of storage Ef-
cient is quantied in the current U.S. Department of Energy FREEDOMCAR ini-
tiative as 4.5 percent usable hydrogen by weight and as 4 USD per kWh.
1
Much of
current research is directed toward this goals, with a focus on reversible chemical
processes
2
or physical adsorption onto metal-organic surfaces and frameworks
36
and within porous materials.
710
In this thesis, I have redesigned a computational tool that can nd the energy
levels of molecular hydrogen modelled as a rigid rotor in an anisotropic potential.
This computational tool can contribute to the development of hydrogen storage tech-
niques in several ways. An important one is that by computing the energy levels of
molecular hydrogen at dierent points on a surface, one can predict the structure of
locations where hydrogen is most likely to be adsorbed by nding the most energet-
ically favorable sites. Thus, allowing researchers to direct their eorts into creating
materials with such adsorption site. Another important consideration is that in order
to determine that molecular hydrogen is indeed stored in a material, one needs to
10
1.1. HYDROGEN STORAGE Hang 11
probe the materials via techniques such as spectroscopy or neutron scattering. Hav-
ing a computational tool that predicts excited rotational levels of adsorbed molecular
hydrogen can be useful in explaining experimental data, and in relating these levels to
the structure of barriers where the hydrogen molecule is situated.
1.2. NEUTRON SCATTERING Hang 12
1.2 Neutron Scattering
One useful method to probe hydrogen in materials is via neutron scattering. The
specic technique of interest involves an almost monochromatic neutron beam di-
rected at a sample and analysis of the energy change of the neutrons after scattering.
The specic inelastic neutron scattering considered is called incoherent inelastic neu-
tron scattering because the signal rises from independent scattering centers.
11
The
technique incoherent inelastic neutron scattering (IINS) is commonly used in nding
vibrational energy states (phonons) of materials. However, it is also very capable of
nding rotational states of rotational systems.
Because the energy change in the neutron beam corresponds to the excitation or
de-excitation of particles in the sample, it can be used to discern energy levels of
molecular hydrogen. While optical spectroscopy also allows one to observe energy
levels, neutron scattering can observe some transitions that optical spectroscopy can-
not, and vice versa. Unlike photons, neutrons can interact with the nuclei and change
the nuclear spin state of the molecule. This spin change is critical because in many
potentials of interest, pairs of energy states can have dierent parity. Therefore, an
excitation involving a change in parity, such as a change in the nuclear spin state, is
necessary. In particular, tunnel splitting pairs have dierent parity, as addressed in
Section 2.4.
The dierential cross section of a particle is proportional to the rate of transition
into a particular nal state.
12;13
Therefore, by using Fermis golden rule,
d
d
[ f [

M[i)[
2
, (1.1)
where [ f ) denotes the nal state, [i) denotes the initial state, and

M is the interaction
Hamiltonian.
12;13
Eq. 1.1 shows that the dierential cross section is proportional to
the magnitude squared of the matrix element of the interacting Hamiltonian. Because
hydrogen nuclei is fermionic, the total wavefunction must be antisymmetric under ex-
change of the nuclei. Note that [ f ) and [i) are states that are the total wavefunction
in position basis. Therefore, for transitions between states of dierent parity, this ma-
1.2. NEUTRON SCATTERING Hang 13
trix element has to be 0 unless a parity change occurs. Because interactions between
the neutron and the nuclei allow for such parity change in the nuclear wave func-
tion, the transition between tunnel splitting pairs, since they have dierent parity,
can only be observed when the parity of the nuclear spin can be changed to maintain
the overall odd parity.
To illustrate the usefulness of IINS in the detection of molecular hydrogen in
materials, consider the experiment by Nicol, et. al.
14
. In this experiment, the IINS
spectrum was collected for molecular hydrogen in cobalt A zeolite at 12 K in the 12
40 meV range. Fig. 1-1 shows the spectrum on the 12 meV range, where positive
energy denotes neutron energy loss.
Figure 1-1: IINS data on the 12 meV range of 0.5 molecule of hydrogen per supercage
adsorbed on CoNaA zeolite at 12K. Positive energy denotes neutron energy loss. From
Nicol, et. al.
14
Here notice that a pair of peaks of nearly equal height occurs at 3.8 meV. The
existence of a pair of peaks suggest that excitation and deexcitation occurs between
a pair of states.
Fig. 1-2, also from Nicol, et. al., shows a broad peak around 27.5 meV. From these
data, Nicol, et. al. were able to assign a transition between the ground and rst excited
state to the 3.8 meV transition by comparison with theoretical calculations shown in
1.2. NEUTRON SCATTERING Hang 14
Figure 1-2: IINS spectrum on the 1040 meV range of 0.5 molecule of hydrogen per su-
percage adsorbed on CoNaA zeolite at 12K. Positive energy denotes neutron energy loss.
From Nicol, et. al.
14
Fig. 1-3. Using these theoretical results they were able to show that the broader
transition centered at 27.5 meV are actually two peaks at 27.2 and 30.9 meV that
were not resolved.
Figure 1-3: Energy levels in a double minimum potential in of the form
V
2
(1 cos2)
investigated prior by Curl, et. al.
15
. The energy levels and potential barrier are given in units
of rotational constant B. From Nicol, et. al.
14
1.2. NEUTRON SCATTERING Hang 15
Another example of a useful application of IINS is the experiment by Eckert and
Kubas
16
. Here, Eckert and Kubas modeled the dihydrogen ligand as a rigid rotor
rotating in-plane in a 2-fold symmetric potential, shown in Fig. 1-4, expanded to the
rst two terms in a Fourier series as
V() =
1
2
V
2
(1cos2) +
1
2
V
4
(1cos4) (1.2)
where the V
2
appears to be the dominant characteristic and V
4
corrects for the ligand
stucture and temperature dependence.
16
Figure 1-4: Top shows a schemetic of the ligand stucture and bottom shows a double minimal
potential in of the formV =V
0
cos
2
. From Eckert and Kubas.
16
Using this model, Eckert and Kubas were able to demonstrate that other ligands
around a central atom indeed aect the dynamics of the dihydrogen ligand as shown
in Fig. 1-5 where the tunnel splitting energy is aected signicantly by the change of
a pair of ligands.
Afurther example of IINS being useful in experiments is the experiment by Rowsell,
Eckert, and Yaghi.
6
Rowsell, et. al. modeled the potential of hydrogen physadsorp-
tion sites as in-plane barriers as in the investigation by Nicol, et. al. and used their
model to identify adsorption sites in multiple neutron scattering signals as shown in
1.2. NEUTRON SCATTERING Hang 16
Figure 1-5: IINS spectrum of [RuH(
2
H
2
)PP
3
]
+
(top) and RuH
2
(
2
H
2
)
2
(PCy
3
)
2
(bot-
tom). From Eckert and Kubas.
16
Fig. 1-6. These signals corresponded to not only one potential barrier, but multiple
potential barriers, suggesting that there are multiple physadsorption sites.
These experiments employed IINS to reveal much about the behavior of hydrogen
in solids. In particular, they are used to help one understand the dynamics of the sys-
tem: from chemical bonding of a dihydrogen ligand to the physisorption of hydrogen
molecule to metal-organic frameworks. Understanding the phenomenon of tunnel
splitting, as discussed in the following chapter, allows one to better interpret and an-
alyze neutron scattering results and allow one to probe deeper into the behavior of
hydrogen.
1.2. NEUTRON SCATTERING Hang 17
Figure 1-6: IINS spectrum of various metal-organic frameworks (MOF) at 4 H
2
per formula
unit. From Rowsell, et. al.
6
1.3. ORGANIZATION OF THESIS Hang 18
1.3 Organization of Thesis
The physical system of interest, quantum rigid rotors, and the phenomenon of inter-
est, tunnel splitting, are addressed in Chapter 2. A particular ecient algorithm for
solving large sparse symmetric matrices, the Lanczos method, is examined in Chap-
ter 3. The design and implementation of the FORTRAN code are explained in Chap-
ter 4. The results of the code are presented and discussed in Chapter 5. Chapter 6
contains some concluding remarks, and supplementary information can be found in
the appendices.
Chapter 2
Quantum Rigid Rotor
2.1 Eigenspectrum of a Free Rotor
The time independent Schr odinger equation for a rotor is given by
12

H[) = E[) , (2.1)


where

H =

L
2
2I
,

L is the total orbital angular momentum operator, and I is the moment
of inertia.
In quantum mechanics, as in the case for classical mechanics, nite rotations do
not necessarily commute. The commutation relation between the angular momentum
operator in dierent components is expressed as
_

J
j
,

J
k
_
= i
j kl

J
l
. (2.2)
The total angular momentum, however, commutes with the each component, which
yields the commutation relation
_

J
2
,

J
i
_
= 0 (2.3)
for all i 1, 2, 3. By convention,

J
1
is denoted by

J
x
,

J
2
by

J
y
, and

J
3
by

J
z
. By the
commutation relations above and the Hermitian property,

J
2
and

J
i
for any i share
19
2.1. EIGENSPECTRUM OF A FREE ROTOR Hang 20
a complete set of eigenvectors. To nd the eigenvalues of these operators, let the
complete set of eigenvectors be labelled [a, b) such that

J
2
[a, b) =
2
a[a, b) (2.4)

J
z
[a, b) = b[a, b) . (2.5)
Noting that

J
2
=

J
2
x
+

J
2
y
+

J
2
z
(2.6)
then consider two operators

J
+
and

J

, raising and lowering operators, dened as

=

J
x
i

J
y
. (2.7)
Using these known properties, further commutation relations involving the raising
and lowering operators can be derived. It can be shown that
12;17
_

J
2
,

J

_
= 0 (2.8)
_

J
+
,

J

_
= 2

J
z
(2.9)
_

J
z
,

J

_
=

J

. (2.10)
To demonstrate that

J

are indeed raising and lowering operators, consider



J
z

J

acting on [a, b). Using commutation relations, then

J
z
(

J

[a, b)) = (

J


J
z

)[a, b) (2.11)
= (b 1)(

J

[a, b)) . (2.12)


Observe that

J

[a, b) is an eigenstate of

J
z
with eigenvalue (b 1), implying that

J

raises and lowers the quantum number b. Note also that



J

commutes with

J
2
, which
2.1. EIGENSPECTRUM OF A FREE ROTOR Hang 21
yields

J
2

J

[a, b) =

J


J
2
[a, b) (2.13)
=
2
a

J

[a, b) , (2.14)
which implies that the raising and lowering operators do not eect the a quantum
number. Thus, the raising and lowering operators aect only the quantum number b.
It can be demonstrated that there must exist b
min
and b
max
such that a raising op-
erator operating on [a, b
max
) will yield 0 and similarly a lowering operator operating
on [a, b
min
) will yield 0. This is shown by the fact that

J
2


J
2
z
0. Therefore,
a, b[

J
2


J
2
z
[a, b) =
2
(ab
2
) (2.15)
0 , (2.16)
which implies that a b
2
, or that b is bounded by a such that a maximum and mini-
mum value exists. Observe that

J
+

J

=

J
2


J
2
z
+

J
z
(2.17)


J
+
=

J
2


J
2
z


J
z
(2.18)
by using the denition of the raising and lower operators. Assuming that

J
+
[a, b
max
) =
0, then

J


J
+
[a, b
max
) = 0. Therefore, by Eq. 2.17,
_

J
2


J
2
z
+

J
z
_
[a, b
max
) = (ab
2
max
b
max
)[a, b
max
) (2.19)
which implies that a = b
max
(b
max
+1). Similarly, the assumption

J

[a, b
min
) = 0 and
Eq. 2.18 together yield the result that a = b
min
(b
min
1). By comparison, it can be
shown that b
max
= b
min
. By convention b
max
is denoted j , and instead of using
quantum number a to denote eigenstates, one uses j and note that a and j are related
by a = j ( j +1). Further, by convention, instead of denoting the eigenvalues of

J
z
b,
they are denoted m. Rewriting existing relations using j and m instead of a and b,
2.1. EIGENSPECTRUM OF A FREE ROTOR Hang 22
then

J
2
[ j , m) =
2
j ( j +1)[ j , m) (2.20)

J
z
[ j , m) = m[ j , m) . (2.21)
The eigenstates of

J
2
are indexed by j and are given as a multiple of j ( j +1) and have
degeneracy of 2 j +1 to account for the possible range of m values.
The time independent Schr odinger equation for a free rotor, as claimed before,
has the form
1
2I

L
2
(, ) = E(, ) . (2.22)
Notice that

L is orbital angular momentum, and the results derived above for general
angular momentum apply. Thus, Eq. 2.22 has energy eigenvalues E =

2
2I
l (l +1) as
illustrated above, and has degeneracy of 2l +1. The constant

2
2I
is commonly denoted
B, known as the rotational constant.
In the position representation of the spherical coordinate basis, Eq. 2.22 becomes
12;17

2
2I
_
1
sin

+
1
sin

2
_
(, ) = E(, ) . (2.23)
The solutions to Eq. 2.23 can be obtained analytically, and are known as the spherical
harmonics given below
12;17
Y
l m
(, ) = (1)
m

_
2l +1
4
_
(l m)!
(l +m)!
P
m
l
(cos)e
im
(m 0) (2.24)
Y
l m
= (1)
m
_
Y
l ,m

(m < 0) (2.25)
where P
m
l
are the Legendre polynomials.
The results above outline some important features of the quantum free rotor sys-
tem. First, the eigenfunctions are delocalized; in the sense that the wave function
has a nonzero amplitude over a large portion of angle space (rather than having a
2.1. EIGENSPECTRUM OF A FREE ROTOR Hang 23
near zero amplitude over a large portion of angle space). Second, the eigenfunctions,
except for the ground state l = 0, m = 0, are not a at uniform distribution either.
Rather, the probability distributions from the degenerate eigenfunctions for a partic-
ular l value sum to a uniform spherical distribution to achieve isotropy. (Indeed, it
makes sense that if one only knows the total angular momentum without making an
angular momentummeasurement along a particular axis, the distribution is isotropic.)
Finally, the eigenfunctions are quantized because of periodic boundary conditions,
which dierentiates rotational systems and translational systems; while a free par-
ticle has continuous position and momentum eigenvalues and has discrete solutions
only when bounded in a potential,
12
a free rotor can only have quantized solutions
even in the absence of any potential.
2.2. HINDERED ROTOR Hang 24
2.2 Hindered Rotor
In contrast to the free rotor system where a quantum rotor is not in a potential, the
hindered rotor system contains an anisotropic potential. As opposed to a free ro-
tor system, the eigenstates in a hindered rotor system may have dierent localization
properties. This thesis examines three potentials in detail: rst, a potential that is at-
tractive at two poles but repulsive at the equator; second, a potential that is repulsive
at the poles but attractive at the equator; and third, a potential that is repulsive at the
poles and has barriers in the plane of the equator.
The rst kind of potential has been investigated by Curl, et. al.,
15
where a poten-
tial of the form
V =
V
0
2
(1cos
2
) , (2.26)
as shown in Fig. 2-1, was used.
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Potential of Curl, et. al. (V
0
= 10)
Potential
4
3
2
1
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

0.0000
0.5000
1.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
5.0000
potential (B)
Figure 2-1: Potential investigated by Curl, et. al. as shown in Eq. 2.26 with V
0
= 10.
When the potential is such that a quantum rotor cannot rotate in the plane that
2.2. HINDERED ROTOR Hang 25
contains the rotor, the rotor is called a librator. In librational motion in classical
mechanics, the two ends of the rotor rotate in two separate planes as shown in Fig. 2-
2. Observe that the two ends of the rotor cannot exchange places without tunnelling
through a barrier. An example of quantum tunnelling in one dimension and a more
detailed treatment can be found in Section 2.3. Here, it is important to note that in
the case of high barriers, the low energy eigenfunctions will be highly localized in the
regions of low potential and high energy states will be less localized.
Figure 2-2: An example of a librator in classical mechanics. Illustration from Thornton and
Marion.
18
The second type of potential of interest, where the potential is repulsive at the
poles and attractive at the equator, has been investigated by MacRury and Sams,
19
where a potential of the form
V =V
0
cos
2
(2.27)
is used, as shown in Fig. 2-3.
While there is a hindering potential, the rotor can rotate in the plane containing
the rotor itself. In this thesis, nonlibrational rotors will be referred to as rotors unless
specic clarication is necessary. In these kind of potentials, because the rotor can
rotate in the plane that contains itself, the two ends can exchange position without
2.2. HINDERED ROTOR Hang 26
0
1
2
3
4
5
6
7
8
9
10
Potential of MacRury and Sams ( =10)
Potential
10
8
6
4
2
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

0.0000
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
10.0000
potential (B)
Figure 2-3: Potential investigated by MacRury and Sams in Eq. 2.27 with V
0
= is in units
of rotational constant B.
tunnelling. The implications of this will be addressed in detail in Section 2.4.
The third case, where the potential is repulsive at the poles with barriers in the
plane of the barrier, has been addressed by MacRury and Sams also,
19
where a poten-
tial
V =V
0
cos
2
+V
1
(1cos
2
2) (2.28)
is used as shown in Fig. 2-4.
Observe that this potential has two-fold symmetry in , which is the minimum
symmetry necessary for the investigation of a homonuclear diatomic molecule such as
hydrogen. Note that in this case there is both an out-of-plane and in-plane hindrance
that prevents the rotor from rotating freely. Similar to the case of the Curl potential,
when the barrier is high, the low energy eigenfunctions are highly localized at regions
where the potential is lower. Note further that these highly localized eigenfunctions
are almost vanishing at regions of high potential. This last observation has a profound
2.2. HINDERED ROTOR Hang 27
0
5
10
15
20
25
30
Potential of MacRury and Sams (=10, =16)
Potential
25
20
15
10
5
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

0.0000
5.0000
10.0000
15.0000
20.0000
25.0000
30.0000
potential (B)
Figure 2-4: Potential investigated by MacRury and Sams in Eq. 2.28 where V
0
= andV
1
=
are both in units of rotational constant B.
eect on the energy dierence between highly localized states, which is addressed in
the following sections.
2.3. TUNNEL SPLITTING Hang 28
2.3 Tunnel Splitting
Recall from discussions that that in certain cases when quantum tunnelling occurs
across high potential barriers, eigenfunctions are highly localized at regions of poten-
tial, and that the eigenfunction is almost vanishing at these high potential barriers.
Under certain circumstances, such systems can exhibit a phenomenon where two
eigenstates have energy close to one another and their wavefunctions appear simi-
lar but dier in terms of sign across the barrier. This phenomenon is called tunnel
splitting.
To illustrate the phenomenon of tunnel splitting, consider an innite square well
with a Dirac-delta barrier in the middle
20
, as given by the potential
V(x) =
_

_
x a ,
V
0
(x) a < x < a ,
a x ,
(2.29)
where V
0
and a are positive real numbers. Let
I
(x) denote the wave function in the
region a < x < 0 and let
II
(x) denote the wave function in the region 0 < x < a.
The solution to the Schr odinger equation is given in the form

I
(x) = Acos(kx) +Bsin(kx) (2.30)

II
(x) =Ccos(kx) +Dsin(kx) , (2.31)
where k
2
=
2mE

2
.
The boundary conditions are given by

I
(0) =
II
(0) (2.32)

II
x

x=0

I
x

x=0
=
2mV
0

2

I
(0) =
2mV
0

2

II
(0) (2.33)

I
(a) = 0 (2.34)

II
(a) = 0 . (2.35)
2.3. TUNNEL SPLITTING Hang 29
Solving for the boundary conditions then,
A =C (2.36)
(DB)k =
2mV
0

2
A (2.37)
Acos(ka) Bsin(ka) = 0 (2.38)
Ccos(ka) +Dsin(ka) = 0 . (2.39)
Subtracting Eq. 2.38 from Eq. 2.39 yields
(D +B)sin(ka) = 0 , (2.40)
which suggests that either sin(ka) = 0 or D +B = 0.
In the case that sin(ka) = 0, then cos(ka) ,= 0, and by Eq. 2.38 A = 0. Further, by
invoking Eq. 2.37, then B = D and the eigenfunctions are simply sine functions with
angular frequency k. The energy eigenvalues are
E
n
=

2
2m
(n)
2
a
2
, (2.41)
where n = 1, 2, 3, . . ..
In the other case that D+B =0, then D =B. Using Eq. 2.38, then A=Btan(ka).
Substituting for A in Eq. 2.37 yields that
k =
mV
0

2
tan(ka) . (2.42)
Eq. 2.42 is a transcendental equation and cannot be solved analytically. However, it
can be solved graphically by considering dimensionless quantities. Dene z =ka, then
substitution results in

2
amV
0
z = tanz . (2.43)
2.3. TUNNEL SPLITTING Hang 30
For simplicity, dene V
0
=
2mV
0

2
and E =
2mE

2
. Thus, Eq. 2.43 becomes
2
aV
0
z = tanz . (2.44)
While Eq. 2.44 has no analytical solution, it can be solved numerically or graphically
as shown in Fig. 2-5.
12;17
-6.283
-4.712
-3.142
-1.571
0.000
0 1.5708 3.14159 4.71239 6.28319 7.85398 9.42478 10.9956
z
Solution to Potential Well with Dirac-Delta Barrier
tan z
z/100
z/10
z/2
z
Figure 2-5: Graphs of tanz and
2
aV
0
z, the two sides of Eq. 2.44, are plotted for various values
of
2
aV
0
.
From the graphical solutions in Fig. 2-5, it is clear that as aV
0
approaches innity,
the spectrum of z approaches , 2, 3, . . .. Observe that the odd solutions (the sine
functions) in units of

2
2m
have an energy spectrum of
(n)
2
a
2
as given in Eq. 2.41, while
the even solutions (cosine functions with a symmetric dip at x = 0) in units of

2
2m
are
given by E = k
2
=

2
n
a
2
, where
n
are the solutions to Eq. 2.44 shown as the intersec-
tions in Fig. 2-5. As the delta potential becomes stronger, the energy spectrum of the
even and odd solutions become closer and closer and in the extreme case when the
delta potential has innite strength, all the energy states are degenerate. When the
delta barrier strength is great but not innite, there is a small splitting of energy
2.3. TUNNEL SPLITTING Hang 31
eigenvalues because the wave function is identically zero for odd wave functions and
is almost vanishing for even wave functions. If one were to examine the probability
distribution of the particle, the even and odd case look remarkably similar. Therefore,
it makes sense that their energy levels are not very dierent from one another.
2.4. ROTATIONAL TUNNEL SPLITTING Hang 32
2.4 Rotational Tunnel Splitting
The previous example, tunnel splitting in a one dimensional system, the dierent par-
ity of the states plays an important role in the existence of tunnel splitting pairs. In
the three quantum rotor systems concerned in this thesis, parity of states plays an
important role similarly. In order to understand these rotational systems, however,
one must return briey to the Schr odinger equation.
The state of a hydrogen molecule can be characterized by the state of several dif-
ferent systems, such as translational motion of the center of mass, rotation about the
center of mass, etc. Assuming that translational, rotational, and vibrational motion
are all decoupled and that they do not eect the nuclear and electronic states, then
the total Hamiltonian can be written as
21

H
total
=

H
trans
+

H
rot
+

H
vib
+

H
nucl
+

H
elec
, (2.45)
where the total Hamiltonian is simply the sum of the of the translational, rotational,
vibrational, nuclear, and electronic Hamiltonian, each acting on a dierent subspace.
The eigenstates, therefore, can be expressed as a direct product
[
total
) =[
trans
)[
rot
)[
vib
)[
nucl
)[
elec
) (2.46)
Because the hydrogen nuclei are fermions, the overall state function must be antisym-
metric under exchange of the identical particles.
21
This means that if the rotational
wave function changes parity, an odd number of other wave functions need to change
parity also to maintain the antisymmetry of the overall wave function. Experimen-
tally, this is easiest controlled and achieved by changing the parity of the nuclear spin
states, as mentioned in Chapter 1.
Protons, the nuclei of hydrogens, are spin
1
2
particles. The possible total nuclear
2.4. ROTATIONAL TUNNEL SPLITTING Hang 33
spin states for molecular hydrogen, then, are given by quantum mechanics
12;17
[s = 0, m
s
= 0) =
1

2
([+)
1
[)
2
[)
1
[+)
2
) (2.47)
[s = 1, m
s
= 0) =
1

2
([+)
1
[)
2
+[)
1
[+)
2
) (2.48)
[s = 1, m
s
= 1) =[+)
1
[+)
2
(2.49)
[s = 1, m
s
=1) =[)
1
[)
2
. (2.50)
The single s =0 state is the singlet state with odd parity and the three s =1 states are
the triplet states with even parity. Therefore, by controlling the parity of the nuclear
spin state, the allowed rotational transitions can be controlled also.
Because tunnel spitting transitions involve a change in parity as shown in the pre-
vious section and because the overall wave function must maintain the same parity,
direct observation of tunnel splitting transition is only possible when an odd num-
ber of the non-rotational eigenstates change parity also. Inelastic incoherent neutron
scattering, for example, as shown in Section 1.2 allows a change in nuclear spin state
parity and allows one to observe tunnel splitting transitions directly.
11;22
To illustrate that in rotational systems the tunnel splitting pairs are of dierent
parity just as in the one dimensional case, consider the energy levels of the potential
investigated by Curl, et. al. in Eq. 2.26. The energy levels as a function of barrier
height are tabulated by Curl, et. al. and a graph of some of their results is shown
below.
One notable pattern is that states with the same [m[ value pair up to form a tunnel
splitting pair. Each tunnel splitting pair still has parity dierence since states with
odd l pairs up with ones with even l . Also, note that this potential does not separate
out all the degeneracy in m, but rather separates the dierent [m[, which is sensible
because the potential does not vary in . A specic pair of states that can be used
to illustrate this are the l = 0, m = 0 and the l = 1, m = 0 states that approach one
another. The free rotor solution for l = 0, m = 0 is a uniform distribution in .
However, because of the potential that has a peak at =

2
and valleys at =0 and =
2.4. ROTATIONAL TUNNEL SPLITTING Hang 34
0.0
5.0
10.0
15.0
20.0
25.0
30.0
35.0
40.0
0 10 20 30 40 50
E
n
e
r
g
y

(
B
)
V
0
(B)
Energy Spectrum in Potential Used by Curl, et. al.
l = 0, m = 0
l = 1, m = 0
l = 1, m = 1
l = 2, m = 1
l = 2, m = 0
l = 2, m = 2
l = 3, m = 0
Figure 2-6: Energy levels of the potential used by Curl, et. al. in units of rotational constant
B. Graph plotted from data published by Curl, et. al.
15
, the ground state becomes signicantly distorted such that it nowpeaks at =0 and
= and becomes almost vanishing around =

2
. The l =1, m =0 state, however, is
proportional to cos in the free rotor potential, which means that its wave function
is 0 at =

2
and has a greater amplitude at = 0 and =. Therefore, the potential
now imposed does not distort the wave function too much; it simply makes the wave
function almost vanishing about =

2
. Note then, that the distorted l = 0, m = 0
state and the l =1, m =0 states will now have similar probability distribution because
the square of their amplitudes will both be high in the poles and low in the equator.
However, there is a parity dierence where the l = 1, m = 0 state is odd and crosses 0
at =

2
and the other state does not. When the potential barrier is high, because the
wave function of either state will be near vanishing around the =

2
region anyway,
the dierence in energy is smallthe formation a tunnel splitting pair!
15
Another example of tunnel splitting is the MacRury and Sams potential with both
2.4. ROTATIONAL TUNNEL SPLITTING Hang 35
out-of-plane and in-plane barriers,
19
which can be rewritten as
V = cos
2
+

2
(1cos2) , (2.51)
where and are potential energy in units of rotational constant B. As noted in pre-
vious sections, the MacRury and Sams potential with only the out-of-plane hindrance
does not have tunnel splitting. Fig. 2-7 shows the energy levels rst as a function of
from = 0 to = 10 with = 0 held constant. Then it shows the energy levels
as a function of from = 0 to = 8 with = 10 held constant. The results show
clearly that when only is increased, no candidates for tunnel splitting states can be
found. Only when both and are high can one readily recognize potential tunnel
splitting pairs.
Figure 2-7: Energy levels of the potential used by MacRury and Sams as a function of pa-
rameters and in units of rotational constant B. In the left half, = 0 is held constant as
increases from 0 to 10. In the right half, = 10 is held constant as is increased from 0 to
8. Graph from MacRury and Sams.
19
2.4. ROTATIONAL TUNNEL SPLITTING Hang 36
As mentioned in previous discussions, when the potential barriers are high, the
wave function becomes highly localized at pockets of low potential and is almost
zero everywhere elsethese states are known as pocket states.
23
A good example
of these pockets is shown earlier in Fig. 2-4, where there are two regions of low
potential, one centered at =

2
and =0 and the other centered at =

2
and =.
If the wave function in the two pockets are of opposite sign, then the wave function
must be almost vanishing and cross 0 in the region of high potential. If they are of the
same sign, the wave function must be almost vanishing without crossing 0. Therefore,
these two wave functions, one even and one odd, yield similarly shaped probability
densities (i.e. similar shape when taken the absolute value squared). Further, because
their wave functions are both almost vanishing at the regions of high potential, the
only dierence being that one actually crosses 0, the dierence between themin terms
of energy will be very small, forming a tunnel splitting pair.
Chapter 3
Lanczos Methods
3.1 Motivation
The Lanczos method is an algorithm that nds the extremal eigenvalue and the corre-
sponding eigenvectors eciently for large sparse Hermitian matrices, where a sparse
matrix here means that the matrix contains few nonzero matrix elements. To under-
stand the origins and mathematical basis of this method, one must return to the basic
eigenvalue problem.
The basic eigenvalue problem is to solve for x and in
Ax = x (3.1)
where AC
nn
, C, and x C
n
. This process of solving the eigenvalue problemis
in general very resource consuming as it scales greater than linearly in n.
24;25
In many
physical systems, only the extremal eigenvalues and corresponding eigenvectors, such
as the ground state and the rst few excited states, are of interest. If one can nd the
extremal eigenvalues simply by solving a smaller matrix T
k
C
kk
, where k <n, then
one can avoid wasting resources nding eigenvalues and eigenvectors that are not of
interest.
The preliminary task, then, is to demonstrate that a choice for T
k
exists. Let
v
1
,v
2
, . . . ,v
k
C
n
be eigenvectors of A with corresponding eigenvalues
1
,
2
, . . . ,
k
,
37
3.1. MOTIVATION Hang 38
and dene
Q
k
=
_
v
1
v
2
. . .v
k
_
, (3.2)
or that the columns of Q
k
are eigenvectors. Then one can dene
T
k
= Q

k
AQ
k
. (3.3)
And one can notice, by direct matrix multiplication, that this T happens to be diago-
nal with the eigenvalues
1
,
2
, . . . ,
k
making up its diagonal elements.
Observe further that if the columns of Q
k
are not eigenvectors, but instead of a set
of k orthonormal vectors that together can form all the v
1
,v
2
, . . . ,v
k
through a linear
combination of each other, then T
k
will not be diagonal. However, when diagonalized,
T
k
will still have the set of eigenvalues
1
,
2
, . . . ,
k
.
24
Further, an eigenvector of
T
m
, sayz
i
with eigenvalue
i
, can give v
i
by
24;26
v
i
= Q
k
z
i
. (3.4)
Therefore, if one can nd a set of k orthonormal vectors that can, through linear
combinations, form the eigenvectors that one wants to solve for, then one can nd
a desired T
k
from A by performing matrix multiplication and then diagonalizing the
smaller T
k
. This is the heart of the Lanczos methodto construct Q
k
.
3.2. RAYLEIGH QUOTIENT Hang 39
3.2 Rayleigh Quotient
Before continuing to the Lanczos method itself, it is useful to introduce the Rayleigh
quotient, which makes it possible to nd Q
k
eciently.
The basic eigenvalue equation is usually given in the form of Eq. 3.1. For numeri-
cal calculations, however, it is more useful to consider
x

Ax = x

x (3.5)
instead; or in a more common form,
= r(x) =
x

Ax
x

x
, (3.6)
where r(x) is known as the Rayleigh quotient.
24
Note that the Rayleigh quotient is
equal to an eigenvalue of A when x is an eigenvector of A. If x is an eigenvector of A
with some very small deviation, then the Rayleigh quotient of x will deviate slightly
from the corresponding eigenvalue of A. Therefore, the Rayleigh quotient is useful
because one can quantify the proximity of a vector to an eigenvector by comparing
its Rayleigh quotient to an eigenvalue.
Further, the Rayleigh quotient in physics is useful because it sets a bound for the
numeric results.
24
Specically, this property can be given as
min
r(x)
max
for all
x ,=

0. This inequality can be proved by considering A=QQ

, where is a diagonal
matrix of n real eigenvalues of A (assuming A is Hermitian), A C
nn
is Hermitian,
and Q C
nn
is a unitary matrix. Then,
x

Ax = x

QQ

x . (3.7)
Dening y = Q

x, then
x

QQ

x =y

y . (3.8)
3.2. RAYLEIGH QUOTIENT Hang 40
Observe that
y

y =

i
[y
i
[
2
and (3.9)

i
[y
i
[
2

max
i
[y
i
[
2
. (3.10)
The right hand side of Eq. 3.10 is simply
max
y

y =
max
x

x while the left hand side


is x

Ax, as shown above. Therefore, rearranging the terms and noting that x

x > 0,
then
x

Ax
x

x

max
, or (3.11)
r(x)
max
. (3.12)
Similarly, it can be proved that
min
r(x). Therefore, the Rayleigh quotient will
always be between the greatest and least eigenvalues of the system, which allows for
an approximation of the greatest and least eigenvalues to converge from one side
only. This property is extremely useful both in terms of estimating the ground state
of a systemand setting upper bounds for possible ground state value in error analysis.
3.3. LANCZOS ITERATION Hang 41
3.3 Lanczos Iteration
As mentioned in previous sections, the heart of the Lanczos method is to construct
Q
k
such that T = Q

k
AQ
k
will have the the desired eigenvalues. To begin the pro-
cess of constructing Q
k
, one rst chooses an initial vector q
1
C
n
. If q
1
is randomly
choosen, it is likely that it will contain some component of the maximum or mini-
mum eigenvector; alternatively, one can use some estimation by physical intuition,
such that q
1
contains some component of the maximum or minimum eigenvector. In
either case, the goal, as stated in previous section, is to nd q
1
,q
2
, . . . ,q
k
such that a
linear combination of it will be the maximum or minimum eigenvector, or at least a
vector suciently close such that its Rayleigh quotient is approximately the desired
eigenvalue.
If one simply wants to nd the maximum or minimum eigenvalue, then the gra-
dient of the Rayleigh quotient is extremely useful. Let the vectors q
1
,q
2
, . . . ,q
h
span
the space S
h
and let them be the columns of Q
h
that transforms A to T
h
. Let v
h
be
the eigenvector of T
h
with maximum eigenvalue. If a new vector q
h+1
is added such
that S
h+1
contains the gradient of r(Q
h
v
h
), then the maximum eigenvector T
h+1
will be greater than the maximum eigenvector of T
h
.
24
Further, because the Rayleigh
quotient is bounded from the top by
max
, one can successively add the gradient of
r(Q
i
v
i
), where v
i
is the eigenvector of T
i
with maximum eigenvalue, to the space
spanned by q
1
,q
2
, . . . ,q
i
and obtain successively better approximations of
max
. This
method can similarly be applied to nd
min
.
24
The new task, then, is to nd an algorithm that can provide an ecient way of
nding the gradient of the maximum or minimum eigenvector of T
h
such that one can
construct Q
h+1
given Q
h
. Here the Rayleigh quotient is the key to actualizing the
general procedure above. Note that the gradient of the Rayleigh quotient r(x) is
24
r(x) =
2
x

x
(Ax r(x)x) , (3.13)
or that the gradient of any vector x is contained in the space spanned by x and
Ax. This is an extremely powerful result since one can simply dene q
i
= A
i1
q
i
for
3.3. LANCZOS ITERATION Hang 42
i 1, 2, . . . , and S
h+1
will contain the gradient of every vector in S
h
because every
vector in S
h
can be written as a linear combination of q
1
,q
2
, . . . ,q
h
.
The space spanned by q
1
, Aq
1
, . . . , A
h1
q
1
is known as a Krylov subspace
24
and
it is denoted as K (A,q
1
, h). The corresponding matrix
K(A,q
1
, h) =
_
q
1
(Aq
1
) (A
h1
q
1
)
_
, (3.14)
where the columns of the matrix K are q
1
, Aq
1
, . . . , A
h1
q
1
, is known as a Krylov
matrix.
24
A further property of Krylov matrices provides additional computational bene-
ts. It can be shown that K

AK = T yields a tridiagonal real symmetric matrix


T,
24;26
where tridiagonal means that the matrix element t
i j
of T is zero unless i = j
or i = j 1.
24
Therefore, the problem of nding a Krylov matrix K is equivalent to
tridiagonalizing a matrix A.
24;26
This equivalence allows the Lanczos method to be
extended and enhanced by using advanced methods of tridiagonalization.
24
In a case
where the matrix A is known to be sparse, however, the elements of T can be com-
puted directly relatively eciently.
24
Let the diagonal elements of T be
1
,
2
, . . . ,
k
and the subdiagonal elements of T be
1
,
2
, . . . ,
k1
, then there is a recusion relation
Aq
i
=
i1
q
i1
+
i
q
i
+
i
q
i+1
, (3.15)
where
0
q
0
is conveniently dened as 0. (Note that
i
= q

i
Aq
i
by orthonormality
of the vectors q
j

k
j =1
.) This recursion formula, which is ecient because the most
complex operation is operating a matrix on a vector only once at each iteration, is the
basic Lanczos iteration,
24;2629
and the q
i
that form the columns of the Krylov matrix
are known as Lanczos vectors.
In short, given a matrix A, one guesses an initial q
1
vector and uses the Lanczos
iteration to generate the Krylov matrices that can transform A to a k k matrix T
k
.
Once a suitable termination criterion is met, the Lanczos iteration stops, and one
takes the nal T
k
, diagonalize it to nd an approximation of the desired eigenvalues,
3.3. LANCZOS ITERATION Hang 43
and then operate K on the corresponding eigenvectors of the desired eigenvalues to
nd an approximation of the desired eigenvectors.
3.4. TERMINATION, ERROR, AND LIMITATIONS Hang 44
3.4 Termination, Error, and Limitations
The role of the rst Lanczos vector q
1
is clearly important; however, choosing the
rst Lanczos vector is not a very well-dened process. This ambiguity causes con-
cern because the rst Lanczos vector determines the Krylov subspace possible. It
is entirely possible for q
1
to exist in an invariant subspace of A of dimension k < n
and the Lanczos procedure will terminate at that point with
k
= 0. Therefore, it
is important to choose a rst Lanczos vector q
1
that is not stuck in an invariant
subspace, which is impossible to guarentee without knowing the structure of A in
full detail. Physical intuition would suggest that invariant subspaces correspond to
certain symmetries in the structure of the system. Therefore, for this investigation,
the rst Lanczos vector is chosen to avoid any known symmetries to ensure that the
rst Lanczos vector is not trapped in any invariant subspace.
As mentioned in previous sections, the utility of the Lanczos method is its e-
ciency. The convergence rate of the eigenvalue and eigenvectors is given by a theorem
of Kaniel and Paige.
24;2932
Afull investigation of the convergence rate of an arbitrary
eigenvalue is beyond the scope of this investigation. Here only the convergence rate
for the maximum (or minimum) eigenvalue will be cited.
If
1

n
are eigenvalues of A with corresponding eigenvectors z
1
, . . . ,z
n
,
and
1

k
are eigenvalues of T
k
, which is obtained after k steps of the Lanczos
iteration, then

1

1

1

(
1

n
)tan
2
(
1
)
_
c
k1
(1+2
1
)
_
2
(3.16)
where cos(
1
) = [q

1
z
1
[,
1
=

1

n
, and c
k1
is the Chebyshev polynomial of degree
k 1. A similar theorem can be applied for the minimal eigenvalue.
24
There are two main restrictions to the basic Lanczos algorithm that needs to be
resolved. First, there is the issue of orthogonality, and second, the issue of degener-
acy.
24;28
In the Lanczos algorithm in exact arithmetic, the Lanczos vectors generated
(the q
i
) form a set of orthonormal vectors. Further, orthonormality of the Lanczos
3.4. TERMINATION, ERROR, AND LIMITATIONS Hang 45
vectors is necessary for T
k
to be tridiagonal and for the simple Lanczos iteration to
be valid. However, in numeric calculations where roundo errors can occur, the or-
thogonality of the Lanczos vectors disappears and the Lanczos iteration is useless.
This situation is exacerbated by the fact that as the eigenvalues
i
, known as the
Ritz value, of T
k
converge to the eigenvalues of A, the Lanczos vectors generated
afterwards will contain greater and greater components of the Ritz vector y
i
, de-
ned as Q
k
operated on the eigenvector of T
k
with eigenvalue
i
.
24
This makes the
newly generated Lanczos vectors less orthogonal to each other because they have
increasing overlap. In order to combat these problems, one can choose to selectively
orthogonalize the Lanczos vectors with respect to the Ritz vectors to alleviate the
most serious contribution to nonorthogonalization. A more resource consuming way
is to enforce orthogonalization of new Lanczos vectors with respect to all existing
ones, which can ensure maximal accuracy at the cost of signicant computational
resources.
In addition to the problem of orthogonality, there is a problem with multiplici-
ties. There is no simple method of determining the degeneracy of any eigenvalue,
as the Lanczos method works by nding the eigenvector with maximum or minimum
eigenvalue in the Krylov subspace. The solution to this is known as the block Lanc-
zos method,
24;28;33;34
which iterates through multiple spaces simultaneously in each
iteration. Therefore, such a block Lanczos can nd multiplicities of eigenvalues with
degeneracy less than the size of the block.
24;33
The block Lanczos method relies on the fact that

A

Q =

T =
_

_
M
1
B

1
0
B
1
M
2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. B

r1
0 B
r1
M
r
_

_
, (3.17)
where n = r p,

Q = [X
1
, X
2
, . . . , X
r
], X C
np
, M C
pp
is Hermitian, and B
i

C
pp
is upper triangular.
24;33
Because

Q performs a similarity transformation, the
3.4. TERMINATION, ERROR, AND LIMITATIONS Hang 46
eigenvalues and eigenvectors of A and

T are the same. Thus, similar to the vector
Lanczos method (the iteration described in Eq. 3.15), one can stop at a k < r to nd a

T
k
and diagonalize it to obtain the desired eigenvectors and eigenvalues.
24;33
Observe
that, like T
k
in vector Lanczos,

T
k
in block Lanczos is tridiagonal in that it has
only the diagonal and subdiagonal blocks are nonzero. Notice that because the B
i
are
upper triangular, overall the nonzero elements of

T form a band about the diagonal;
therefore, the block Lanczos method is also known as the band Lanczos method.
33
If, like in the vector Lanczos case, one writes a block Lanczos iteration by com-
puting for the elements M
i
and B
i
directly, then one obtains
AX
k
= X
k1
B

k1
+X
k
M
k
+X
k+1
B
k
(3.18)
where B
0
is dened as a p p matrix with all elements equal to 0.
24
Notice that
because all the columns of

Q are orthonormal to one another, X

i
X
j
=
i j
I
p
, where

i j
is the Kronecker-delta and I
p
is the pp identity matrix.
24
This implies that
M
k
= X

k
AX
k
and (3.19)
B

k1
= X

k1
AX
k
. (3.20)
Using these two relations, one can see that one can save computational resources by
storing the result of A operated on X
k
. And if p is small, then A operating on X
k
will
be the only resource consuming step in each iteration. This issue of applying A on X
k
(or q
i
in the vector method) will be addressed in Section 3.6.
3.5. LANCZOS TOY PROBLEMS Hang 47
3.5 Lanczos Toy Problems
In order to illustrate the properties, strengths, and weaknesses of the basic Lanczos
method, let us consider a simple application of the Lanczos method on a twelve by
twelve matrix.
Consider a matrix
A =
_

_
21
2
0 0 0 0 0 0 0 0 0 0
25
2
0
41
6
2
_
2
3
1
3

2
0 0 0 0
1
3

2
_
2
3
41
6
0
0 2
_
2
3
7
2

3
0 0 0 0
1

3
7
_
2
3
0
0
1
3

2
2

3
20
3
0 0 0 0
20
3
1

3
1
3

2
0
0 0 0 0
17
4
7
4
3
4
1
4
0 0 0 0
0 0 0 0
7
4
17
4
1
4
3
4
0 0 0 0
0 0 0 0
3
4
1
4
17
4
7
4
0 0 0 0
0 0 0 0
1
4
3
4
7
4
17
4
0 0 0 0
0
1
3

2
1

3
20
3
0 0 0 0
20
3
2

3
1
3

2
0
0
_
2
3
7
1

3
0 0 0 0
2

3
7 2
_
2
3
0
0
41
6
_
2
3
1
3

2
0 0 0 0
1
3

2
2
_
2
3
41
6
0
25
2
0 0 0 0 0 0 0 0 0 0
21
2
_

_
(3.21)
3.5. LANCZOS TOY PROBLEMS Hang 48
which has been constructed from the diagonal matrix
D =
_

_
23 0 0 0 0 0 0 0 0 0 0 0
0 17 0 0 0 0 0 0 0 0 0 0
0 0 13 0 0 0 0 0 0 0 0 0
0 0 0 11 0 0 0 0 0 0 0 0
0 0 0 0 7 0 0 0 0 0 0 0
0 0 0 0 0 5 0 0 0 0 0 0
0 0 0 0 0 0 3 0 0 0 0 0
0 0 0 0 0 0 0 2 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 2
_

_
(3.22)
and a similarity transformation S
1
DS = A where
S =
_

_
1

2
0 0 0 0 0 0 0 0 0 0
1

2
0
1

6
1
2
1
2

3
0 0 0 0
1
2

3
1
2
1

6
0
0
1

6
0
1

3
0 0 0 0
1

3
0
1

6
0
0
1

6

1
2
1
2

3
0 0 0 0
1
2

3

1
2
1

6
0
0 0 0 0
1
2
1
2
1
2
1
2
0 0 0 0
0 0 0 0
1
2
1
2

1
2

1
2
0 0 0 0
0 0 0 0
1
2

1
2
1
2

1
2
0 0 0 0
0 0 0 0
1
2

1
2

1
2
1
2
0 0 0 0
0
1

6
1
2
1
2

3
0 0 0 0
1
2

3

1
2

1

6
0
0
1

6
0
1

3
0 0 0 0
1

3
0
1

6
0
0
1

6

1
2
1
2

3
0 0 0 0
1
2

3
1
2

1

6
0
1

2
0 0 0 0 0 0 0 0 0 0
1

2
_

_
. (3.23)
Applying the Lanczos method, consider a randomly generated Lanczos vector
3.5. LANCZOS TOY PROBLEMS Hang 49
q
1
. For illustrative purposes, in this rst case, let the rst Lanczos vector be
r

1
=
1

5
_
0 1 0 0 0 1 0 0 1 0 1 1
_
(3.24)
where the vector is labeled r
1
to dierentiate from the dierent initial vectors that
will be presented later.
Using the Lanczos method, as described in Eq. 3.15 in Section 3.3, then, we can
nd the greatest and least eigenvalues of T
k
. Table 3.1 shows the compiled results
using Mathematica.
Table 3.1: Extremal Eigenvalues with q
1
=r
1
: When k = n = 12, the exact eigenvalues, as
shown in matrix D in Eq. 3.22, are obtained.
T
k
Greatest Eigenvalue Least Eigenvalue
T
2
17.67625436239247 2.055520812733449
T
3
21.13182928380504 0.2954546832621684
T
4
22.53774004641360 1.149168570768845
T
5
22.9705605600049 1.679982898468334
T
6
22.9991280414001 1.890379919379511
T
12
23.00000000000000 2.000000000000000
Indeed, the extreme eigenvalues converge rapidly in accordance with the theory
presented earlier and converges to the maximum and minimum eigenvalues from one
side only. In addition, when the iteration reaches k = n = 12, the matrix A is tridiag-
onalized by K(A,r
1
, 12).
At this point one may speculate that such a successful outcome is not incidental
and that the starting vector r
1
is special in some way. Indeed, there are some re-
strictions to the choice of the initial vector and improper choice of the initial vector
will not lead to the desired result. To illustrate this behavior, consider constructing
the Q
k
matrix using the initial Lanczos vector
r

2
=
_
0 0 0 0 0 0 0 0 0 0 0 1
_
. (3.25)
Using this starting vector, the Lanczos iteration terminates at
2
=0, with eigenvalues
3.5. LANCZOS TOY PROBLEMS Hang 50
23 and 2, not surprising given our transformation matrix S. This result indeed con-
rms our theory that if the starting vector is contained in a proper invariant subspace
in the range of the matrix A, then the Lanczos iteration terminates upon spanning the
subspace. Another example of the same phenomenon is when using
r

3
=
1

12
_
1 1 1 1 1 1 1 1 1 1 1 1
_
(3.26)
as the initial Lanczos vector, which terminates the Lanczos iteration when
5
=0, and
the results are tabulated in Table 3.2.
Table 3.2: Extremal Eigenvalues with q
1
=r
3
: The Lanczos iteration terminates at
5
= 0
T
k
Greatest Eigenvalue Least Eigenvalue
T
2
19.86399567202422 8.16035331705360
T
3
22.91324257513417 7.040986075192646
T
4
22.99930605631535 7.001514560555633
T
5
23.00000000000000 7.000000000000000
In the example with the r
2
vector, r
2
is contained in the subspace spanned by the
rst and last column of the matrix S. In the previous example with r
3
, the vector is
a superposition of the rst, second, and fth column of S and the Lanczos iteration
terminated in a subspace that contained the initial vector. Therefore, in order to apply
the Lanczos method to practical calculations for ground state and low excited state
energies, one must choose an initial vector, a q
1
, free of symmetry that can contain
the initial vector in a proper subspace of the Hamiltonian.
After examining the Lanczos method, and its limitations in theory and in a sim-
ple toy example, the next step is to consider the Lanczos method when applied to a
physical problem, such as the quantum hindered rotor problem.
3.6. TROTTER APPROXIMATIONS Hang 51
3.6 Trotter Approximations
Recall that the most complex step in the Lanczos iteration, in both the vector and
block method, is applying A to q
i
or X
k
. In nding the energy spectrum of a physical
system, this A is the Hamiltonian operator. In the quantum hindered rotor systems
in this thesis, the Hamiltonian has a kinetic energy portion and a potential energy
portion, or that

H =

T +

V. Here the problem of nding a basis for the Hamiltonian
arisesin position space

T contains dierential operators, and in momentum space

V contains dierential operators; navely choosing to work in either position or mo-


mentum basis will force one to apply dierential operators and reduce the eciency
and accuracy of the computation.
A clever way to avoid this issue is to consider the operator

W() = e


H
, (3.27)
where is a real number.
22
While the operator

W() has dierent eigenvalues than
that of

H, they share the same eigenvectors. Therefore, one can still use

W() to
solve the eigenvalue problem for

H. From here, the Baker-Campbell-Hausdro iden-
tity can be invoked to present

W() in a formmore suitable for computer simulations.
The Baker-Campbell-Hausdor identity,
3538
log
_
e

A
e

B
_
=

A+

B+
1
2
_

A,

B
_
+
1
12
_

A,
_

A,

B
__
+
1
12
__

A,

B
_
,

B
_
, (3.28)
is usually applied up to the rst commutator term. In the present case with

W(), the
operator is of the form e
(

A+

B)
. Expanding the Baker-Campbell-Hausdor identity
to the rst commutator term, then the error is on the order of
3
as shown below
e


A
e


B
= e


A+

B+
2 1
2
[

A,

B]
+O
_

3
_
. (3.29)
To use the result of Eq. 3.29, consider the rst two terms in the expansion of e
(

A+

B)
e

2 1
2
[

A,

B]
3.6. TROTTER APPROXIMATIONS Hang 52
using the Baker-Campbell-Hausdor identity:
e
(

A+

B)
e

2 1
2
[

A,

B]
= e
(

A+

B)+
2 1
2
[

A,

B]
+O
_

3
_
. (3.30)
Substituting Eq. 3.30 into Eq. 3.29, both having error on the same order, and operating
on the right with e

2 1
2
[

A,

B]
yields
e


A
e


B
e

2 1
2
[

A,

B]
= e


A+

B
+O
_

3
_
. (3.31)
To avoid complicated calculations involving the commutator between

A and

B,
a clever approach is to use the fact that e


A
= e

1
2

A
e

1
2

A
exactly because

A com-
mutes with itself. By repeated applications of the Baker-Campbell-Haudor identity,
observe that
e

1
2

A
e


B
= e

1
2

A+

B+
2 1
4
[

A,

B]
+O
_

3
_
(3.32)
e


B
e

1
2

A
= e


B+
1
2

A+
2 1
4
[

B,

A]
+O
_

3
_
(3.33)
and following an approach similar to the derivation of Eq. 3.30,
e

1
2

A
e


B
e

2 1
4
[

A,

B]
= e

1
2

A+

B
+O
_

3
_
(3.34)
e


B
e

1
2

A
e

2 1
4
[

B,

A]
= e


B+
1
2

A
+O
_

3
_
. (3.35)
Equating Eq. 3.34 and Eq. 3.35 and operating fromthe right with e

2 1
4
[

A,

B]
=e

2 1
4
[

B,

A]
gives
e

1
2

A
e


B
= e


B
e

1
2

A
e

2 1
2
[

A,

B]
+O
_

3
_
. (3.36)
3.6. TROTTER APPROXIMATIONS Hang 53
Therefore, combining the results of Eq. 3.36 and Eq. 3.31,
e


A+

B
= e


A
e


B
e

2 1
2
[

A,

B]
+O
_

3
_
(3.37)
= e

1
2

A
e

1
2

A
e


B
e

2 1
2
[

A,

B]
+O
_

3
_
(3.38)
= e

1
2

A
e


B
e

1
2

A
+O
_

3
_
. (3.39)
The result, Eq. 3.39, is a special case of a general family of approximations known as
the Trotter approximation.
3942
Returning to the physical problem at hand, the Trotter approximation can be ap-
plied to

W(), when is small, as follows,

W() = e


H
(3.40)
= e


V+(

T)
(3.41)
= e

2

V
e


T
e

2

V
+O(
3
) (3.42)
and the kinetic and potential energy portions can be separately applied, which is suit-
able for computer simulations. For example, if in general one works in position space,
then the operator can be written as follows
, [e


H
[
/
,
/
) =, [e

2

V
e


T
e

2

V
[
/
,
/
) (3.43)
=

//
,
//

///
,
///
, [e

2

V
[
//
,
//
)
//
,
//
[e


T
[
///
,
///
)
///
,
///
[e

2

V
[
/
,
/
)
(3.44)
=

l ,m
/

l
/
,m
/

//
,
//

///
,
///
_
, [e

2

V
[
//
,
//
)
//
,
//
[l , m)l , m[e


T
[l
/
, m
/
)
l
/
, m
/
[
///
,
///
)
///
,
///
[e

2

V
[
/
,
/
)
_
, (3.45)
which means that the potential energy part can be written in position space and the
kinetic energy part can be written in momentum spaceno dierential operators
are needed! The only additional mathematical objects introduced are of the form
l , m[, ), or Fourier and associated Legendre transforms, for which there exist al-
3.6. TROTTER APPROXIMATIONS Hang 54
gorithms that perform accurate computations eciently.
22
In short, by using the Trotter approximation and by using Fourier and associated
Legendre transforms, the operation of applying the matrix A to q
i
(or X
k
in the block
method) in the Lanczos iteration can be performed eciently by using

W() instead
of

H.
22
Chapter 4
Methods
4.1 Motivation
An old FORTRAN 77 code was received at the beginning of this project. It had run
years ago on a DEC workstation, but had not been maintained and was unable to
be compiled or run on the machines in the current laboratory. It had clearly been
through several development cycles where comments and fragments from legacies
long gone dotted the code, and certain specic problems with the old implementation
of the code needed to be addressed. One very noticeable stylistic problem was the
abuse of the common block in the old code. Not only were local variables of all types
stored in common, but many were declared in numerous internal subroutines. The
unnecessary declarations made it dicult to understand which variables stored in
the shared data were actually used in a subroutine. Global constants were redened
even when it was not necessary and clearly disadvantageous to do so. Here, the
object-oriented programming concept of encapsulation and the passing of variables
to functions and subroutines with intent specications in FORTRAN 95 is a clear
improvement.
43
Another issue that had to be confronted was precision and datatype denitions.
Dierent computer platforms and dierent compilers have various default precision
settings for integer, real and other numerical data types. Without documentation of
the precision used, however, one must be cautious when reusing the same piece of
55
4.1. MOTIVATION Hang 56
code on dierent computer platforms, or even identical computer platforms, without
wasting signicant time and eort to re-adjust the precision and test that everything
works as desired. Programs for this project, for example, subroutine GASLEG, as writ-
ten, depends heavily on high machine precision. This dependence created issues dur-
ing the migration to the new platform used for this thesis. Modern FORTRAN 95 has
the ability to select the appropriate datatype from pre-existing ones in the computer
platform to satisfy the users needs.
43
This function allows the code to be platform
independent and allows the user to have direct control over the precision of each
variable or numeric constant at each point in the program.
Another issue is with process control. Some subroutines utilized inscrutable pro-
gramowcontrols such as the dreaded go to. Such archaic owcontrol protocols led
to innite loops that are dicult to debug. For example, the GASLEG subroutine had
to be debugged as it brought the code into innite loops. Migrating to modern For-
tran 95 removes the temptation for users to employ such poor programing practices
and maintains the legibility of the program.
43;44
Finally, the old code lacked modularity. In many instances, in order to understand
or modify a line of code, one needed to look 50 lines prior in order to nd relevant def-
initions or even into other subroutines to nd the initialization of a variable. There-
fore, local modications are dicult because changes throughout the code are often
needed to maintain consistency. One example is the size of the potential grid, which
is dened locally at several points in the code or simply implied when the upper limit
of a loop is simply a number instead of a variable. The ability to group blocks of code
into subtasks can dramatically decrease the debugging time and make the code much
more understandable.
4345
In the example above, storing the size of the potential grid
in a module and having dierent subroutines use the variable stored in the module
can not only allow for consistency and easy debugging, but also make it possible to
program the code with a wrapper or a shell script that can run multiple runs with
dierent initial parameters. Therefore, from the beginning of this project, one major
objective has been to redesign the code and update it into the modern FORTRAN 95.
4.2. FORTRAN 77 CODE Hang 57
4.2 FORTRAN 77 Code
4.2.1 Overview
Prior to a migration to FORTRAN 95 it was important to have an updated, work-
ing FORTRAN 77 code to ensure the integrity of the program and algorithms. In
the process, two external subroutines had to be replaced: the complex fast Fourier
transform algorithm and the psuedo-random number generator library. The psuedo-
random number generator was not used for the data shown in this thesis. However,
it is expected to be needed for future work in which hydrogen is inserted into a bulk
material and allowed to sample at varying environments.
In addition to the replacement of two external subroutines, minor changes were
made to the code to ensure that the code conformed to the xed form format, e.g. the
number of characters on each line, and that all the variables and constants are of the
correct precision because modern scientic applications usually require double preci-
sion and especially in the subroutine GASLEG. In updating the FORTRAN 77 code, all
real variables were declared as DOUBLE and all intrinsic functions were set to calculate
with double precision.
4.2. FORTRAN 77 CODE Hang 58
4.2.2 Complex Fast Fourier Transform
The complex Fourier transform is usually given as
12
g(k) = A
_

f (x)e
ikx
dx , (4.1)
where A is 1,
1

2
, or
1
2
depending on the convention used, and is either positive
or negative one, again, depending on convention. One must note that the parameters
A and can vary from implementation to implementation. In this application, this
is not a signicant concern because the goal, as described in section 3.6, is simply
to transform the wave function from position to momentum space, apply the kinetic
operator in momentum space, and then inverse transform to position space.
In computer simulations the function f (x) in Eq. 4.1 is typically sampled at dis-
crete evenly spaced points x
i
, and a discrete Fourier transform is used.
a
Similar to
the continuous case, the discrete complex Fourier transform of a data with N total
data points separated by x is given by substituting j x for x and nk for k in Eq. 4.1
and changing the integral to a sum, which yields the general formula
g
n
= B
N

j =1
f ( j x)e
i
2n j
N
, (4.2)
where k =
2
X
, and X = Nx is the domain of input values to be transformed. Note
again that the specic implementation may vary as B can be either 1 or
1
N
and can
take on a value of either positive or negative one.
In addition, note that mathematically
e
i
2
N
(
N
2
+m) j
= e
i
2
N
(N
N
2
+m) j
(4.3)
= e
i2 j
e
i
2
N
(
N
2
+m) j
(4.4)
= e
i
2
N
(
N
2
+m) j
. (4.5)
a
The actual algorithm implemented is a fast Fourier transform. For the purposes of scientic com-
puting, however, such subroutines are treated as a black box that performs the discrete Fourier
transform eciently.
4.2. FORTRAN 77 CODE Hang 59
Thus, the entires k
n
where N > n >
N
2
can be viewed as entries with negative spatial
frequencies. Therefore, there are two ways to view the data: one is to think of the
spectrum as ranging from
K
2
to
K
2
, and the other is to think of the spectrum as
ranging from 0 to K, where K is the range of the transform. These two dierent
views are commonly implemented as, A:
_
0, k, 2k, . . . ,
K
2
,
K
2
, . . . , 2k, k
_
, (4.6)
and B:
_
0, k, 2k, . . . , K

. (4.7)
Some library routines deliver the output in form A, also known as the wrapped
form; while other routines store the output in form B, also known as the natural
form.
After a survey of available software, a complex fast Fourier transform algorithm
FFTPACK5 is utilized and called from the subroutine trans p, which can be found
in Appendix B.2.8. The algorithm was rst tested in isolation. Fig. 4-1 shows the
input of the standard normal distribution ( = 0, = 1) to the Fourier transform
library routine, which was Fourier transformed according the convention that B =
1
N
in Eq. 4.2. In Fig. 4-2, the Fourier transformed data ranges from

0.01
to

0.02
,
suggesting that the wrapped form is used. Performing the inverse transform on the
Fourier transformed distribution ought to yield the original distribution, which is the
case in Fig. 4-4.
4.2. FORTRAN 77 CODE Hang 60
0.000
0.050
0.100
0.150
0.200
0.250
0.300
0.350
0.400
-10 -5 0 5 10
D
i
s
t
r
i
b
u
t
i
o
n
x
i
Fourier Transform Test: Input
Input
Standard Normal Distribution =0 =1
Figure 4-1: Input for testing of the library routine FFTPACK5. The data used has parameters
X = 10, x = 0.01, N = 2000.
-0.0050
0.0000
0.0050
0.0100
0.0150
0.0200
0.0250
0.0300
0.0350
0.0400
0.0450
0.0500
-400 -300 -200 -100 0 100 200 300 400
D
i
s
t
r
i
b
u
t
i
o
n
k
j
Fourier Transform Test: Forward Transform
Forward Transform
Normal Dist. =0 =1 with factor 1/(Nx)=1/20
Figure 4-2: Fourier transform using FFTPACK5 data in Fig. 4-1. Here N = 2000.
4.2. FORTRAN 77 CODE Hang 61
-0.0050
0.0000
0.0050
0.0100
0.0150
0.0200
0.0250
0.0300
0.0350
0.0400
0.0450
0.0500
-10 -5 0 5 10
D
i
s
t
r
i
b
u
t
i
o
n
k
j
Fourier Transform Test: Forward Transform
Forward Transform
Normal Dist. =0 =1 with factor 1/(Nx)=1/20
Figure 4-3: Close-up of Fig. 4-2.
-0.050
0.000
0.050
0.100
0.150
0.200
0.250
0.300
0.350
0.400
-10 -5 0 5 10
D
i
s
t
r
i
b
u
t
i
o
n
x
i
Fourier Transform Test: Back Transform
Result after Forward Trans. and Back Trans.
Standard Normal Distribution =0 =1
Figure 4-4: Inverse transform using FFTPACK5 on the Fourier transformed distribution in
Fig. 4-2.
4.2. FORTRAN 77 CODE Hang 62
4.2.3 Pseudo-Random Number Generators
The original FORTRAN 77 code included a process that required a random number
generator for a statistical mechanics simulation. Initially, a pseudo-random num-
ber generator most recently utilized by Timothy Cronin
46
and Zachery Wolfson
47
Swarthmore College 06 was used because of its immediate availability. Later, a
twisted generalized feedback shift register pseudo-randomnumber generator Mersenne
Twister was implemented. The Mersenne Twister has a long period of 2
19937
1, a
high order of dimensional equidistribution, runs fast and has been demonstrated by
many to have a high degree of statistical randomness.
48;49
Although the original code published by the developers of the Mersenne twister
is written in C, the FORTRAN 77 code can interface with the compiled library seam-
lessly. Fortran versions of the same code can be found, however, these codes have
not been veried to function identically to the C program written by the original au-
thors and preliminary testings show little dierence in speed, viz. dierent trials have
shown either version running slightly faster than the other with even frequency, after
compiling the library with the greatest optimization settings. Therefore, the C version
was ultimately used.
While this library routine was used in testing the FORTRAN 77 version of the
code, this library has not been incorporated into the FORTRAN 95 code in Appendix B
because the pseudo-random number generator is used for a random walk in a bulk
material. This was part of the functionality of the old code, which has not been in-
corporated into the new one. However, in the future, the Mersenne Twister may be
useful in statistical mechanical simulations.
4.3. FORTRAN 95 CODE Hang 63
4.3 FORTRAN 95 Code
4.3.1 Design Concepts
In updating the code to FORTRAN 95, a top-down approach was used.
44
Three cen-
tral subtasks of the code were identied, initialization, propagation of the Hamilto-
nian in each Lanczos iteration, process control for Lanczos iterations. Each of these
tasks will be described in detail in the following sections.
One of the primary reasons is not with functionality of the code, but rather the
readability of the code. Programs must be readable by scientic users, and it is not
reasonable to expect its most likely users to be able to parse through several thousand
lines of code in order to understand the way the programaccomplishes one small task.
It is advantageous to break the code into smaller blocks with clear functions,
4345
and
allow the user to interact with the program at varying levels of detail. If the user
desires to tweak every line and detail of the code, breaking into digestible parts is a
good idea. If the user simply wants to have a cursory examination of the program as
a conglomeration of black boxes, it is a good idea as well.
A second goal is to enhance its maintainability. One idea that is pertinent to this
project is encapsulation.
45
Many of the processes and algorithms are repeated in the
current code; therefore, recycling the same piece of code via data encapsulation of the
associated processes can save coding time, preserve or even enhance the functionality
of the program, and reduce the possibility of bugs due to human typographical errors.
Data encapsulation also reduces the possibility of user error. Many programs,
especially those in the scientic community, are often poorly documented, and even if
they are well-documented, such documentation quickly becomes obsolete, or are not
passed on as collaborations share codes. Users unfamiliar with a program can often
input nonsense or conicting data and parameters that can lead to fatal errors or,
worse, nonsense results that can be misinterpreted. By hiding information, especially
when it will not impede too much on the ability for the code to be updated, the
potential errors a user can make will be more restricted and the damage that can
be done can be more traceable. In addition, when designing separated programming
4.3. FORTRAN 95 CODE Hang 64
units, it is easier to implement explicit interfaces, prompts, and error messages at
key points in the code to avoid potential issues such as overwriting input data and
changing numerical constants.
With these concerns in mind, the current code, based upon previous works has
been reorganized and redesigned to eciently take an input potential, where a homonu-
clear diatomic molecule is situated, and output the energy levels and corresponding
eigenfunctions. The basic call tree is shown in Fig. 4-5.
Figure 4-5: Call tree of the current code.
The overall wrapper is estates that calls upon lanch2 that calls upon initializa-
tion routines and calls upon the controller of the Lanczos method. The program gett
provides the matrix elements for the associated Legendre transform and it uses upn
that functions as a raising and lowering operator that gives the dierent associated
Legendre polynomials. The code fourier controls the Lanczos iteration, as shown in
Eq. 3.19 and 3.20, and performs the orthogonalization to ensure accuracy. The sub-
4.3. FORTRAN 95 CODE Hang 65
routines getProp and fullProp initializes and applies the A matrix in Eq. 3.19 and
3.20. As shown in Section 3.6, this A is of the form

W() = e

2

V
e


T
e

2

V
. (4.8)
The subroutine fullProp calls sltf and sltb to perform the associated Legendre
transform and the inverse transform, as described in Section 3.6, and calls the sub-
routine trans p to apply e


T
.
In addition to the subroutines shown in Fig. 4-5, there are several modules in the
code that are not directly part of the central process but are essential to ensure the
operation of the program. Most initialization processes, with the notable exceptions
of gett and getProp as shown in the call tree, have been incorporated into the mod-
ule input as module subroutines such that the initialization process is completely
modularized and separated from the actual algorithm. To this end, two subroutines
gasleg and zbes are used by the module subroutine get gaussleg in input to nd
the weights for Gaussian-Legendre quadratures; hence, they are not found in the
basic program tree above. The module fft mod simplies the call to the external
library fftpack5 by hiding the work arrays and temporary variables as shown in Sec-
tion 4.3.4. The modules prop mod and trans mod exist solely as data storing modules,
created in the process of reorganizing the code. They, along with gett, getprop, sltf
and sltb, can be incorporated into a propagator initialization module and a Legendre
transform module in the future. The module overlap nds the overlap between two
wave functions that is useful in the orthogonalization process, and it will be explained
in detail in Section 4.3.3. Finally, datatype selects datatypes on the specic computer
platform such that the code can be more platform independent.
4.3. FORTRAN 95 CODE Hang 66
4.3.2 Derived Type and Data Encapsulation
A feature of FORTRAN 95 that grants users tremendous exibility is the feature of
derived types.
4345
One can dene derived types to create new data structures con-
veniently. In this investigation, one physical object that can naturally be dened as
a derived type is the hydrogen molecule. Prior to the denition of the derived type,
there existed variables mass, rrange, and gmax, where the rst refers to the reduced
mass of the hydrogen molecule and the latter two both refer to the bond length be-
tween the nuclei of the hydrogen molecule, as shown below.
r e a l (dpkind), par amet er :: mass =1836.0 _dpkind , rrange =1.449 _dpkind
r e a l (dpkind), par amet er :: gmax = rrange
With a derived type molecule, these variables are now grouped together as the
natural parameters of the physical system at hand, as shown below.
41 ! 2006 de r i ve d t ype mol e c ul e
t ype , p u b l i c :: molecule
p r i v a t e
r e a l (dpkind) :: mass
45 ! reduced mass
r e a l (dpkind) :: blength
! bond l e ng t h
end t ype molecule
This makes it clear that the mass and bond length of the diatomic molecule at hand
are the relevant parameters. While the type itself is public, available for decla-
ration, its elds are private to achieve data encapsulation. To access the elds
mass and blength, public functions getmass and getblength were declared in the
datatype mod module.
52 ! 2006 g e t s reduced mass of mol e c ul e
f u n c t i o n getmass(molecules)
r e a l (dpkind) :: getmass
55 t ype (molecule), i n t e n t ( i n ) :: molecules
getmass = molecules%mass
end f u n c t i o n getmass
! 2006 g e t s bond l e ng t h of mol e c ul e
60 f u n c t i o n getblength(molecules)
r e a l (dpkind) :: getblength
4.3. FORTRAN 95 CODE Hang 67
t ype (molecule), i n t e n t ( i n ) :: molecules
getblength = molecules%blength
end f u n c t i on getblength
In addition to data encapsulation, this makes the code in the main body much
more legible. For example, prior to upgrade there was a line of code as follows.
aaa = al * (al + 1) / mass
Note that the mass to which mass refers is ambiguous. Now, however, it is declared
in input mod that
47 ! 2006 de f i ne hydrogen
t ype (molecule), par amet er :: hydrogen = molecule (1836.0 _dpkind , 1.449 _dpkind)
Therefore, in the subroutine getProp the code becomes the following.
18 aaa = al * (al + 1) / &
(getmass(hydrogen) * getblength(hydrogen) * getblength(hydrogen ))
And it is now clear that the reduced mass of the hydrogen molecule is used in calcu-
lating its moment of inertia.
In addition, the denition of such a subtype can allow for denition of multiple
types of molecules, such as the deuterium molecule. In the future, one may even
add additional parameters such as quantum statistics (fermionic or bosonic nuclei)
to allow one to perform calculations that require this additional information without
having to make changes to the code at multiple places.
4.3. FORTRAN 95 CODE Hang 68
4.3.3 Interface and Function Overloading
One advanced feature of in FORTRAN 95 is the ability to create explicit interfaces
for functions and subroutines to ensure that they are called correctly and to allow for
function overloading.
4345
A place where this feature comes in handy is the portion
of the code that performs orthogonalization. To orthogonalize states
1
and
2
, the
overlap between
1
and
2
is calculated, and then removed from
2
. This process is
iterated several times to maintain orthogonalization between all states. The code in
subroutine fourier that performs this operation, prior to upgrade, is shown below.
do ibp = 1, ib -1
do k = 1, nstate
do j = 1, nstate
anorm(j) = 0.0 _dpkind
enddo
do j = 1, nstate
do ip = 1, nm
do ix = 1, nl+1
anorm(j) = anorm(j) + psi(ix ,ip ,j,ibp) &
* psi(ix,ip ,k,ib) * wtot(ix ,ip)
enddo
enddo
enddo
do j = 1, nstate
do ip = 1, nm
do ix = 1, nl+1
psi(ix ,ip ,k,ib) = psi(ix ,ip ,k,ib) &
- anorm(j) * psi(ix,ip ,j,ibp)
enddo
enddo
enddo
enddo
enddo
The array wtot gives the Jacobian weights and is dened earlier in the code. In or-
der to make the code more legible and understandable, an operator .overlap. was
formed to calculate the overlap between two states. The module that denes this
operator is as follows.
1 modul e overlap
us e datatype_mod
4.3. FORTRAN 95 CODE Hang 69
i n t e r f a c e set_wtot
5 modul e procedure set_rwtot
modul e procedure set_cwtot
end i n t e r f a c e
i n t e r f a c e ope r a t or (. overlap .)
10 modul e procedure real_overlap
modul e procedure complex_overlap
end i n t e r f a c e
compl ex(dpkind), di mens i on (:,:), a l l o c a t a b l e , p r i v a t e :: wtot
15
c o n t a i n s
s ub r out i ne set_rwtot(rwin)
r e a l (dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: rwin
i f (allocated(wtot)) d e a l l o c a t e (wtot)
20 a l l o c a t e (wtot( s i z e (rwin ,1), s i z e (rwin ,2)))
wtot = rwin
end s ub r out i ne set_rwtot
s ub r out i ne set_cwtot(cwin)
25 compl ex(dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: cwin
i f (allocated(wtot)) d e a l l o c a t e (wtot)
a l l o c a t e (wtot( s i z e (cwin ,1), s i z e (cwin ,2)))
wtot = cwin
end s ub r out i ne set_cwtot
30
f u n c t i o n real_overlap(rpsi1 ,rpsi2)
r e a l (dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: rpsi1
r e a l (dpkind) , di mens i on ( s i z e (rpsi1 ,1), s i z e (rpsi1 ,2)) , &
i n t e n t ( i n ) :: rpsi2
35 r e a l (dpkind) :: real_overlap
i f (allocated(wtot)) t hen
real_overlap = sum(rpsi1 * rpsi2 * r e a l (wtot ,dpkind ))
e l s e
40 real_overlap = sum(rpsi1 * rpsi2)
e n d i f
end f u n c t i o n real_overlap
f u n c t i o n complex_overlap(cpsi1 ,cpsi2)
45 compl ex(dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: cpsi1
compl ex(dpkind) , di mens i on ( s i z e (cpsi1 ,1), s i z e (cpsi1 ,2)) , &
i n t e n t ( i n ) :: cpsi2
compl ex(dpkind) :: complex_overlap
4.3. FORTRAN 95 CODE Hang 70
50 i f (allocated(wtot)) t hen
complex_overlap = sum(cpsi1 * conjg(cpsi2) * wtot)
e l s e
complex_overlap = sum(cpsi1 * conjg(cpsi2 ))
e n d i f
55 end f u n c t i on complex_overlap
end modul e overlap
While the wave functions in the code are real, in general wave functions are complex.
Therefore, both a real and a complex calculation routine are included. Instead of
accessing these functions individually depending on the datatype, an interface block
is dened such that one can simply use the operator .overlap. to perform the same
calculation on dierent datatypes.
To see the signicant improvement in the legibility of the code, compare the fol-
lowing, from subroutine fourier in Appendix B.2.5, with the code prior to upgrades
shown earlier.
70 do ibp = 1, ib -1
! 2006 o r t h o g o nal i z e t o a l l l owe r b l o c k s ( a must )
do k = 1, nstate
anorm = 0 * anorm
do j = 1, nstate
75 anorm(j) = anorm(j) + psi(:,:,j,ibp) .overlap. psi(:,:,k,ib)
enddo
do j = 1, nstate
psi(:,:,k,ib) = psi(:,:,k,ib) - anorm(j) * psi(:,:,j,ibp)
enddo
80 enddo
enddo
Note that in addition to the operator .overlap., other new features of FORTRAN 95
were used to make the code cleaner. These features will be addressed in Section 4.3.4.
In the new code, the iteration variables ix and ip were disposed of, along with the
nested loops. This allows one to clearly understand the operations of the code and
increase maintainability, because once one tests that the subtask .overlap. works as
designed, one can simply reapply it to dierent places and work on maintaining other
parts of the code.
4.3. FORTRAN 95 CODE Hang 71
4.3.4 Arrays in FORTRAN 95
Array features in FORTRAN 95 have been tremendously expanded and adjusted to
balance between ease of coding and maintenance with high performance and opti-
mization. One feature is assumed shape arrays,
43;44
which can be seen in the wrapper
code for the complex fast Fourier transform in Appendix B.1.3.
1 modul e fft_mod
us e datatype_mod
! 2006 i f i n i t i a l i z e d work ar r ays t hen i t i s t rue ,
5 ! by de f aul t i t i s f a l s e
l o g i c a l , p r i v a t e :: workinit =.false.
r e a l (dpkind), di mens i on (:), a l l o c a t a b l e , p r i v a t e :: worksav , work
c o n t a i n s
10 s ub r out i ne cfft(transform , isign)
i mp l i c i t none
compl ex(dpkind), di mens i on (:), i n t e n t ( i nout ) :: transform
i n t e g e r (i32kind), i n t e n t ( i n ) :: isign
15 i n t e g e r (i32kind) :: savlen , numm , istatus , mm
numm= s i z e (transform)
savlen = numm*3 +4
mm=numm / 2
20
! de a l l o c a t e i f al r e ady a l l o c a t e d
i f ((. not. workinit) .and. (isign .eq. 0)) t hen
i f (allocated(worksav )) d e a l l o c a t e (worksav)
i f (allocated(work)) d e a l l o c a t e (work)
25 a l l o c a t e (worksav(savlen),work (2* numm))
workinit = .true.
e l s e i f ((. not. workinit) .and. (isign .ne. 0)) t hen
wr i t e (*,*) "Error ,initializeworkarraysfirst."
s t op
30 e n d i f
i f (isign .lt. 0) t hen
c a l l cfft1b(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s e i f (isign .gt. 0) t hen
35 c a l l cfft1f(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s e
c a l l cfft1i(numm ,worksav ,savlen ,istatus)
4.3. FORTRAN 95 CODE Hang 72
e n d i f
40 i f (istatus .ne. 0) t hen
wr i t e (*,*) "Errorincfft"
s t op
e n d i f
end s ub r out i ne cfft
45 end modul e fft_mod
While it does not have an actual interface, the module fft mod is implemented with
the concepts fromthe previous sections, data encapsulation and function overloading,
in mind to simplify the calling interface. This simplication is made possibly only
through assumed shape arrays. The arrays worksav and work are declared as assumed
shape arrays and when combined with a new feature in FORTRAN 95 that allows one
to allocate and deallocate arrays, the temporary work arrays can be adjusted for any
input array length.
In the example with declaring the .overlap. operator in Section 4.3.3, assumed
shape arrays are used in conjunction with the size function, which returns the size
of a dimension of an array, to form automatic objects.
45
In the module overlap from
lines 31 to 42, the function real overlap, one can see a few other new features in
FORTRAN 95 that make the code shorter and more readable. One is the ability to
perform element by element arithmetic. Combined with intrinsic functions such as
sum(), many loops can be avoided.
Many intrinsic functions and operations are overloaded for scalar and array oper-
ations. For example, before upgrading to FORTRAN 95, the subroutine fourier ran
nested loops to exponentiate each element of a matrix.
do ip = 1, nmd
do ix = 1, nmd1
vv = vps(ix ,ip)
ev2(ix ,ip) = exp(-dt2*vv)
enddo
enddo
However, since the intrinsic function exp is verloaded, only one line of code is needed.
65 ev2 = exp(-dt2*vps)
4.3. FORTRAN 95 CODE Hang 73
This demonstrates clearly the powerful expanded array features in FORTRAN 95 and
the ways which they enable a programmer to write better code.
Chapter 5
Results
5.1 Free Rotor
After the errors in the code were corrected through repeated debugging, the the code
was tested on a potential with known analytical solutions, namely the free rotor or
V(, ) = 0. In this code, there are four computational parameters, dt0, ncut, cut,
and nblock, that may be adjusted to give dierent results. Previous uses of the code
have shown that dt0 =1000 and cut =

5 give further reliable results. Further, those


two parameters do not signicantly alter the run time of the program while ncut and
nblock do. Therefore, here the focus was on nding a suitable range of values for
ncut and nblock.
While one should examine all the eigenvalues at once in order to determine the
best parameters, here it is illustrative to show the results for E
1
and E
3
. Note that
according to theory, E
1
and E
3
are both J = 1 states and ought to have the same
energy. Here the code is tested for its ability to nd the energies and degeneracies
accurately.
Examination of Fig. 5-1 and Fig. 5-2, E
1
and E
3
respectively, shows that the accu-
racy of the code is remarkable. The results t the theoretical predictions up to seven
signicant gures. Further, it can be seen that for the appropriate parameters, such
as 3 < nblock < 8 and 7 < ncut < 10, the program yields almost identical values for
E
1
and E
3
. This preliminary example illustrates the robustness of the code.
74
5.1. FREE ROTOR Hang 75
5.188245760e-004
5.188245780e-004
5.188245800e-004
5.188245820e-004
5.188245840e-004
5.188245860e-004
5.188245880e-004
5.188245900e-004
1 2 3 4 5 6 7 8 9
E
1
nblock
J=1 State with Least Energy by Lanczos Methods (E
1
)
ncut=4
ncut=5
ncut=6
ncut=7
ncut=8
ncut=9
ncut=10
Theoretical Results
Figure 5-1: Comparison of E
1
for a free rotor at varying nblock and ncut.
5.188245760e-004
5.188245780e-004
5.188245800e-004
5.188245820e-004
5.188245840e-004
5.188245860e-004
5.188245880e-004
5.188245900e-004
1 2 3 4 5 6 7 8 9
E
3
nblock
J=1 State with Greatest Energy by Lanczos Methods (E
3
)
ncut=4
ncut=5
ncut=6
ncut=7
ncut=8
ncut=9
ncut=10
Theoretical Results
Figure 5-2: Comparison of E
3
for a free rotor at varying nblock and ncut.
5.2. LIBRATOR POTENTIAL Hang 76
5.2 Librator Potential
After testing the code with the free rotor system, the potential used by Curl, et. al.
in Eq. 2.26,
V =
V
0
2
(1cos
2
) , (2.26)
is used to test the code against the results obtained by Curl, et. al. This potential
has a well at = 0 and = pi and a barrier at =

2
, which corresponds to the
potential of a librator.
Fig. 5-3 shows the error, the dierence between results obtained by the code and
results of Curl, et. al., for the ground state as a fraction of the energy of the ground
state. This disagreement is very little when 4 < ncut < 14 and when 3 nblock 7.
0
0.0001
0.0002
0.0003
0.0004
0.0005
0.0006
Fractional Error in E
0
for Curl Potential
Results
5e-005
0.0001
0.0005
4
6
8
10
12
14
ncut
3
3.5
4
4.5
5
5.5
6
6.5
7
nblock
0.00e+000
1.00e-004
2.00e-004
3.00e-004
4.00e-004
5.00e-004
6.00e-004
error
Figure 5-3: Fractional Error of E
0
in a potential investigated by Curl, et. al. V =
V
0
2
(1
cos
2
) where V
0
= 10 in units of rotational constant B.
According to the theory, one may expect that the further one state is from the
ground state, the greater the disagreement, and indeed here it can be seen in Fig. 5-4
5.2. LIBRATOR POTENTIAL Hang 77
that the relative dierence is indeed greater. While in Fig. 5-3 the dierence is almost
negligible, the disagreement for E
8
is about ve order of magnitude smaller than the
eigenvalue calculated by Curl, et. al. This illustrates a characteristic of the Lanczos
method: that extremal eigenvalues converge much more rapidly than interior ones.
0
2e-005
4e-005
6e-005
8e-005
0.0001
0.00012
0.00014
0.00016
0.00018
Fractional Error in E
8
for Curl Potential
Results
5e-005
0.0001
4
6
8
10
12
14
ncut
3
3.5
4
4.5
5
5.5
6
6.5
7
nblock
0.00e+000
2.00e-005
4.00e-005
6.00e-005
8.00e-005
1.00e-004
1.20e-004
1.40e-004
1.60e-004
1.80e-004
error
Figure 5-4: Fractional Error of E
8
in a potential investigated by Curl, et. al. V =
V
0
2
(1
cos
2
) where V
0
= 10 in units of rotational constant B.
Note also that in Fig. 5-4 when nblock is too great, the error rises again for low
ncut values. This is a reminder that computers perform nite arithmetic and that
error is introduced with each operation. This observation implies that there is an
optimal number of operations that balances convergence with the arithmetic error
introduced with increasing iterations. Fig. 5-4 suggests that the optimal parameter
range is probably 8 < ncut < 11 and 4 nblock 6, which is the center of the
valley of error in Fig. 5-4.
5.3. ROTOR POTENTIALS Hang 78
5.3 Rotor Potentials
5.3.1 Out-of-plane Hindrance
While the above two results with the free rotor potential and the potential used by
Curl, et. al have suggested that the new code is reliable, it is useful to compare the
accuracy of this code with traditional approximation methods, such as direct diago-
nalization of a part of the matrix or time-independent perturbation theory. Here, the
potential to be tested is a rotor potential, where the there are barriers at the poles
and a well at the equator. The potential is given by
V(, ) = cos
2
() , (5.1)
where is a small parameter, the same one investigated by by MacRury and Sams.
19
This potential is special in that can be made much more tractable by considering
that
cos
2
() =
4
3
_

5
Y
2,0
(, ) +
2
3

Y
0,0
(, ) , (5.2)
which is a relatively simple expression for

V in the position basis. Therefore,

/
, m
/
[

V[, m) =

/
,
/

/
, m
/
[
/
,
/
)
/
,
/
[

V[, ), [, m) (5.3)
=
4
3
_

(2 +1)(5)
4(2
/
+1)
, 2; 0, 0[
/
, 0), 2; m, 0[
/
, m
/
)
+
2
3

2 +1
4(2
/
+1)
, 0; 0, 0[
/
, 0), 0; m, 0[
/
, m
/
) . (5.4)
Basic selection rules indicate that
m = m
/
(5.5)
[
/
[ 2 (5.6)
5.3. ROTOR POTENTIALS Hang 79
otherwise the element in the perturbing Hamiltonian matrix must be zero. Further,
converting the Clebsch-Gordan coecients into Wignar 3- j notation, it is clear that
+
/
must be even.
12;19
Therefore, it must be that [
/
[ = 2 or =
/
. These results
showthat m and the parity of together formuseful quantumnumbers that divide the
Hamilonian into invariant subspaces. In other words, the Hamiltonian

V in matrix
form in the [l , m) basis can be rearranged to be block diagonal, with each block being
tridiagonal and innite in size. This structure of the Hamiltonian matrix allows direct
diagonalization and perturbation methods to be calculated much easier.
To analyze the accuracy of the code, a 100100 block of the Hamiltonian (in the
[l , m) basis) was diagonalized directly, and the results were compared to the results of
the code and results from second order time-independent perturbation theory.
Table 5.1: The energy levels of the hindered rotor Hamiltonian with potential V(, ) =
cos
2
() where = 1 is obtained by three methods: direct diagonalization of a 100 100
matrix, second order time-independent perturbation theory, and the computer code based
on the Lanczos method with ncut is 7 and nblock is 3. The energy is in units of rotational
constant B.
E
i
Lanczos Method (code) Direct Diag. 2nd Order TIPT
E
0
0.3189995 0.3190001 0.3185185
E
1
2.195489 2.195548 2.195429
E
2
2.195489 2.195548 2.195429
E
3
2.593025 2.593085 2.593143
E
4
6.140771 6.140949 6.140914
E
5
6.140771 6.140949 6.140914
E
6
6.424521 6.424699 6.424684
E
7
6.424521 6.424699 6.424684
E
8
6.533294 6.533472 6.533960
From the results in Tables 5.1, 5.2, and 5.3, it is clear that when the perturbation
is small ( is small), direct diagonalization of a 100 100 matrix, second order time-
independent perturbation theory, and the computer code agree with each other to the
rst four or ve signicant gures, with the lower energy states agreeing better than
the higher energy ones in the Lanczos code as expected. As the perburation increases,
perturbation theory fails to be a good approximation, as expected. However, the
5.3. ROTOR POTENTIALS Hang 80
Table 5.2: The energy levels of the hindered rotor Hamiltonian with potential V(, ) =
cos
2
() where = 5 is obtained by three methods: direct diagonalization of a 100 100
matrix, second order time-independent perturbation theory, and the computer code based
on the Lanczos method with ncut is 7 and nblock is 3. The energy is in units of rotational
constant B.
E
i
Lanczos Method (code) Direct Diag. 2nd Order TIPT
E
0
1.357345 1.357357 1.296296
E
1
2.899550 2.899616 2.885714
E
2
2.899550 2.899616 2.885714
E
3
4.822738 4.822809 4.828571
E
4
6.669674 6.669857 6.665695
E
5
6.669674 6.669857 6.665695
E
6
8.047620 8.047807 8.045675
E
7
8.047620 8.047807 8.045675
E
8
8.810557 8.810735 8.872800
Table 5.3: The energy levels of the hindered rotor Hamiltonian with potential V(, ) =
cos
2
() where = 10 is obtained by three methods: direct diagonalization of a 100 100
matrix, second order time-independent perturbation theory, and the computer code based
on the Lanczos method with ncut is 7 and nblock is 3. The energy is in units of rotational
constant B.
E
i
Lanczos Method (code) Direct Diag. 2nd Order TIPT
E
0
2.305006 2.305040 1.851852
E
1
3.643815 3.643895 3.542857
E
2
3.643815 3.643895 3.542857
E
3
7.264849 7.265043 7.234208
E
4
7.264849 7.265043 7.234208
E
5
7.285149 7.285254 7.314286
E
6
9.915992 9.916207 9.896987
E
7
9.915992 9.916207 9.896987
E
8
11.79020 11.79039 12.25310
results of direct diagonalization and the Lanczos code still agree with each other to
the rst four signicant gures.
5.3. ROTOR POTENTIALS Hang 81
5.3.2 In-plane Hindrance
After examining the behavior of the free rotor potential, the librator potential, and
a rotor potential, and analyzing the accuracy of the code, a more important model,
the rotor with both in-plane and out-of-plane hindrance, is examined. This model
is signicant because it more closely resembles the potential of molecular hydrogen
near a surface.
The results by using the Lanczos code with ncut of 7 and nblock of 3, shown in
Fig. 5-5, show a tunnel splitting between E
0
and E
1
, which according to MacRury and
Sams involves the ( j = 1, p = 1, r = 1) and the ( j = 1, p =1, r =1) states.
19
0
2
4
6
8
10
0
2
4
6
8
10
12
14
16 0.00e+000
1.00e+000
2.00e+000
3.00e+000
4.00e+000
5.00e+000
6.00e+000
7.00e+000
8.00e+000
9.00e+000
Energy (B)
Tunnel Splitting of E
0
and E
1
States
E
0
E
1

Energy (B)
Figure 5-5: The energy eigenvalues of the rst two states calculated at various and
values calculated with the Lanczos computer code with ncut of 7 and nblock of 3.
To see the tunnel splitting in greater detail, consider the rst two states. Fig. 5-6
and Fig. 5-7 show the ground state and rst excited state, respectively, when = 10
and = 0.
Here it is clear that the rst two states are very dierent in shape and do not
exhibit tunnel splitting. However, an examination of the same two states when =10
5.3. ROTOR POTENTIALS Hang 82
-0.4
-0.35
-0.3
-0.25
-0.2
-0.15
-0.1
-0.05
Wave Function of E
0
(=10, =0)
E
0
Wave Function
-0.1
-0.15
-0.2
-0.25
-0.3
-0.35
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

-0.4000
-0.3500
-0.3000
-0.2500
-0.2000
-0.1500
-0.1000
-0.0500
wave function
Figure 5-6: Ground state eigenfunction when = 10 and = 0.
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
Wave Function of E
1
(=10, =0)
E
1
Wave Function
0.4
0.2
-5.55e-017
-0.2
-0.4
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

-0.6000
-0.4000
-0.2000
0.0000
0.2000
0.4000
0.6000
wave function
Figure 5-7: First excited state eigenfunction when = 10 and = 0.
5.3. ROTOR POTENTIALS Hang 83
and = 16 shows a very dierent picture. As one can see by comparing Fig. 5-8, the
ground state, and Fig. 5-9, the rst exicted state, they are very similar except for a
dierence in parity. To demonstrate the similarity, one can square the eigenfunctions
to see the their probability densities, which are shown in Fig. 5-10 and Fig. 5-11, the
ground and rst excited states, respectively.
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
Wave Function of E
0
(=10, =16)
E
0
Wave Function
-0.2
-0.4
-0.6
-0.8
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

-0.9000
-0.8000
-0.7000
-0.6000
-0.5000
-0.4000
-0.3000
-0.2000
-0.1000
0.0000
wave function
Figure 5-8: Ground state eigenfunction when = 10 and = 16.
Comparison of the probability densities of the two show that the distributions are
incredibly similar, conrming that they are indeed tunnel splitting states.
One may wonder if this same potential causes tunnel splitting in higher excited
states also. Fig. 5-12 shows that when approaches 10 and approaches 16, E
2
and
E
3
are very close to each other, suggesting that they may be a tunnel splitting pair and
could be investigated in future studies.
5.3. ROTOR POTENTIALS Hang 84
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Wave Function of E
1
(=10, =16)
E
1
Wave Function
0.5
0
-0.5
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

-1.0000
-0.8000
-0.6000
-0.4000
-0.2000
0.0000
0.2000
0.4000
0.6000
0.8000
1.0000
wave function
Figure 5-9: First excited state eigenfunction when = 10 and = 16.
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Probability Density of E
0
(=10, =16)
E
0
Probability Density
0.6
0.4
0.2
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

0.0000
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
probability density
Figure 5-10: Ground state probability distribution when = 10 and = 16.
5.3. ROTOR POTENTIALS Hang 85
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Probability Density of E
1
(=10, =16)
E
1
Probability Density
0.6
0.4
0.2
0
0.785398
1.5708
2.35619
3.14159

0
0.785398
1.5708
2.35619
3.14159
3.92699
4.71239
5.49779
6.28319

0.0000
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
probability density
Figure 5-11: First excited state probability distribution when = 10 and = 16.
0
2
4
6
8
10
0
2
4
6
8
10
12
14
16
0.00e+000
2.00e+000
4.00e+000
6.00e+000
8.00e+000
1.00e+001
1.20e+001
1.40e+001
1.60e+001
Energy (B)
Degeneracy of J=1 States (E
1
, E
2
, E
3
)
E
1
E
2
E
3

Energy (B)
Figure 5-12: The energy eigenvalues of the rst three excited states (J =1) calculated
at various and values.
Chapter 6
Conclusions
In this investigation, a nonworking FORTRAN 77 code that solves for the energy
eigenvalues and eigenstates of a quantum rigid rotor was revived and modernized to
FORTRAN 95. The code utilizes a block-Lanczos method as described in Section 3.3.
The block-Lanczos method solves for the extremal eigenvalues and the corresponding
eigenvectors eciently for large sparce Hermitian matrices, and this code uses the
Trotter approximation, described in Section 3.6, and Fourier and associated Legendre
transforms to make the Lanczos method even more ecient.
Using the modernized code, the energy levels for molecular hydrogen, modeled
as a rigid rotor, were solved in three potentials: the free rotor potential, the libra-
tor potential, and the rotor potential with and without in-plane barriers. The time-
independent Schr odinger equation was solved using the modernized code that uses
a block-Lanczos method, and the results obtained are in agreement with those ob-
tained by Curl, et. al.
15
and MacRury and Sams
19
via other computational methods.
The phenomenon of tunnel splitting was observed. With increasing potential barrier
strength, the energies of the pair of states were drawn closer to each other.
The parity dierence in tunnel splitting pairs has been observed, and thus the
transition between tunnel splitting states can be observed via IINS, but not optical
spectroscopy,
22
as suggested in Section 1.2. The current code calculates energy levels
and transition energies from given barrier structures. It is hoped that with future
code development, this code will be useful for comparison with experiments. In other
86
Hang 87
words, it can be used to predict barrier heights from observed transition energies.
The code has been designed with exibility in mind, and presumably can be used
for computations with an arbitrary number of basis states and with an arbitrary po-
tential, as long as the grid can resolve it. Further, the code is not limited by potentials
that have degenerate eigenstates because the block Lanczos method can resolve en-
ergy degeneracy.
24;28;33
Therefore, many additional potentials can be investigated.
Further, because of the derived type molecule, one can vary the bond length and re-
duced mass parameters to calculate isotope eects and nd the energy spectrum of
D
2
and even heteronuclear diatomic molecules such as HD. In fact, any rigid rotor
can be used, such as N
2
, CO or CO
2
, given that the potential is adjusted appropri-
ately. Investigation of these various potentials and molecules may reveal interesting
physics and new phenomena.
While signicant portions of the code have been modernized, there is still room
for improvements. As discussed in Section 4.3.1, initializing routines getProp and
gett can be isolated from the main code, and the Legendre transform routines can
have an improved interface similar to the design in the module fft mod. More im-
portantly, a wrapper that inputs an empirical potential grid from a solid and solves
the energy at dierent points in the solid is needed to investigate the behavior of
molecular hydrogen in greater detail.
Appendix A
Associated Legendre Polynomials
When performing the transformation of the wavefunction from physical space to
momentum space, it is necessary to know the associated Legendre polynomials. The
calculation is performed numerically by rst nding the associated Legendre polyno-
mials of the form P

, and then use raising and lowering operators to nd the other


associated Legendre polynomials.
The normalized associated Legendre polynomial,
P
m
n
(x) =
_
2n+1
2

(nm)!
(n+m)!
1
2
n
n!
(1x
2
)
m
2
d
m+n
dx
n+m
(x
2
1)
n
, (A.1)
can be simplied tremendously in the case that n =m = by noting that only the rst
term in the derivative remains nonzero. Therefore, the expression simplies to
P

(x) =
_
2 +1
2

1
(2)!
1
2

!
(1x
2
)

2
(2)! . (A.2)
88
Hang 89
Consinder the ratio
P

(x)
P
1
1
(x)
, then
P

(x)
P
1
1
(x)
=
_
2 +1
2

1
(2)!
1
2

!
(1x
2
)

2
(2)! (A.3)
_
_
2( 1) +1
2

1
(2( 1))!
1
2
(1)
( 1)!
(1x
2
)
(1)
2
(2( 1))!
_
1
=
_
2 +1
2 1

1
(2)(2 1)
1
2
(1x
2
)
1
2
(2)(2 1) (A.4)
=
_
2 +1
2
(1x
2
)
1
2
. (A.5)
Therefore, a simple recursive formula for the associated Legendre polynomials can
be used to nd polynomials of the form P

(x) and then use raising and lowering


operators to nd the other associated Legendre polynomials.
Appendix B
Code
B.1 Modules and External Routines
B.1.1 datatype mod
1 modul e datatype_mod
i mp l i c i t none
save
! 2006 pr ovi de s dat at y pe s and c ons t ant s
5 ! i n t e g e r dat at y pe s :
! i 8ki nd ( 8 b i t ) , i 16ki nd ( 1 6 b i t ) , i 32ki nd ( 3 2 b i t )
!
! r e a l dat at y pe s : ( c ur r e nt l y no quad )
! s pki nd ( s i n g l e ) , dpki nd ( doubl e ) , qpki nd ( quad )
10 !
! mat hemat i cal c ons t ant s
! pi ( rounded t o 50 dec . p l a c e s )
!
! de r i ve d t ype mol e c ul e
15 ! and a s s o c i a t e d a c c e s s i ng f unc t i ons
! 2006 i n t e g e r dat at y pe s
i nt e g e r , par amet er :: i8kind = selected_int_kind(r=2)
i nt e g e r , par amet er :: i16kind = selected_int_kind(r=4)
20 i nt e g e r , par amet er :: i32kind = selected_int_kind(r=9)
! 2006 f l o a t / r e a l dat at y pe s
i nt e g e r , par amet er :: spkind = selected_real_kind(p=6,r=37)
! 2006 IEEE st andard s i n g l e p r e c i s i o n
25 i nt e g e r , par amet er :: dpkind = selected_real_kind(p=15,r=307)
! 2006 IEEE st andard doubl e p r e c i s i o n
! 2006 No st andard f or quad p r e c i s i o n
30 ! 2006 For t h i s computer ( summer 2 0 0 6 ) , cannot f i nd quad p r e c i s i o n
! ! ! i nt e g e r , paramet er : : qpki nd pr e f = &
! ! ! s e l e c t e d r e a l k i n d ( p =33 , r =4931)
35 ! 2006 pi
! ROUNDED t o f i r s t 50 d i g i t s s houl d be enough f or most t h i ng s . . .
90
B.1. MODULES AND EXTERNAL ROUTINES Hang 91
! chang e dpki nd t o ot he r ki nd i f you e ve r need g r e a t e r p r e c i s i o n
r e a l (dpkind), par amet er :: pi &
= 3.14159265358979323846264338327950288419716939937511 _dpkind
40
! 2006 de r i ve d t ype mol e c ul e
t ype , p u b l i c :: molecule
p r i v a t e
r e a l (dpkind) :: mass
45 ! reduced mass
r e a l (dpkind) :: blength
! bond l e ng t h
end t ype molecule
50 c o n t a i n s
! 2006 g e t s reduced mass of mol e c ul e
f u n c t i on getmass(molecules)
r e a l (dpkind) :: getmass
55 t ype (molecule), i n t e n t ( i n ) :: molecules
getmass = molecules%mass
end f u n c t i on getmass
! 2006 g e t s bond l e ng t h of mol e c ul e
60 f u n c t i on getblength(molecules)
r e a l (dpkind) :: getblength
t ype (molecule), i n t e n t ( i n ) :: molecules
getblength = molecules%blength
end f u n c t i on getblength
65
end modul e datatype_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 92
B.1.2 input
modul e input_mod
us e datatype_mod
i mp l i c i t none
save
! 2006 Thi s module s av e s a l l p h y s i c a l i nput s f or t he s ys t e m
! of i n t e r e s t and t he c omput at i onal
! paramet ers ne c e s s ar y
! 2006 from at omi c uni t s t o Ke l vi n
r e a l (dpkind), par amet er :: convautok = 3.157772 e5_dpkind
! 2006 i nput s t u f f
! IMPORTANT paramet ers
! ! ! ! ! ! ! ! ! !
! 2006 c omput at i onal paramet ers
i n t e g e r (i32kind), par amet er :: nrd = 1, nmd=32, nmd1=nmd+1, &
nprod = nrd * nmd1 * nmd
! 2006 s i z e s
i n t e g e r (i32kind), par amet er :: nstate=9, nblock=3, &
ndiag = nstate*nblock
! 2006 maximum s i z e s
i n t e g e r (i32kind), par amet er :: nstatem=9, nblockm =15, nblockm1=nblockm +1
i n t e g e r (i32kind), par amet er :: ndiagm=nblockm*nstatem
! 2006 t i me s t e p
r e a l (dpkind), par amet er :: dt0 =1000 _dpkind
i n t e g e r (i32kind), par amet er :: ncut = 7_i32kind
r e a l (dpkind) :: dt, rdt , dt2 , cut
! 2006 paramet ers f or i t e r a t i o n s i z e s
i n t e g e r (i32kind), par amet er :: nr = nrd , nl = nmd , nm = nmd , nn = 2*nr
! 2006 s t u f f f or g aus s l e g e ndr e quadrat ures
r e a l (dpkind) :: x(nmd+nmd1), weight(nmd+nmd1), anode(nmd+nmd1)
! end i n i t i a l i z a t i o n of c omput at i onal paramet ers
! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! !
! 2006 p h y s i c a l paramet ers
! 2006 MORE INPUT STUFF
! 2006 de f i ne hydrogen
t ype (molecule), par amet er :: hydrogen = molecule (1836.0 _dpkind , 1.449 _dpkind)
! 2006 p o t e nt i a l g r i d
! can upgrade by addi ng more c oordi nat e , e . g . c e nt e r of mass
r e a l (dpkind) :: vang(nmd1 ,nmd)
r e a l (dpkind) :: vps(nmd1 ,nmd), wtot(nmd1 ,nmd)
r e a l (dpkind) :: ev2(nmd1 ,nmd)
! end i n i t i a l i z a t i o n of p h y s i c a l paramet ers
! ! ! ! ! ! ! ! ! ! ! !
! 2006 s t a t e v e c t o r
r e a l (dpkind) :: psi(nmd1 ,nmd ,nstatem ,nblockm1), eigfinal(nstatem)
! 2006 s i nt e t c are used f or t r i g o no me t r i c c a l c ul a t i o ns ,
! may be b e t t e r as l o c a l v a r i a b l e s
! 2006 g r i d i n s e par ab l e c oor di nat e s
r e a l (dpkind) :: sint(nmd1), cosp(nmd), sinp(nmd), rr(1)
B.1. MODULES AND EXTERNAL ROUTINES Hang 93
c o n t a i n s
! 2006 t o be used t o s e t vps when vang i s de f i ne d
s ub r out i ne set_vps ()
! 2006 c ur r e nt l y i nput s from matrix , t h i s part can be
! r e wr i t t e n t o i nput from f i l e , e t c .
i n t e g e r (i32kind) :: itheta , iphi
do itheta = 1, nmd1
do iphi = 1, nmd
vps(itheta ,iphi) = vang(itheta ,iphi) / convautok
enddo
enddo
r e t ur n
end s ub r out i ne set_vps
! 2006 t o be used t o f i nd t he we i g h t s of GaussLeg e ndre quadrat ures
s ub r out i ne set_gaussleg(n)
i n t e g e r (i32kind), i n t e n t ( i n ) :: n
i n t e g e r (i32kind) :: nnn , i
i n t e g e r (i32kind), par amet er :: nrm = 300 , nrm21 = 601
r e a l (dpkind) :: a(nrm), z(nrm)
r e a l (dpkind) :: p(nrm21), pd(nrm21)
! ! ! ! ! 2006 c r i t f or t o l e r a nc e of g aus s l e g e ndr e quadrat ure
r e a l (dpkind) :: crit = 1e-14 _dpkind
c a l l gasleg(z,a,nrm ,p,pd ,nrm21 ,crit ,n,pi)
nnn = n/2 _i32kind
i f (mod(n,2 _i32kind) .ne. 0_i32kind) nnn = nnn + 1
do i = 1, nnn
x(n-i+1) = z(i)
x(i) = -x(n-i+1)
weight(n-i+1) = a(i)
weight(i) = weight(n-i+1)
enddo
r e t ur n
end s ub r out i ne set_gaussleg
s ub r out i ne set_psi(delt)
! ! ! ! ! 2006 I t g e t s a f i r s t approxi mat i on t o t he wave f unc t i on
! ! ! ! ! I t hi nk by wi g g l i n g around t he f r e e r ot or s o l ut i o n
! ! ! ! ! 2006 s i nt c os p s i np are i n common , t he ot he r ar r ays l o c a l l y
! ! ! ! ! ki nd of odd I know . . .
! ! ! ! ! 2006 c o nt r o l s t he s pac e s l i c e / s t e p
r e a l (dpkind), i n t e n t ( i n ) :: delt
! ! ! ! ! 2006 i nt e r na l v a r i a b l e s
i n t e g e r (i32kind) :: ix , ip , ist , ib
r e a l (dpkind) :: dp, phi , tphi , rphi , anorm_const , aa
! ! ! ! ! 2006 c os ( 2 phi ) s i n ( 2 phi ) c os ( 3 phi ) s i n ( 3 phi )
r e a l (dpkind) :: cos2p(nmd+nmd1), sin2p(nmd+nmd1), &
cos3p(nmd+nmd1), sin3p(nmd+nmd1)
dp = 2 * pi / nm
do ip = 1, nm
phi = dp *(ip - 1)
tphi = 2*phi
rphi = 3*phi
cosp(ip) = cos(phi)
sinp(ip) = sin(phi)
cos2p(ip) = cos(tphi)
sin2p(ip) = sin(tphi)
cos3p(ip) = cos(rphi)
B.1. MODULES AND EXTERNAL ROUTINES Hang 94
sin3p(ip) = sin(rphi)
enddo
do ix = 1, nl+1
sint(ix) = sqrt(1 - x(ix)*x(ix))
enddo
! ! ! ! ! 2006 s e t up ps i
! ! ! ! ! 2006 s e t t o 0 f i r s t
psi = 0
! ! ! ! ! 2006 redo l oop i ns t e ad of i p ix , do i x i p t o i nc r e a s e e f f i c i e n c y
do ix = 1, nl+1
do ip = 1, nm
psi(ix ,ip ,1,1) = 1
psi(ix ,ip ,2,1) = sint(ix)*sinp(ip)
psi(ix ,ip ,3,1) = sint(ix)*cosp(ip)
psi(ix ,ip ,4,1) = x(ix)
psi(ix ,ip ,5,1) = &
(3*x(ix)*x(ix)-1)
psi(ix ,ip ,6,1) = sint(ix)*x(ix)*cosp(ip)
psi(ix ,ip ,7,1) = sint(ix)*x(ix)*sinp(ip)
psi(ix ,ip ,8,1) = sint(ix)*sint(ix)* sin2p(ip)
psi(ix ,ip ,9,1) = sint(ix)*sint(ix)* cos2p(ip)
enddo
enddo
! ! ! ! ! 2006 normal i ze
do ist = 1, nstate
anorm_const = 0
do ix = 1, nl+1
do ip = 1, nm
anorm_const = anorm_const+weight(ix) &
*psi(ix ,ip,ist ,1) * psi(ix ,ip ,ist ,1)
enddo
enddo
anorm_const = anorm_const*delt
aa = 1/sqrt(anorm_const)
psi(:,:,ist ,1) = psi(:,:,ist ,1) * aa
enddo
r e t ur n
end s ub r out i ne set_psi
end modul e input_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 95
B.1.3 fft mod
modul e fft_mod
us e datatype_mod
! 2006 i f i n i t i a l i z e d work ar r ays t hen i t i s t rue ,
! by de f aul t i t i s f a l s e
l o g i c a l , p r i v a t e :: workinit =.false.
r e a l (dpkind), di mens i on (:), a l l o c a t a b l e , p r i v a t e :: worksav , work
c o n t a i n s
s ub r out i ne cfft(transform , isign)
i mp l i c i t none
compl ex(dpkind), di mens i on (:), i n t e n t ( i nout ) :: transform
i n t e g e r (i32kind), i n t e n t ( i n ) :: isign
i n t e g e r (i32kind) :: savlen , numm , istatus , mm
numm= s i z e (transform)
savlen = numm*3 +4
mm=numm / 2
! de a l l o c a t e i f al r e ady a l l o c a t e d
i f ((. not. workinit) .and. (isign .eq. 0)) t hen
i f (allocated(worksav )) d e a l l o c a t e (worksav)
i f (allocated(work)) d e a l l o c a t e (work)
a l l o c a t e (worksav(savlen),work (2* numm))
workinit = .true.
e l s e i f ((. not. workinit) .and. (isign .ne. 0)) t hen
wr i t e (*,*) "Error ,initializeworkarraysfirst."
s t op
e n d i f
i f (isign .lt. 0) t hen
c a l l cfft1b(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s e i f (isign .gt. 0) t hen
c a l l cfft1f(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s e
c a l l cfft1i(numm ,worksav ,savlen ,istatus)
e n d i f
i f (istatus .ne. 0) t hen
wr i t e (*,*) "Errorincfft"
s t op
e n d i f
end s ub r out i ne cfft
end modul e fft_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 96
B.1.4 overlap mod
modul e overlap
us e datatype_mod
i n t e r f a c e set_wtot
modul e procedure set_rwtot
modul e procedure set_cwtot
end i n t e r f a c e
i n t e r f a c e ope r a t or (. overlap .)
modul e procedure real_overlap
modul e procedure complex_overlap
end i n t e r f a c e
compl ex(dpkind), di mens i on (:,:), a l l o c a t a b l e , p r i v a t e :: wtot
c o n t a i n s
s ub r out i ne set_rwtot(rwin)
r e a l (dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: rwin
i f (allocated(wtot)) d e a l l o c a t e (wtot)
a l l o c a t e (wtot( s i z e (rwin ,1), s i z e (rwin ,2)))
wtot = rwin
end s ub r out i ne set_rwtot
s ub r out i ne set_cwtot(cwin)
compl ex(dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: cwin
i f (allocated(wtot)) d e a l l o c a t e (wtot)
a l l o c a t e (wtot( s i z e (cwin ,1), s i z e (cwin ,2)))
wtot = cwin
end s ub r out i ne set_cwtot
f u n c t i on real_overlap(rpsi1 ,rpsi2)
r e a l (dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: rpsi1
r e a l (dpkind) , di mens i on ( s i z e (rpsi1 ,1), s i z e (rpsi1 ,2)) , &
i n t e n t ( i n ) :: rpsi2
r e a l (dpkind) :: real_overlap
i f (allocated(wtot)) t hen
real_overlap = sum(rpsi1 * rpsi2 * r e a l (wtot ,dpkind ))
e l s e
real_overlap = sum(rpsi1 * rpsi2)
e n d i f
end f u n c t i o n real_overlap
f u n c t i on complex_overlap(cpsi1 ,cpsi2)
compl ex(dpkind) , di mens i on (:,:) , i n t e n t ( i n ) :: cpsi1
compl ex(dpkind) , di mens i on ( s i z e (cpsi1 ,1), s i z e (cpsi1 ,2)) , &
i n t e n t ( i n ) :: cpsi2
compl ex(dpkind) :: complex_overlap
i f (allocated(wtot)) t hen
complex_overlap = sum(cpsi1 * conjg(cpsi2) * wtot)
e l s e
complex_overlap = sum(cpsi1 * conjg(cpsi2 ))
e n d i f
end f u n c t i o n complex_overlap
end modul e overlap
B.1. MODULES AND EXTERNAL ROUTINES Hang 97
B.1.5 prop mod
modul e prop_mod
us e datatype_mod
us e input_mod
i mp l i c i t none
save
! 2006 pr opag at i on s t u f f exp( t au e i g )
! 2006 s houl d be i nc or por at e d i nt o a module f or
! a p p l i c a t i o n of pr opag at or
r e a l (dpkind) :: prop(nl+1), propl(nl+1)
end modul e prop_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 98
B.1.6 trans mod
modul e trans_mod
us e datatype_mod
us e input_mod
i mp l i c i t none
save
! 2006 s t u f f f or l e g e ndr e t r ans f or mat i on
! changed names from p and pi t o
! p l t r a ns t o p i l t r a n s
! 2006 s houl d be i nc or por at e d t o wrapper l i k e i n c f f t module
r e a l (dpkind) :: p_ltrans(nmd+nmd1 , nmd+nmd1 , nmd1), &
pi_ltrans(nmd+nmd1 ,nmd+nmd1 ,nmd1)
end modul e trans_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 99
B.1.7 gasleg
s ub r out i ne gasleg(z,a,nrm ,p,pd ,nrm21 ,crit ,n,pi)
i n t e g e r nrm , nrm21
doubl e p r e c i s i o n crit , pi
doubl e p r e c i s i o n z(nrm), a(nrm)
doubl e p r e c i s i o n p(nrm21), pd(nrm21)
i n t e g e r n
c 2006 ol d s t uf f , e x i s t s be c aus e I j u s t do not want t o break t h i ng s ag ai n
i mp l i c i t doubl e p r e c i s i o n (a-h,o-z)
c 2006 g e t we i g h t s and nodes of g aus s l e g e ndr e quadrat ure
c 2006 t h i s r out i ne s o l v e s f or t he r oot s of t he l e g e ndr e pol ynomi al
c and f i nds t he we i g h t s f or a g aus s i an quadrat ure
c n i s t he number of poi nt s used i n t he quadrat ure
c z ( ) s are t he nodes and t he a ( ) s are t he we i g h t s
c 2006 i nt e r na l v a r i a b l e s
i n t e g e r nn , ifin , iodd , nknt , k, in
doubl e p r e c i s i o n c, cha , chb , dn , dn2 , den , bes , x, pdx , ta , z2
i f (n.le .600) go t o 1
wr i t e (6 ,900) n
900 f or mat (10x,31h***** gasleg n too large *****,nis,i8)
go t o 9
1 c ont i nue
nn=n+1
ifin=0
iodd=1
c=2.0d0/dble(pi)
c=1.0d0 -(c*c)
nknt=n/2
i f (mod(n,2).eq.0) iodd=0
k=1
cha =0.0d0
chb =0.0d0
p(1)=1.0 d0
dn=dble(n)+0.5d0
dn2=dn*dn
den=sqrt(dn2+(c/4.0d0))
6 c ont i nue
bes=zbes(k)
x=cos(bes/den)
pdx =1.00d0 /(1.0d0-x*x)
4 c ont i nue
p(2)=x
do 2 i=3,nn
in=i-1
im=i-2
p(i)=((2.0 d0*dble(in)-1.0d0)*x*p(in)-dble(im)*p(im))
1 /dble(in)
pd(i)=dble(in)*pdx*(p(in)-x*p(i))
2 c ont i nue
i f (ifin.eq.1) go t o 10
i f (abs(p(nn)).lt.crit) go t o 3
x=x-(p(nn)/pd(nn))
pdx =1.0d0 /(1.0d0 -x*x)
go t o 4
3 c ont i nue
z(k)=x
ta=n*p(n)
ta=(n*p(n))**2
B.1. MODULES AND EXTERNAL ROUTINES Hang 100
a(k)=(2.0 d0 *(1.0d0-x*x))/ dble(ta)
cha=cha +2.0d0*a(k)
z2=z(k)*z(k)
chb=chb +2.0d0*a(k)*z2
i f (k.eq.nknt)go t o 5
k=k+1
go t o 6
5 c ont i nue
i f (iodd.eq.0)go t o 9
x=0.0d0
k=nknt+1
z(k)=x
ifin=1
go t o 4
10 c ont i nue
ta=dble(n)*p(n)
ta=ta*ta
a(k)=2.0 d0/ta
cha=cha+a(k)
9 c ont i nue
r e t ur n
end
B.1. MODULES AND EXTERNAL ROUTINES Hang 101
B.1.8 zbes
f u n c t i on zbes(k)
us e datatype_mod
i mp l i c i t none
! 2006 Thi s module i s s i mpl y c opi e d from t he ol d code t o make t h i ng s work
r e a l (dpkind) zbes
i n t e g e r (i32kind), i n t e n t ( i n ) :: k
! 2006 i nt e r na l v a r i a b l e s
r e a l (dpkind) b, bb, b3, b5, b7
b = ( r e a l (k,dpkind ) -0.25 _dpkind) * pi
bb = 1.0 _dpkind / (8 * b)
b3 = bb**3.0 _dpkind
b5 = bb**5.0 _dpkind
b7 = bb**7.0 _dpkind
zbes = b + bb - (124.0 _dpkind / 3)*b3 &
+ (120928.0 _dpkind / 15)*b5 &
- (401743168.0 _dpkind / 105)* b7
r e t ur n
end f u n c t i o n zbes
B.2. CENTRAL PROCESS Hang 102
B.2 Central Process
B.2.1 estates
s ub r out i ne estates(energy)
us e datatype_mod
us e input_mod
i mp l i c i t none
! 2006 t he onl y t h i ng you need i s t he e i g e nv a l ue .
r e a l (dpkind), i n t e n t ( i nout ) :: energy(nstate)
! 2006 Thi s i s a l l e s t a t e s does . However , t h i s i s a p o t e nt i a l
! wrapper s i t e t o add modul es .
c a l l lanch2(energy ,nstate)
r e t ur n
end s ub r out i ne estates
B.2. CENTRAL PROCESS Hang 103
B.2.2 lanch2
s ub r out i ne lanch2(eig)
us e datatype_mod
us e input_mod
us e trans_mod
i mp l i c i t none
! 2006 run l anc z os s ubr out i ne
! 2006 more l i k e a wrapper f or bot h i n i t i a l i z a t i o n and e xe c ut i on
! of t he Lanczos r out i ne
! I t c a l l s g e t t t o i n i t i a l i z e r out i ne s ,
! t hen f o ur i e r t o do t he ac t ual e i g e nv a l ue s o l v i ng .
! 2006 The e i g e nv a l ue s
r e a l (dpkind), i n t e n t ( i nout ) :: eig(nstate)
! 2006 i nt e r na l v a r i a b l e s
! 2006 r adi al p r o b a b i l i t y de ns i t y
r e a l (dpkind) :: pr(1)
! 2006 l e f t over be c aus e can t i n i t i a l i z e t h i s i n a module
! f or some ve r y odd reas on
cut = sqrt (5.0 _dpkind)
! 2006 c he c k t h i ng s out
! 2006 probabl y l e g a c y from when r e adi ng from f i l e ,
! but probabl y a good i de a t o keep
i f (nblock .gt. nblockm) t hen
wr i t e (*,*) "nblocktoolarge"
r e t ur n
e n d i f
i f (nstate .gt. nstatem) t hen
wr i t e (*,*) "nstatetoolarge"
r e t ur n
e n d i f
! 2006 g e t t ranform mat ri x
! 2006 i ndeed , seems t o g e t some mat ri x / v e c t o r f or a v e c t o r i z e d
! l e g e ndr e t r ans f or mat i on r out i ne
c a l l gett(p_ltrans ,pi_ltrans ,anode ,weight ,nl,nm)
! 2006 c a l c u l a t e t he e i g e nv a l ue s
! 2006 e i g r e t ur ns t he e i g e nv al ue s , pr are t he r adi al
! p r o b a b i l i t y d i s t r i b u t i o n s
c a l l fourier(eig ,pr)
r e t ur n
end s ub r out i ne lanch2
B.2. CENTRAL PROCESS Hang 104
B.2.3 gett
s ub r out i ne gett(pr ,pir ,xr,weightr ,lmax ,mmax)
us e datatype_mod
us e input_mod
us e trans_mod
i mp l i c i t none
! 2006 t h i s r out i ne g e s t s t he t r ans f or mat i on mat r i c e s t o go
! and from lm
! 2006 i t g e t s t he mat ri x e l e me nt s f or
! Le g endre t rans f orm
i n t e g e r (i32kind), i n t e n t ( i n ) :: lmax , mmax
! 2006 pr i s t r ans f or mat i on v e c t o r
! pi r i s anot her t r ans f or mat i on v e c t o r
! xr and we i g h t r are hol di ng t e mpor ar i l y x and we i g ht
r e a l (dpkind), i n t e n t ( i nout ) :: pr(nmd+nmd1 ,nmd+nmd1 ,nmd1), &
pir(nmd+nmd1 ,nmd+nmd1 ,nmd1), xr(nmd+nmd1), weightr(nmd+nmd1)
! 2006 i nt e r na l v a r i a b l e
r e a l (dpkind) sx , aa , al
i n t e g e r (i32kind) ix, am, im, il
i f (lmax .lt. mmax /2) wr i t e (*,*) "lmaxtoosmall"
! 2006 g e t g aus s i an quadrat ure p o s i t i o n and we i g h t s
c a l l set_gaussleg(lmax +1)
! 2006 us e r e c ur r s i on r e l a t i o n s f or a s s o c i a t e d
! l e g e ndr e f unc t i ons , modi f i ed t o i nc l ude normal i zat i on ,
! t o s e t up t he mat r i c e s f or t he t r ans f or mat i ons
do ix = 1, lmax+1
sx = sqrt(1 -x(ix)*x(ix))
am = 0
pi_ltrans (1,ix ,1) = 1 / sqrt (2.0 _dpkind)
! 2006 i nc rement l , f i xe d m
c a l l upn(1,lmax ,pi_ltrans(1,ix ,1),x(ix),am)
do im = 1, mmax/2
am = im
al = r e a l (im ,dpkind)
aa = sqrt( (2*al+1) / (2*al) )
! 2006 i nc rement l and m f or l = m
pi_ltrans(im+1,ix,im+1) = aa*sx*pi_ltrans(im,ix ,im)
! 2006 i nc remnet l f i xe d m
c a l l upn(im+1,lmax ,pi_ltrans (1,ix ,im+1),x(ix),am)
enddo
enddo
do im = 0, mmax/2
do il = im , lmax
do ix = 1, lmax+1
p_ltrans(ix,il+1,im+1) = pi_ltrans(il+1,ix ,im+1)* weight(ix)
pr(ix ,il-im+1,im+1) = p_ltrans(ix ,il+1,im+1)
pir(il -im+1,ix ,im+1) = pi_ltrans(il+1,ix,im+1)
enddo
enddo
enddo
xr = x
weightr = weight
r e t ur n
end s ub r out i ne
B.2. CENTRAL PROCESS Hang 105
B.2.4 upn
s ub r out i ne upn(nmin ,nmax ,p_upn ,x_upn ,am)
us e datatype_mod
us e input_mod
i mp l i c i t none
! 2006 r a i s i ng and l owe r i ng ope r at or s t o f i nd P l m
i n t e g e r (i32kind), i n t e n t ( i n ) :: nmin , nmax , am
r e a l (dpkind), i n t e n t ( i n ) :: x_upn
r e a l (dpkind), i n t e n t ( i nout ) :: p_upn(nmax +1)
! 2006 i nt e r na l v a r i a b l e s
i n t e g e r (i32kind) :: i
r e a l (dpkind) :: al, aa, bb, cc
al = r e a l (nmin ,dpkind)
p_upn(nmin +1) = sqrt (2*al+1)* x_upn*p_upn(nmin)
do i = nmin+1,nmax
al = r e a l (i,dpkind)
aa = sqrt( (2*al +1)/( al+am) &
/ (al -am) )
bb = sqrt((al+am -1) &
* (al -am -1) / (2*al -3))
cc = sqrt (2*al -1)
p_upn(i+1) = aa*(cc*x_upn*p_upn(i) - bb*p_upn(i-1))
enddo
r e t ur n
end s ub r out i ne upn
B.2. CENTRAL PROCESS Hang 106
B.2.5 fourier
s ub r out i ne fourier(eig0 ,pr)
us e datatype_mod
us e input_mod
us e overlap
i mp l i c i t none
! 2006 Thi s s o l v e s t he e i g e nv a l ue probl em . Pr e t t y much .
! 2006 Thi s us e s ds yev from t he l apac k l i b r a r i e s .
! Be c a r e f ul . Lapack depends on b l as .
! 2006 e i g e nv a l ue s
r e a l (dpkind), i n t e n t ( i nout ) :: eig0(nstate)
! 2006 pr i s t he p r o b a b i l i t y d i s t r i b u t i o n
r e a l (dpkind), i n t e n t ( i nout ) :: pr(1)
! 2006 i nt e r na l v a r i a b l e s
! 2006 nt i me i s number of i t e r a t i o na
i n t e g e r (i32kind) :: ntime = ncut
! 2006 most of t h e s e are i ndi c e s and boundri es
i n t e g e r (i32kind) :: i, j, k, jjj , kkk , itime , istart , ib , ibp , &
info , ip, ix , ir , xcomp , ycomp , zcomp , propa , vectr , istate
! 2006 de l t seems t o be a s pac e s l i c e / s t e p c ont r ol
r e a l (dpkind) :: delt , aa, prod , dr ! , phi , dp
! 2006 f or v e c t o r normal i zat i on
r e a l (dpkind) :: anorm(nprod)
! 2006 a c t ua l l y f or ds yev r at he r than f f t , odd .
r e a l (dpkind) :: workfft(nprod)
! 2006 t emporary s t o r a g e of e i g e nv a l ue I t hi nk
r e a l (dpkind) :: eigv(ndiagm)
! 2006 H mat ri x
r e a l (dpkind) :: hmat(ndiagm , ndiagm)
! 2006 ground s t a t e
r e a l (dpkind) :: ground(nmd1 ,nmd)
dr = getblength(hydrogen)
delt = 2 * pi / nm
! 2006 g e t we i g h t s f or ove r l ap of wave f unc t i ons
do ix = 1, nl+1
do ip = 1, nm
wtot(ix ,ip) = delt * weight(ix)
enddo
enddo
c a l l set_wtot(wtot)
! 2006 i n i t i a l i z e t he s t a t e v e c t o r
c a l l set_psi(delt)
! 2006 i n i t i a l i z e t he p o t e nt i a l
vps = 0
c a l l set_vps ()
istart = 0
dt = dt0 * cut
! 2006 s t a r t l anc z os wi t h o r t h a g o na l i t y
! 2006 Thi s i s a huge l oop . Cl eared up most of t he c l u t t e r .
do itime = 1, ntime
dt = dt / cut
c a l l getProp ()
dt2 = dt / 2
! 2006 g e t exp( \ t au / 2 V)
ev2 = exp(-dt2*vps)
B.2. CENTRAL PROCESS Hang 107
hmat = 0
! 2006 s e t up a l l t he b l o c k s and or t honor mal i ze them
do ib = 1, nblock
do ibp = 1, ib -1
! 2006 o r t h o g o nal i z e t o a l l l owe r b l o c k s ( a must )
do k = 1, nstate
anorm = 0 * anorm
do j = 1, nstate
anorm(j) = anorm(j) + psi(:,:,j,ibp) .overlap. psi(:,:,k,ib)
enddo
do j = 1, nstate
psi(:,:,k,ib) = psi(:,:,k,ib) - anorm(j) * psi(:,:,j,ibp)
enddo
enddo
enddo
do k = 1, nstate
! 2006 s e l f o r t h ag o nal i z e t o t h i s bl oc k
anorm = 0 * anorm
do j = 1, k
anorm(j) = anorm(j) + psi(:,:,j,ib) .overlap. psi(:,:,k,ib)
enddo
do j = 1, k-1
anorm(k) = anorm(k) - anorm(j)* anorm(j)
enddo
do j = 1, k-1
psi(:,:,k,ib) = psi(:,:,k,ib) - anorm(j) * psi(:,:,j,ib)
enddo
psi(:,:,k,ib) = psi(:,:,k,ib) / sqrt(anorm(k))
enddo
! 2006 appl y exp( t au H) t o Psi E and s t o r e i n Psi E ( i b +1)
! 2006 Thi s i s t he i t e r a t i o n part
! of Lanczos methods where you appl y t he mat ri x over and over
do k = 1, nstate
c a l l fullProp(psi(1,1,k,ib),psi(1,1,k,ib+1),delt)
! 2006 e v al uat e t he mat ri x e l e me nt s of T, t he bl oc k t r i di a g o na l one
kkk = (ib -1) * nstate + k
istart = max(1,ib -1)
! 2006 c o ns t r uc t s B { i b 1} dag g e r ( e xc e pt when i b = 1 ) ( he r e i b = k i n Gould )
do ibp = istart , ib -1
do j = 1, nstate
jjj = (ibp -1) * nstate + j
hmat(jjj ,kkk) = 0
hmat(jjj ,kkk) = hmat(jjj ,kkk) &
+ psi(:,:,j,ibp) .overlap. psi(:,:,k,ib+1)
hmat(kkk ,jjj) = hmat(jjj ,kkk)
enddo
enddo
! 2006 c o ns t r uc t s M { i b }
do j = 1, k
jjj = (ib -1) * nstate + j
hmat(jjj ,kkk) = 0
hmat(jjj ,kkk) = hmat(jjj ,kkk) &
+ psi(:,:,j,ib) .overlap. psi(:,:,k,ib+1)
hmat(kkk ,jjj) = hmat(jjj ,kkk)
enddo
enddo
enddo
! 2006 di ag o nal i z e
! 2006 ds y e v must have t he unde r s c ore f or ab s of t l apac k
! l i b r a r i e s , ot he r c ompi l e r s may vary , al s o has t o be l owe r c as e
! ds yev does s i ng ul a r val ue decompos i t i on , so
! s o l v e s t he e i g e nv a l ue probl em
c a l l dsyev_(V,L,ndiag ,hmat ,ndiagm ,eigv ,workfft ,3* ndiag +100, info)
! 2006 from e i g e nv a l ue s of exp( t au H) t o e i g e nv a l ue s of H
do kkk = 1, nstate
i = ndiag - kkk + 1
eigfinal(kkk) = -log(eigv(i))/dt
B.2. CENTRAL PROCESS Hang 108
enddo
psi(:,:,:, nblockm1) = 0
do kkk = 1, nstate
k = ndiag - kkk + 1
do ib = 1, nblock
do j = 1, nstate
jjj = (ib -1) * nstate + j
do ip = 1, nm
do ix = 1, nl+1
psi(ix ,ip ,kkk ,nblockm1) = &
psi(ix ,ip ,kkk ,nblockm1) &
+ psi(ix,ip ,j,ib) * hmat(jjj ,k)
enddo
enddo
enddo
enddo
enddo
! 2006 copy t o c o r r e c t pl ac e
! 2006 each i t e r a t i o n i t i me us e s t he pr e vi ous r e s u l t s as t he s t a r t i n g bl oc k
psi(:,:,:,1) = psi(:,:,:, nblockm1)
enddo
! 2006 ground s t a t e s t u f f
! 2006 not s ur e i f t h i s oug ht t o be i n t h i s s ubr out i ne or i n
! anot her one . . .
istate = 1
pr(1) = 0
do ix = 1, nl+1
do ip = 1, nm
prod = weight(ix) * psi(ix ,ip,istate ,1) &
* psi(ix,ip ,istate ,1)
ground(ix ,ip) = prod
pr(1) = pr(1) + prod
enddo
enddo
pr(1) = pr(1) * delt / dr
do i = 1, nstate
eig0(i) = eigfinal(i)
enddo
r e t ur n
end s ub r out i ne fourier
B.2. CENTRAL PROCESS Hang 109
B.2.6 getProp
s ub r out i ne getProp ()
us e datatype_mod
us e input_mod
us e prop_mod
i mp l i c i t none
! 2006 Thi s s ubr out i ne i n i t i a l i z e s t he pr opag at i on r out i ne .
! 2006 i nt e r na l v a r i a b l e s
r e a l (dpkind) :: aaa , al
i n t e g e r (i32kind) :: il
! 2006 r adi al part
prop = 1.0 _dpkind
! 2006 ang ul ar part
do il = 0, nl
al = r e a l (il ,dpkind)
aaa = al * (al + 1) / &
(getmass(hydrogen) * getblength(hydrogen) * getblength(hydrogen ))
propl(il+1) = exp(-dt*aaa)
enddo
r e t ur n
end s ub r out i ne
B.2. CENTRAL PROCESS Hang 110
B.2.7 fullProp
s ub r out i ne fullProp(psi0 , psi_prop , delt)
us e datatype_mod
us e input_mod
i mp l i c i t none
! 2006 Propag at i on by doi ng t he Tr ot t e r approxi mat i on
! 2006 t h i s s ubr out i ne a p p l i e s t he propag at or exp( t au H)
! t o t he wave f unc i t on ps i 0 t o i nt r oduc e ps i
! 2006 s pac e s l i c e / s t e p
r e a l (dpkind), i n t e n t ( i n ) :: delt
! 2006 s t a t e v e c t o r
r e a l (dpkind), i n t e n t ( i nout ) :: psi0(nmd1 ,nmd)
r e a l (dpkind), i n t e n t ( i nout ) :: psi_prop(nmd1 ,nmd)
! 2006 i nt e r na l v a r i a b l e s
i n t e g e r (i32kind) :: ix , ip
! 2006 mul t i pl y by t he p o t e nt i a l at t au / 2 i n r e a l s pac e
psi_prop = psi0 * ev2
! 2006 appl y t he k i n e t i c oe pr at or
c a l l trans_p(psi_prop)
! 2006 mul t i pl y t he po t e nt al at t au / 2 i n r e a l s pac e
psi_prop = psi_prop * ev2
r e t ur n
end s ub r out i ne
B.2. CENTRAL PROCESS Hang 111
B.2.8 trans p
s ub r out i ne trans_p(psir)
us e datatype_mod
us e input_mod
us e prop_mod
us e fft_mod
i mp l i c i t none
! 2006 s t a t e v e c t o r
r e a l (dpkind), i n t e n t ( i nout ) :: psir(nmd1 ,nmd)
! 2006 i nt e r na l paramet er , used t o make l i f e work
compl ex(dpkind) :: cwk(nmd1), awk(nmd1)
! 2006 compl ex wavef unc t i on hol de r s
compl ex(dpkind) :: psic(nmd1 ,nmd), psic2(nmd1 ,nmd1)
compl ex(dpkind) :: psictemp(nmd)
i n t e g e r (i32kind) :: i, ix, ip, mm , istatus , jprod , im , il , istart
mm = nm / 2
! 2006 redo l oop from i p i x t o i x i p t o i nc r e a s e e f f i c i e n c y
psic = psir
! 2006 i n i t i a l i z a t i o n f or c f f t 1 f / b c a l l s
c a l l cfft(psictemp ,0)
do il = 1, nl+1
do im = 1, nm
psictemp(im) = psic(il,im)
enddo
c a l l cfft(psictemp ,1)
do im = 1, nm
psic(il ,im) = psictemp(im)
enddo
enddo
! 2006 t rans f orm x=c os ( t h e t a )
! m >=0
do im = 0, mm
do i = 1, nl+1
cwk(i) = psic(i,im+1)
enddo
c a l l sltf(cwk ,awk ,im)
istart = im + 1
do i = istart , nl+1
psic(i,im+1) = awk(i)
enddo
enddo
! 2006 s i ne t rans f orm r pr opag at e and back t rans of mr
! m >=0
do im = 0, mm
do il = im , nl
psic2(il+1,im+1) = psic(il+1,im+1) * propl(il+1)
enddo
enddo
! 2006 dump p s i c 2 t o p s i c
do im = 0, mm
do il = im , nl
psic(il+1,im+1) = psic2(il+1,im+1)
enddo
enddo
! 2006 back t rans f orm t o x=c os ( t h e t a )
! m >=0
do im = 0, mm
istart = im + 1
B.2. CENTRAL PROCESS Hang 112
do i = istart , nl+1
cwk(i) = psic(i,im+1)
enddo
c a l l sltb(cwk ,awk ,im)
do i = 1, nl+1
psic(i,im+1) = awk(i)
enddo
enddo
! 2006 m < 0
! 2006 us e symmetry t o s i mp l i f y l i f e
do im = 1, mm -1
do i = 1, nl+1
psic(i,nm -im+1) = conjg(psic(i,im+1))
enddo
enddo
! 2006 back t rans f orm t o phi
do il = 1, nl+1
do im = 1, nm
psictemp(im) = psic(il,im)
enddo
c a l l cfft(psictemp ,-1)
do im = 1, nm
psic(il ,im) = psictemp(im)
enddo
enddo
psir = r e a l (psic ,dpkind)
r e t ur n
end s ub r out i ne trans_p
B.2. CENTRAL PROCESS Hang 113
B.2.9 sltb and sltf
s ub r out i ne sltb(cwk ,awk ,im)
us e datatype_mod
us e input_mod
us e prop_mod
us e trans_mod
i mp l i c i t none
compl ex(dpkind), i n t e n t ( i n ) :: cwk(nmd1)
i n t e g e r (i32kind), i n t e n t ( i n ) :: im
compl ex(dpkind), i n t e n t ( i nout ) :: awk(nmd1)
! 2006 i nt e r na l v a r i a b l e s
i n t e g e r (i32kind) :: i, il, ix
! 2006 i n i t i a l i z e t he compl ex number
do i = 1, nl+1
awk(i) = 0
enddo
! 2006 appl y t he mat ri x f or t he t r ans f or mat i on
do il = im , nl
do ix = 1, nl+1
awk(ix) = awk(ix) + pi_ltrans(il -im+1,ix,im+1)* cwk(il+1)
enddo
enddo
r e t ur n
end s ub r out i ne sltb
s ub r out i ne sltf(cwk ,awk ,im)
us e datatype_mod
us e input_mod
us e prop_mod
us e trans_mod
i mp l i c i t none
compl ex(dpkind), i n t e n t ( i n ) :: cwk(nmd1)
i n t e g e r (i32kind), i n t e n t ( i n ) :: im
compl ex(dpkind), i n t e n t ( i nout ) :: awk(nmd1)
! 2006 i nt e r na l v a r i a b l e s
i n t e g e r (i32kind) :: im1 , nl1 , istart , i, il , ix
im1 = im+1
nl1 = nl+1
istart = im*nr+1
! 2006 i n i t i a l i z a t i o n
do i = istart , nl1
awk(i) = 0
enddo
! 2006 appl y t he mat ri x f or t he t r ans f or mat i on
do ix = 1, nl1
do il = im1 , nl1
awk(il) = awk(il) + p_ltrans(ix ,il -im ,im1)*cwk(ix)
enddo
enddo
r e t ur n
end s ub r out i ne sltf
References
[1] Department of Energy (2005), URL http://www1.eere.energy.gov/
hydrogenandfuelcells/mypp/pdfs/storage.pdf.
[2] G. C. Welch, R. R. San Juan, J. D. Masuda, and D. W. Stephan, Science 314, 1124
(2006).
[3] E. Durgun, S. Ciraci, W. Zhou, and T. Yildirim, Phys. Rev. Lett. 97 (2006).
[4] G. Garberoglio, A. I. Skoulidas, and J. K. Johnson, J. Phys. Chem. B 109, 13094
(2005).
[5] N. L. Rosi, J. Eckerk, M. Eddaoudi, D. T. Vodak, J. Kim, M. OKeee, and O. M.
Yaghi, Science 300, 1127 (2003).
[6] J. L. C. Rowsell, J. Eckert, and O. M. Yaghi, J. Am. Chem. Soc. 127, 14904 (2005).
[7] G. Chen, X. G. Gong, and C. T. Chan, Phys. Rev. B 72 (2005).
[8] W. B. Fowler, P. Walters, and M. Stavola, Phys. Rev. B 66 (2002).
[9] H. Lee, J.-W. Lee, D. Y. Kim, J. Park, Y.-T. Seo, H. Zeng, I. L. Moudrakovski,
C. I. Ratclie, and J. A. Ripmeester, Nature 434, 743 (2005).
[10] A. W. C. van den Berg, S. T. Broomley, J. C. Wojdel, and J. C. Jansen, Phys. Rev.
B 72 (2005).
[11] R. Pynn (2001), URL http://www.mrl.ucsb.edu/
~pynn/Lecture 6 inelastic.pdf.
114
REFERENCES Hang 115
[12] J. R. Boccio, QuantumMechanics: Mathematical Structure, Physical Structure
and Applications in the Physical World (2005).
[13] J. S. Townsen, A Modern Approach to Quantum Mechanics (University Sci-
ence Books, 2000), 2nd ed.
[14] J. M. Nicol, J. Eckert, and J. Howard, J. Phys. Chem. 92, 7117 (1988).
[15] R. F. Curl, Jr., H. P. Hopkins, Jr., and K. S. Pitzer, J. Chem. Phys. 48, 4064 (1968).
[16] J. Eckert and G. J. Kubas, J. Phys. Chem. 97, 2378 (1993).
[17] N. Zettili, Quantum Mechanics: Concepts and Applications (John Wiley &
Sons, 2001).
[18] S. T. Thornton and J. B. Marion, Classical Dynamics of Particles and Systems
(Brooks Cole, 2003), 5th ed.
[19] T. R. MacRury and J. R. Sams, Mol. Phys. 19, 337 (1970).
[20] M. Razavy, Quantume Theory of Tunneling (World Scientic, 2003).
[21] D. A. McQuarrie, Quantum Chemistry (University Science, 1983).
[22] C.-R. Anderson, D. F. Coker, J. Eckert, and A. L. R. Bug, J. Phys. Chem. 111,
7599 (1999).
[23] R. M. Dimeo, Am. J. Phys. 71, 885 (2003).
[24] G. H. Gould and C. F. van Loan, Matrix Computations (Johns Hopkins Univ.
Press, 1996), 3rd ed.
[25] Z. Bai, J. Demmel, J. Dongarra, A. Ruhe, and H. van der Vorst, eds., Templates
for the Solution of Algebraic Eigenvalue Problems: A Practical Guide (SIAM,
Philadelphia, 2000).
[26] A. Ruhe, Templates for the Solution of Algebraic Eigenvalue Problems: APrac-
tical Guide (SIAM, Philadelphia, 2000), section 4.4.
REFERENCES Hang 116
[27] C. Lanczos, J. Res. Natl. Bur. Stand. 45, 255 (1950).
[28] J. K. Cullum and R. A. Willoughby, Lanczos Algorithms for Large Symmetric
Eigenvalue Computations, vol. 1 (Birkh auser, Boston, 1985).
[29] C. C. Paige, PhD dissertation, Univ. of London (1971).
[30] S. Kaniel, Math. Comp. 20, 369 (1966).
[31] C. C. Paige, J. Inst. Math. Its Appl. 18, 341 (1976).
[32] Y. Saad, SIAM J. Numer. Anal. 17, 687 (1980).
[33] R. W. Freund, Templates for the Solution of Algebraic Eigenvalue Problems: A
Practical Guide (SIAM, Philadelphia, 2000), section 4.6.
[34] Z. Bai and D. Day, Templates for the Solution of Algebraic Eigenvalue Prob-
lems: A Practical Guide (SIAM, Philadelphia, 2000), section 7.9.
[35] H. F. Baker, Proc. London Math. Soc. 34, 347 (1902).
[36] J. E. Campbell, Proc. London Math. Soc. 29, 14 (1898).
[37] F. Hausdor, Ber. Verhandl. S achs. Akad. Wiss. Leipzig, Math.-Naturw. Kl. 58,
19 (1906).
[38] R. M. Wilcox, J. Math. Phys. 8, 962 (1967).
[39] H. F. Trotter, Proc. Am. Math. Soc. 10, 545 (1959).
[40] R. M. Fye, Phys. Rev. B 33, 6271 (1986).
[41] H. De Raedt and B. De Raedt, Phys. Rev. A 28, 3575 (1983).
[42] M. Suzuki, Commun. Math. Phys. 51, 183 (1976).
[43] M. Metcalf and J. K. Reid, Fortran 90/95 Explained (Oxford Univ. Press, 1999),
2nd ed.
REFERENCES Hang 117
[44] S. J. Chapman, Fortran 90/95 for Scientists and Engineers (McGraw-Hill, 2003),
2nd ed.
[45] V. K. Decyk, C. D. Norton, and B. K. Szymanski, Tech. Rep., Institute of Plasma
and Fusion Research, UCLA Dept. of Physics and Astronomy (1996), URL
http://www.cs.rpi.edu/~szymansk/OOF90/F90 Objects.html.
[46] T. W. Cronin, Undergraduate thesis, Swarthmore College (2006).
[47] Z. Wolfson, Undergraduate thesis, Swarthmore College (2006).
[48] M. Matsumoto and T. Nishimura, ACM Trans. Model. Comput. Simul. 8, 3
(1998).
[49] D. Eddelbuettel (2006), URL http://www.stat.auckland.ac.nz/
dsc-2007/abstracts/eddelbuettel06Oct16.pdf.
Glossary
incoherent inelastic neutron scattering (IINS)
Experimental technique where monochromatic neutrons are scattering inelas-
tically from a sample and the signal rises from independent scattering centers.
1216, 86
Krylov matrix
Given an n n matrix A, a vector q of length n, and a natural number k, the
Krylov matrix K(A,q
1
, k) is a nk matrix dened as K = [q
1
(Aq
1
). . . (A
k1
q
1
)]
(its columns are the basis vectors of the Krylov subspace). 42
Krylov subspace
Given an n n matrix A, a vector q of length n, and a natural number k, the
Krylov subspace K (A,q, k) is spanq
1
, Aq
1
, A
2
q
1
, . . . , A
k1
q
1
. 42
librator
A rotor that cannot rotate in the plane that contains the rotor. 24
Rayleigh quotient
Given an n n matrix A and a vector x, the Rayleigh quotient r(x) for A is
r(x) =
x

Ax
x

x
. 39
rotational constant
Given a quantum rigid rotor of moment of inertia I, the rotational constant B
is dened as B =

2
2I
. 22
118
Index
Krylov
matrix, 42
subspace, 42, 44, 45
Lanczos
band, see Lanczos, block
block, 45, 46, 86
iteration, 42, 4446, 4951, 54, 63, 64
method, 18, 4550, 64, 77, 79, 80, 86
vector, 42, 44, 45, 4850
librator, 25, 76
Rayleigh quotient, 3941
Ritz
value, 45
vector, 45
tridiagonal, 42
tridiagonalization, 42, 49
Trotter approximation, 51, 53, 54, 86
tunnel splitting, 12, 13, 15, 16, 18, 2836
119

Você também pode gostar