george hang- finding the energy spectrum of the quantum hindered rotor by the lanczos method
TRANSCRIPT
Finding the Energy Spectrum of the Quantum HinderedRotor by the Lanczos Method
by
George Hang
Submitted to the Department of Physics and Astronomyin partial fulfillment 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 toreproduce 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
Certified by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Amy L. R. Bug
ProfessorThesis 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 Astronomyon March 19, 2007, in partial fulfillment of the
requirements for the degree ofBachelor 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 algorithmsefficient for finding extremal eigenvalues in a sparse Hermitian matrix, is investi-gated. An implementation of the block Lanczos method with total orthogonalizationin FORTRAN 77 is upgraded and redesigned in modern FORTRAN 95. Benchmarkingagainst analytical solutions and literature values suggest that the code is robust andthe computational results show quantitative tunnel splitting results that match thequalitative predictions from quantum theory.
Thesis Supervisor: Amy L. R. BugTitle: 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 infinite
patience.
To Ishmael “Jennifer” Barry, Nathaniel “Donnie” Erb-Satullo, andMichelle “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 Office 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. (V0 = 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 E1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5-2 Free Rotor Solution E3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5-3 Fractional Error of E0 in Curl Potential . . . . . . . . . . . . . . . . . . 76
7
LIST OF FIGURES Hang 8
5-4 Fractional Error of E8 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 ~q1 =~r1 . . . . . . . . . . . . . . . . . . . . . 49
3.2 Extremal Eigenvalues with ~q1 =~r3 . . . . . . . . . . . . . . . . . . . . . 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 TIPT for λ = 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 hydrogenmolecule,
being both small and volatile, requires efficient and inexpensive means of storage Ef-
ficient is quantified 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
processes2 or physical adsorption onto metal-organic surfaces and frameworks3–6
and within porous materials.7–10
In this thesis, I have redesigned a computational tool that can find 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 different points on a surface, one can predict the structure of
locations where hydrogen is most likely to be adsorbed by finding the most energet-
ically favorable sites. Thus, allowing researchers to direct their efforts 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
specific 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 specific 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 finding
vibrational energy states (phonons) of materials. However, it is also very capable of
finding 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 different 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 different parity, as addressed in
Section 2.4.
The differential cross section of a particle is proportional to the rate of transition
into a particular final state.12;13 Therefore, by using Fermi’s golden rule,
dσ
dΩ∝ |〈 f |M|i〉|2 , (1.1)
where | f 〉 denotes the final state, |i〉 denotes the initial state, and M is the interaction
Hamiltonian.12;13 Eq. 1.1 shows that the differential 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 different 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 different 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 supercageadsorbed on CoNa–A zeolite at 12K. Positive energy denotes neutron energy loss. FromNicol, 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 first 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 10–40 meV range of 0.5 molecule of hydrogen per su-percage adsorbed on CoNa–A 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 V2 (1− cos2θ)
investigated prior by Curl, et. al.15. The energy levels and potential barrier are given in unitsof 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
Kubas16. 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
first two terms in a Fourier series as
V (φ) =12V2(1−cos2φ)+
12V4(1−cos4φ) (1.2)
where theV2 appears to be the dominant characteristic andV4 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 minimalpotential in φ of the formV =V0 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 affect the dynamics of the dihydrogen ligand as shown
in Fig. 1-5 where the tunnel splitting energy is affected significantly by the change of
a pair of ligands.
A further 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−H2)PP3]+ (top) and RuH2(η
2−H2)2(PCy3)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 H2 per formulaunit. 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 efficient 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 Schrodinger equation for a rotor is given by12
H |ψ〉= E |ψ〉 , (2.1)
where H = L22I , 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, finite rotations do
not necessarily commute. The commutation relation between the angular momentum
operator in different components is expressed as
[J j , Jk
]= i~ε jkl Jl . (2.2)
The total angular momentum, however, commutes with the each component, which
yields the commutation relation
[J2, Ji
]= 0 (2.3)
for all i ∈ 1,2,3. By convention, J1 is denoted by Jx , J2 by Jy , and J3 by Jz. By the
commutation relations above and the Hermitian property, J2 and Ji for any i share
19
2.1. EIGENSPECTRUMOF A FREE ROTOR Hang 20
a complete set of eigenvectors. To find the eigenvalues of these operators, let the
complete set of eigenvectors be labelled |a,b〉 such that
J2|a,b〉= ~2a|a,b〉 (2.4)
Jz|a,b〉= ~b|a,b〉 . (2.5)
Noting that
J2 = J2x + J2y + J2z (2.6)
then consider two operators J+ and J−, raising and lowering operators, defined as
J± = Jx± iJy . (2.7)
Using these known properties, further commutation relations involving the raising
and lowering operators can be derived. It can be shown that12;17
[J2, J±
]= 0 (2.8)[
J+, J−]
= 2~Jz (2.9)[Jz, J±
]=±~J± . (2.10)
To demonstrate that J± are indeed raising and lowering operators, consider JzJ±acting on |a,b〉. Using commutation relations, then
Jz(J±|a,b〉) = (J±Jz±~J±)|a,b〉 (2.11)
= ~(b±1)(J±|a,b〉) . (2.12)
Observe that J±|a,b〉 is an eigenstate of Jz with eigenvalue ~(b±1), implying that J±raises and lowers the quantum number b. Note also that J± commutes with J2, which
2.1. EIGENSPECTRUMOF A FREE ROTOR Hang 21
yields
J2J±|a,b〉= J±J2|a,b〉 (2.13)
= ~2aJ±|a,b〉 , (2.14)
which implies that the raising and lowering operators do not effect the a quantum
number. Thus, the raising and lowering operators affect only the quantum number b.
It can be demonstrated that there must exist bmin and bmax such that a raising op-
erator operating on |a,bmax〉 will yield 0 and similarly a lowering operator operating
on |a,bmin〉 will yield 0. This is shown by the fact that J2− J2z ≥ 0. Therefore,
〈a,b|J2− J2z |a,b〉= ~2(a−b2) (2.15)
≥ 0 , (2.16)
which implies that a ≥ b2, or that b is bounded by a such that a maximum and mini-
mum value exists. Observe that
J+J− = J2− J2z +~Jz (2.17)
J−J+ = J2− J2z −~Jz (2.18)
by using the definition of the raising and lower operators. Assuming that J+|a,bmax〉=
0, then J−J+|a,bmax〉= 0. Therefore, by Eq. 2.17,
(J2− J2z +~Jz
)|a,bmax〉= ~(a−b2max−bmax)|a,bmax〉 (2.19)
which implies that a = bmax(bmax + 1). Similarly, the assumption J−|a,bmin〉 = 0 and
Eq. 2.18 together yield the result that a = bmin(bmin− 1). By comparison, it can be
shown that bmax = −bmin. By convention bmax 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 Jz ~b,
they are denoted ~m. Rewriting existing relations using j and m instead of a and b,
2.1. EIGENSPECTRUMOF A FREE ROTOR Hang 22
then
J2| j ,m〉= ~2 j( j +1)| j ,m〉 (2.20)
Jz| j ,m〉= ~m| j ,m〉 . (2.21)
The eigenstates of J2 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 Schrodinger equation for a free rotor, as claimed before,
has the form
12I
L2ψ(θ ,φ) = 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 = ~22I l (l + 1) as
illustrated above, and has degeneracy of 2l +1. The constant ~22I is commonly denoted
B, known as the rotational constant.
In the position representation of the spherical coordinate basis, Eq. 2.22 becomes12;17
−~2
2I
[1
sinθ
∂
∂θ+
1sinθ
∂ 2
∂φ2
]ψ(θ ,φ) = Eψ(θ ,φ) . (2.23)
The solutions to Eq. 2.23 can be obtained analytically, and are known as the spherical
harmonics given below12;17
Ylm(θ ,φ) = (−1)m√(
2l +14π
)(l −m)!(l +m)!
Pml (cosθ)eimφ (m ≥ 0) (2.24)
Ylm = (−1)m[Yl ,−m
]∗ (m < 0) (2.25)
where Pml 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. EIGENSPECTRUMOF 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 flat 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 differentiates 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 different localization
properties. This thesis examines three potentials in detail: first, 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 first kind of potential has been investigated by Curl, et. al.,15 where a poten-
tial of the form
V =V02
(1−cos2θ) , (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. (V0 = 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.00000.50001.00001.50002.00002.50003.00003.50004.00004.50005.0000
potential (B)
Figure 2-1: Potential investigated by Curl, et. al. as shown in Eq. 2.26 withV0 = 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 andMarion.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 =V0 cos2
θ (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
specific clarification 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.00001.00002.00003.00004.00005.00006.00007.00008.00009.0000
10.0000
potential (B)
Figure 2-3: Potential investigated by MacRury and Sams in Eq. 2.27 withV0 = λ is in unitsof 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 =V0 cos2
θ +V1(1−cos2 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 byMacRury and Sams in Eq. 2.28 whereV0 = λ andV1 = µ
are both in units of rotational constant B.
effect on the energy difference 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 differ in terms of sign across the barrier. This phenomenon is called tunnel
splitting.
To illustrate the phenomenon of tunnel splitting, consider an infinite square well
with a Dirac-delta barrier in the middle20, as given by the potential
V (x) =
∞ x ≤−a ,
V0δ (x) −a < x < a ,
∞ a ≤ x ,
(2.29)
whereV0 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 Schrodinger equation is given in the form
ψI(x) = Acos(kx)+B sin(kx) (2.30)
ψII(x) =C cos(kx)+D sin(kx) , (2.31)
where k2 = 2mE~2 .
The boundary conditions are given by
ψI(0) = ψII(0) (2.32)
∂ψII∂x
∣∣∣x=0
−∂ψI∂x
∣∣∣x=0
=2mV0
~2ψI(0) =
2mV0~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)
(D−B)k =2mV0
~2A (2.37)
Acos(ka)−B sin(ka) = 0 (2.38)
C cos(ka)+D sin(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) 6= 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
En =~2
2m(nπ)2
a2, (2.41)
where n = 1,2,3, . . ..
In the other case thatD+B = 0, thenD =−B. Using Eq. 2.38, thenA=B tan(ka).
Substituting for A in Eq. 2.37 yields that
−k =mV0~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. Define z= ka, then
substitution results in
−~2
amV0z = tanz . (2.43)
2.3. TUNNEL SPLITTING Hang 30
For simplicity, define V0 = 2mV0~2 and E = 2mE
~2 . Thus, Eq. 2.43 becomes
−2aV0
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.9956z
Solution to Potential Well with Dirac-Delta Barrier
tan z– z/100
– z/10– z/2
– z
Figure 2-5: Graphs of tanz and −2aV0
z, the two sides of Eq. 2.44, are plotted for various values
of −2aV0
.
From the graphical solutions in Fig. 2-5, it is clear that as aV0 approaches infinity,
the spectrum of z approaches π,2π,3π, . . .. Observe that the odd solutions (the sine
functions) in units of ~22m have an energy spectrum of (nπ)2
a2 as given in Eq. 2.41, while
the even solutions (cosine functions with a symmetric dip at x = 0) in units of ~22m are
given by E = k2 = ζ 2na2 , 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 infinite strength, all the energy states are degenerate. When the
delta barrier strength is great but not infinite, 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 different 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 different 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 briefly to the Schrodinger 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 effect the nuclear and electronic states, then
the total Hamiltonian can be written as21
Htotal = Htrans + Hrot + Hvib + Hnucl + Helec , (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 different 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 12 particles. The possible total nuclear
2.4. ROTATIONAL TUNNEL SPLITTING Hang 33
spin states for molecular hydrogen, then, are given by quantum mechanics12;17
|s = 0,ms = 0〉=1√2(|+〉1|−〉2−|−〉1|+〉2) (2.47)
|s = 1,ms = 0〉=1√2(|+〉1|−〉2 + |−〉1|+〉2) (2.48)
|s = 1,ms = 1〉= |+〉1|+〉2 (2.49)
|s = 1,ms =−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 different
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 difference 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 different |m|, which is sensible
because the potential does not vary in φ . A specific 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
Ene
rgy
(B)
V0 (B)
Energy Spectrum in Potential Used by Curl, et. al.
l = 0, m = 0l = 1, m = 0
l = 1, m = ±1l = 2, m = ±1
l = 2, m = 0l = 2, m = ±2
l = 3, m = 0
Figure 2-6: Energy levels of the potential used by Curl, et. al. in units of rotational constantB. Graph plotted from data published by Curl, et. al.15
π , the ground state becomes significantly distorted such that it now peaks 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 difference 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 difference in energy is small—the 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 = λ cos2θ +µ
2(1−cos2θ) , (2.51)
where λ and µ are potential energy in units of rotational constant B. As noted in pre-
vious sections, theMacRury and Sams potential with only the out-of-plane hindrance
does not have tunnel splitting. Fig. 2-7 shows the energy levels first 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 to8. 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 else—these 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 difference being that one actually crosses 0, the difference between them in 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 finds the extremal eigenvalue and the corre-
sponding eigenvectors efficiently 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
A~x = λ~x (3.1)
whereA∈Cn×n, λ ∈C, and ~x ∈Cn. This process of solving the eigenvalue problem is
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 first few excited states, are of interest. If one can find the
extremal eigenvalues simply by solving a smaller matrix Tk ∈Ck×k, where k < n, then
one can avoid wasting resources finding eigenvalues and eigenvectors that are not of
interest.
The preliminary task, then, is to demonstrate that a choice for Tk exists. Let
~v1,~v2, . . . ,~vk ∈ Cn be eigenvectors of A with corresponding eigenvalues λ1,λ2, . . . ,λk,
37
3.1. MOTIVATION Hang 38
and define
Qk =[~v1~v2 . . .~vk
], (3.2)
or that the columns of Qk are eigenvectors. Then one can define
Tk = Q†kAQk . (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 ofQk are not eigenvectors, but instead of a set
of k orthonormal vectors that together can form all the ~v1,~v2, . . . ,~vk through a linear
combination of each other, then Tk will not be diagonal. However, when diagonalized,
Tk will still have the set of eigenvalues λ1,λ2, . . . ,λk.24 Further, an eigenvector of
Tm, say~zi with eigenvalue λi , can give ~vi by24;26
~vi = Qk~zi . (3.4)
Therefore, if one can find a set of k orthonormal vectors that can, through linear
combinations, form the eigenvectors that one wants to solve for, then one can find
a desired Tk from A by performing matrix multiplication and then diagonalizing the
smaller Tk. This is the heart of the Lanczos method—to construct Qk.
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 find Qk efficiently.
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†A~x = λ~x†~x (3.5)
instead; or in a more common form,
λ = r(~x) =~x†A~x~x†~x
, (3.6)
where r(~x) is known as the Rayleigh quotient.24 Note that the Rayleigh quotient is
equal to an eigenvalue ofAwhen ~x is an eigenvector ofA. If ~x is an eigenvector ofA
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 Specifically, this property can be given as λmin≤ r(~x)≤ λmax for all
~x 6=~0. This inequality can be proved by consideringA=QΛQ†, where Λ is a diagonal
matrix of n real eigenvalues of A (assuming A is Hermitian), A ∈ Cn×n is Hermitian,
and Q ∈ Cn×n is a unitary matrix. Then,
~x†Ax = ~x†QΛQ†~x . (3.7)
Defining ~y = Q†~x, then
~x†QΛQ†~x =~y†Λ~y . (3.8)
3.2. RAYLEIGH QUOTIENT Hang 40
Observe that
~y†Λ~y = ∑i
λi |yi |2 and (3.9)
∑i
λi |yi |2 ≤ λmax∑
i|yi |
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†A~x, as shown above. Therefore, rearranging the terms and noting that ~x†~x > 0,
then
~x†A~x~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 system and 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
Qk such that T = Q†kAQk will have the the desired eigenvalues. To begin the pro-
cess of constructing Qk, one first chooses an initial vector ~q1 ∈ Cn. If ~q1 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 ~q1 contains some component of the maximum or minimum eigenvector. In
either case, the goal, as stated in previous section, is to find ~q1,~q2, . . . ,~qk such that a
linear combination of it will be the maximum or minimum eigenvector, or at least a
vector sufficiently close such that its Rayleigh quotient is approximately the desired
eigenvalue.
If one simply wants to find the maximum or minimum eigenvalue, then the gra-
dient of the Rayleigh quotient is extremely useful. Let the vectors ~q1,~q2, . . . ,~qh span
the space Sh and let them be the columns of Qh that transforms A to Th. Let ~vh be
the eigenvector of Th with maximum eigenvalue. If a new vector ~qh+1 is added such
that Sh+1 contains the gradient of r(Qh~vh), then the maximum eigenvector Th+1
will be greater than the maximum eigenvector of Th.24 Further, because the Rayleigh
quotient is bounded from the top by λmax, one can successively add the gradient of
r(Qi~vi), where ~vi is the eigenvector of Ti with maximum eigenvalue, to the space
spanned by ~q1,~q2, . . . ,~qi and obtain successively better approximations of λmax. This
method can similarly be applied to find λmin.24
The new task, then, is to find an algorithm that can provide an efficient way of
finding the gradient of the maximum or minimum eigenvector of Th such that one can
construct Qh+1 given Qh. Here the Rayleigh quotient is the key to actualizing the
general procedure above. Note that the gradient of the Rayleigh quotient r(~x) is24
∇r(~x) =2
~x†~x(A~x− r(~x)~x) , (3.13)
or that the gradient of any vector ~x is contained in the space spanned by ~x and
A~x. This is an extremely powerful result since one can simply define ~qi = Ai−1~qi for
3.3. LANCZOS ITERATION Hang 42
i ∈ 1,2, . . ., and Sh+1 will contain the gradient of every vector in Sh because every
vector in Sh can be written as a linear combination of ~q1,~q2, . . . ,~qh.
The space spanned by ~q1,A~q1, . . . ,Ah−1~q1 is known as a Krylov subspace24 and
it is denoted as K (A,~q1,h). The corresponding matrix
K(A,~q1,h) =[~q1 (A~q1) · · · (Ah−1~q1)
], (3.14)
where the columns of the matrix K are ~q1,A~q1, . . . ,Ah−1~q1, is known as a Krylov
matrix.24
A further property of Krylov matrices provides additional computational bene-
fits. It can be shown that K†AK = T yields a tridiagonal real symmetric matrix
T ,24;26 where tridiagonal means that the matrix element ti j of T is zero unless i = j
or i = j ± 1.24 Therefore, the problem of finding 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 efficiently.24 Let the diagonal elements of T be α1,α2, . . . ,αk
and the subdiagonal elements of T be β1,β2, . . . ,βk−1, then there is a recusion relation
A~qi = βi−1~qi−1 +αi~qi +βi~qi+1 , (3.15)
where β0~q0 is conveniently defined as 0. (Note that αi = ~q†iA~qi by orthonormality
of the vectors ~q jkj=1.) This recursion formula, which is efficient because the most
complex operation is operating a matrix on a vector only once at each iteration, is the
basic Lanczos iteration,24;26–29 and the ~qi that form the columns of the Krylov matrix
are known as Lanczos vectors.
In short, given a matrix A, one “guesses” an initial ~q1 vector and uses the Lanczos
iteration to generate the Krylov matrices that can transform A to a k×k matrix Tk.
Once a suitable termination criterion is met, the Lanczos iteration stops, and one
takes the final Tk, diagonalize it to find 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
find an approximation of the desired eigenvectors.
3.4. TERMINATION, ERROR, AND LIMITATIONS Hang 44
3.4 Termination, Error, and Limitations
The role of the first Lanczos vector ~q1 is clearly important; however, choosing the
first Lanczos vector is not a very well-defined process. This ambiguity causes con-
cern because the first Lanczos vector determines the Krylov subspace possible. It
is entirely possible for ~q1 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 first Lanczos vector ~q1 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 first Lanczos vector is chosen to avoid any known symmetries to ensure that the
first Lanczos vector is not “trapped” in any invariant subspace.
As mentioned in previous sections, the utility of the Lanczos method is its effi-
ciency. The convergence rate of the eigenvalue and eigenvectors is given by a theorem
of Kaniel and Paige.24;29–32 A full 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 ~z1, . . . ,~zn,
and θ1 ≥ ·· · ≥ θk are eigenvalues of Tk, which is obtained after k steps of the Lanczos
iteration, then
λ1 ≥ θ1 ≥ λ1−(λ1−λn) tan2(φ1)(ck−1(1+2ρ1)
)2 (3.16)
where cos(φ1) = |~q†1~z1|, ρ1 = λ1−λ2
λ2−λn, and ck−1 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 ~qi ) form a set of orthonormal vectors. Further, orthonormality of the Lanczos
3.4. TERMINATION, ERROR, AND LIMITATIONS Hang 45
vectors is necessary for Tk to be tridiagonal and for the simple Lanczos iteration to
be valid. However, in numeric calculations where roundoff 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 Tk converge to the eigenvalues of A, the Lanczos vectors generated
afterwards will contain greater and greater components of the Ritz vector yi , de-
fined as Qk operated on the eigenvector of Tk 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 significant 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 finding 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 find multiplicities of eigenvalues with
degeneracy less than the size of the block.24;33
The block Lanczos method relies on the fact that
Q†AQ = T =
M1 B†1
· · · 0
B1 M2. . . ...
. . . . . . . . .... . . . . . . B†
r−1
0 · · · Br−1 Mr
, (3.17)
where n = r p, Q = [X1,X2, . . . ,Xr ], X ∈ Cn×p, M ∈ Cp×p is Hermitian, and Bi ∈
Cp×p 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 find a
Tk and diagonalize it to obtain the desired eigenvectors and eigenvalues.24;33 Observe
that, like Tk in vector Lanczos, Tk in block Lanczos is “tridiagonal” in that it has
only the diagonal and subdiagonal blocks are nonzero. Notice that because the Bi 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 Mi and Bi directly, then one obtains
AXk = Xk−1B†k−1
+XkMk +Xk+1Bk (3.18)
where B0 is defined 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 †iX j = δi j Ip, where
δi j is the Kronecker-delta and Ip is the p× p identity matrix.24 This implies that
Mk = X †kAXk and (3.19)
B†k−1
= X †k−1
AXk . (3.20)
Using these two relations, one can see that one can save computational resources by
storing the result ofA operated onXk. And if p is small, thenA operating onXk will
be the only resource consuming step in each iteration. This issue of applyingA onXk
(or qi 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 =
212 0 0 0 0 0 0 0 0 0 0 25
2
0 416 2
√23
13√2
0 0 0 0 13√2
√23
416 0
0 2√
23 7 2√
30 0 0 0 1√
37
√23 0
0 13√2
2√3
203 0 0 0 0 20
31√3
13√2
0
0 0 0 0 174
74
34
14 0 0 0 0
0 0 0 0 74
174
14
34 0 0 0 0
0 0 0 0 34
14
174
74 0 0 0 0
0 0 0 0 14
34
74
174 0 0 0 0
0 13√2
1√3
203 0 0 0 0 20
32√3
13√2
0
0√
23 7 1√
30 0 0 0 2√
37 2
√23 0
0 416
√23
13√2
0 0 0 0 13√2
2√
23
416 0
252 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−1DS = A where
S =
1√2
0 0 0 0 0 0 0 0 0 0 1√2
0 1√6
12
12√3
0 0 0 0 12√3
12
1√6
0
0 1√6
0 − 1√3
0 0 0 0 − 1√3
0 1√6
0
0 1√6
−12
12√3
0 0 0 0 12√3
−12
1√6
0
0 0 0 0 12
12
12
12 0 0 0 0
0 0 0 0 12
12 −1
2 −12 0 0 0 0
0 0 0 0 12 −1
212 −1
2 0 0 0 0
0 0 0 0 12 −1
2 −12
12 0 0 0 0
0 1√6
12
12√3
0 0 0 0 − 12√3
−12 − 1√
60
0 1√6
0 − 1√3
0 0 0 0 1√3
0 − 1√6
0
0 1√6
−12
12√3
0 0 0 0 − 12√3
12 − 1√
60
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
~q1. For illustrative purposes, in this first case, let the first 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 ~r1 to differentiate from the different initial vectors that
will be presented later.
Using the Lanczos method, as described in Eq. 3.15 in Section 3.3, then, we can
find the greatest and least eigenvalues of Tk. Table 3.1 shows the compiled results
using Mathematica.
Table 3.1: Extremal Eigenvalues with ~q1 =~r1: When k = n = 12, the exact eigenvalues, asshown in matrix D in Eq. 3.22, are obtained.
Tk Greatest Eigenvalue Least EigenvalueT2 17.67625436239247 2.055520812733449T3 21.13182928380504 −0.2954546832621684T4 22.53774004641360 −1.149168570768845T5 22.9705605600049 −1.679982898468334T6 22.9991280414001 −1.890379919379511T12 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,~r1,12).
At this point one may speculate that such a successful outcome is not incidental
and that the starting vector ~r1 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 Qk 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-
firms our theory that if the starting vector is contained in a proper invariant subspace
in the range of the matrixA, 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 ~q1 =~r3: The Lanczos iteration terminates at β5 = 0
Tk Greatest Eigenvalue Least EigenvalueT2 19.86399567202422 8.16035331705360T3 22.91324257513417 7.040986075192646T4 22.99930605631535 7.001514560555633T5 23.00000000000000 7.000000000000000
In the example with the ~r2 vector, ~r2 is contained in the subspace spanned by the
first and last column of the matrix S. In the previous example with ~r3, the vector is
a superposition of the first, second, and fifth 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 q1, 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 ~qi or Xk. In finding 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 finding a basis for the Hamiltonian
arises—in position space T contains differential operators, and in momentum space
V contains differential operators; naıvely choosing to work in either position or mo-
mentum basis will force one to apply differential operators and reduce the efficiency
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 different 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-Hausdroff iden-
tity can be invoked to presentW (τ) in a formmore suitable for computer simulations.
The Baker-Campbell-Hausdorff identity,35–38
log(eAeB
)= A+ B+
12
[A, B
]+
112
[A,[A, B
]]+
112
[[A, B
], B]· · · , (3.28)
is usually applied up to the first commutator term. In the present case withW (τ), the
operator is of the form eη(A+B). Expanding the Baker-Campbell-Hausdorff identity
to the first commutator term, then the error is on the order of η3 as shown below
eηAeηB = eηA+ηB+η2 12 [A,B] +O
(η3) . (3.29)
To use the result of Eq. 3.29, consider the first two terms in the expansion of eη(A+B)eη2 12 [A,B]
3.6. TROTTER APPROXIMATIONS Hang 52
using the Baker-Campbell-Hausdorff identity:
eη(A+B)eη2 12 [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 12 [A,B] yields
eηAeηBe−η2 12 [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η12 Aeη
12 A exactly because A com-
mutes with itself. By repeated applications of the Baker-Campbell-Haudorff identity,
observe that
eη12 AeηB = eη
12 A+ηB+η2 1
4 [A,B] +O(η3) (3.32)
eηBeη12 A = eηB+η
12 A+η2 1
4 [B,A] +O(η3) (3.33)
and following an approach similar to the derivation of Eq. 3.30,
eη12 AeηBe−η2 1
4 [A,B] = eη12 A+ηB +O
(η3) (3.34)
eηBeη12 Ae−η2 1
4 [B,A] = eηB+η12 A +O
(η3) . (3.35)
Equating Eq. 3.34 and Eq. 3.35 and operating from the right with eη2 14 [A,B] = e−η2 1
4 [B,A]
gives
eη12 AeηB = eηBeη
12 Aeη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ηAeηBe−η2 12 [A,B] +O
(η3) (3.37)
= eη12 Aeη
12 AeηBe−η2 1
2 [A,B] +O(η3) (3.38)
= eη12 AeηBeη
12 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.39–42
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−τ
2V e−τT e−τ
2V +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−τ
2V e−τT e−τ
2V |θ ′,φ ′〉 (3.43)
= ∑θ ′′,φ ′′
∑θ ′′′,φ ′′′
〈θ ,φ |e−τ
2V |θ ′′,φ ′′〉〈θ ′′,φ ′′|e−τT |θ ′′′,φ ′′′〉〈θ ′′′,φ ′′′|e−τ
2V |θ ′,φ ′〉
(3.44)
= ∑l ,m′
∑l ′,m′
∑θ ′′,φ ′′
∑θ ′′′,φ ′′′
(〈θ ,φ |e−
τ
2V |θ ′′,φ ′′〉〈θ ′′,φ ′′|l ,m〉〈l ,m|e−τT |l ′,m′〉
×〈l ′,m′|θ ′′′,φ ′′′〉〈θ ′′′,φ ′′′|e−τ
2V |θ ′,φ ′〉), (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 space—no differential 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 efficiently.22
In short, by using the Trotter approximation and by using Fourier and associated
Legendre transforms, the operation of applying the matrixA to ~qi (orXk in the block
method) in the Lanczos iteration can be performed efficiently 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 specific 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 difficult to understand which variables stored in
the shared data were actually used in a subroutine. Global constants were redefined
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 specifications in FORTRAN 95 is a clear
improvement.43
Another issue that had to be confronted was precision and datatype definitions.
Different computer platforms and different 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 different computer platforms, or even identical computer platforms, without
wasting significant time and effort 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-
gram flow controls such as the dreaded go to. Such archaic flow control protocols led
to infinite loops that are difficult to debug. For example, the GASLEG subroutine had
to be debugged as it brought the code into infinite 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 find relevant def-
initions or even into other subroutines to find the initialization of a variable. There-
fore, local modifications are difficult because changes throughout the code are often
needed to maintain consistency. One example is the size of the potential grid, which
is defined 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.43–45 In the example above, storing the size of the potential grid
in a module and having different 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
different 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 fixed 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 scientific 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 as12
g(k) = A∫
∞
−∞
f (x)eαikxdx , (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 significant 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 xi , 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 n∆k for k in Eq. 4.1
and changing the integral to a sum, which yields the general formula
gn = BN
∑j=1
f ( j∆x)eβ i 2πn jN , (4.2)
where ∆k = 2π
X , and X = N∆x is the domain of input values to be transformed. Note
again that the specific implementation may vary as B can be either 1 or 1N and β can
take on a value of either positive or negative one.
In addition, note that mathematically
ei2π
N (N2 +m) j = ei2π
N (N−N2 +m) j (4.3)
= ei2π jei2π
N (−N2 +m) j (4.4)
= ei2π
N (−N2 +m) j . (4.5)
aThe actual algorithm implemented is a “fast Fourier transform.” For the purposes of scientific com-
puting, however, such subroutines are treated as a “black box” that performs the discrete Fourier
transform efficiently.
4.2. FORTRAN 77 CODE Hang 59
Thus, the entires kn whereN > n > N2 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 −K2 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 different
views are commonly implemented as, A:
[0,∆k,2∆k, . . . ,
K2
,−K2
, . . . ,−2∆k,∆k], (4.6)
and B:
[0,∆k,2∆k, . . . ,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 first 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 =1N 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
Dis
trib
utio
n
xi
Fourier Transform Test: Input
InputStandard Normal Distribution μ=0 σ=1
Figure 4-1: Input for testing of the library routine FFTPACK5. The data used has parametersX = 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
Dis
trib
utio
n
kj
Fourier Transform Test: Forward Transform
Forward TransformNormal Dist. μ=0 σ=1 with factor 1/(NΔx)=1/20
Figure 4-2: Fourier transform using FFTPACK5 data in Fig. 4-1. HereN = 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
Dis
trib
utio
n
kj
Fourier Transform Test: Forward Transform
Forward TransformNormal Dist. μ=0 σ=1 with factor 1/(NΔx)=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
Dis
trib
utio
n
xi
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 inFig. 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 Cronin46 and Zachery Wolfson47
Swarthmore College ’06 was used because of its immediate availability. Later, a
twisted generalized feedback shift register pseudo-random number generatorMersenne
Twister was implemented. The Mersenne Twister has a long period of 219937− 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 verified to function identically to the C program written by the original au-
thors and preliminary testings show little difference in speed, viz. different 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 identified, 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 scientific 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 program accomplishes one small task.
It is advantageous to break the code into smaller blocks with clear functions,43–45 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 scientific 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 conflicting 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 efficiently 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 different 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−τ
2V e−τT e−τ
2V . (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 find
the weights for Gaussian-Legendre quadratures; hence, they are not found in the
basic program tree above. The module fft mod simplifies 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 finds 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 specific 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 flexibility is the feature of
derived types.43–45 One can define derived types to create new data structures con-
veniently. In this investigation, one physical object that can naturally be defined as
a derived type is the hydrogen molecule. Prior to the definition of the derived type,
there existed variables mass, rrange, and gmax, where the first 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), paramete r :: mass =1836.0 _dpkind , rrange =1.449 _dpkind
r e a l (dpkind), paramete r :: 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 v ed t yp e mo l e cu l e
type , 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 n g t h
end type 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 fields are “private” to achieve data encapsulation. To access the fields
mass and blength, public functions getmass and getblength were declared in the
datatype mod module.
52 ! 2006 g e t s reduced mass of mo l e cu l e
f u n c t i o n getmass(molecules)
r e a l (dpkind) :: getmass
55 type (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 n g t h of mo l e cu l 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
type (molecule), i n t e n t ( i n ) :: molecules
getblength = molecules%blength
end f u n c t i o n 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 d e f i n e hydrogen
type (molecule), paramete r :: 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 definition of such a subtype can allow for definition 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.43–45 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 defined 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 defines this
operator is as follows.
1 module overlap
use datatype_mod
4.3. FORTRAN 95 CODE Hang 69
i n t e r f a c e set_wtot
5 module procedure set_rwtot
module 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 o r (. overlap .)
10 module procedure real_overlap
module procedure complex_overlap
end i n t e r f a c e
complex(dpkind), d imens ion (:,:), 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 u b r o u t i n e set_rwtot(rwin)
r e a l (dpkind) , d imens ion (:,:) , 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 u b r o u t i n e set_rwtot
s u b r o u t i n e set_cwtot(cwin)
25 complex(dpkind) , d imens ion (:,:) , 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 u b r o u t i n e set_cwtot
30
f u n c t i o n real_overlap(rpsi1 ,rpsi2)
r e a l (dpkind) , d imens ion (:,:) , i n t e n t ( i n ) :: rpsi1
r e a l (dpkind) , d imens ion ( 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)) then
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 complex(dpkind) , d imens ion (:,:) , i n t e n t ( i n ) :: cpsi1
complex(dpkind) , d imens ion ( s i z e (cpsi1 ,1), s i z e (cpsi1 ,2)) , &
i n t e n t ( i n ) :: cpsi2
complex(dpkind) :: complex_overlap
4.3. FORTRAN 95 CODE Hang 70
50 i f (allocated(wtot)) then
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 o n complex_overlap
end module 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 defined such that one can simply use the operator .overlap. to perform the same
calculation on different datatypes.
To see the significant 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 ona l i z e to a l l l ower 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 ipwere 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 different 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 module fft_mod
use datatype_mod
! 2006 i f i n i t i a l i z e d work array s then i t i s true ,
5 ! by d e f au l 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), d imens ion (:), 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 u b r o u t i n e cfft(transform , isign)
i m p l i c i t none
complex(dpkind), d imens ion (:), i n t e n t ( i n o u t ) :: 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
! d e a l l o c a t e i f a l r eady a l l o c a t e d
i f ((. not. workinit) .and. (isign .eq. 0)) then
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)) then
wr i t e (*,*) "Error , initialize work arrays first."
s top
30 e n d i f
i f (isign .lt. 0) then
c a l l cfft1b(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s e i f (isign .gt. 0) then
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) then
wr i t e (*,*) "Error in cfft"
s top
e n d i f
end s u b r o u t i n e cfft
45 end module fft_mod
While it does not have an actual interface, the module fft mod is implemented with
the concepts from the previous sections, data encapsulation and function overloading,
in mind to simplify the calling interface. This simplification 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 different results. Previous uses of the code
have shown that dt0 = 1000 and cut =√5 give further reliable results. Further, those
two parameters do not significantly alter the run time of the program while ncut and
nblock do. Therefore, here the focus was on finding 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 E1 and E3. Note that
according to theory, E1 and E3 are both J = 1 states and ought to have the same
energy. Here the code is tested for its ability to find the energies and degeneracies
accurately.
Examination of Fig. 5-1 and Fig. 5-2, E1 and E3 respectively, shows that the accu-
racy of the code is remarkable. The results fit the theoretical predictions up to seven
significant figures. 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
E1 and E3. 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
E1
nblock
J=1 State with Least Energy by Lanczos Methods (E1)
ncut=4ncut=5ncut=6ncut=7ncut=8ncut=9
ncut=10Theoretical Results
Figure 5-1: Comparison of E1 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
E3
nblock
J=1 State with Greatest Energy by Lanczos Methods (E3)
ncut=4ncut=5ncut=6ncut=7ncut=8ncut=9
ncut=10Theoretical Results
Figure 5-2: Comparison of E3 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 =V02
(1−cos2θ) , (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 difference 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 E0 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 E0 in a potential investigated by Curl, et. al. V = V02 (1−
cos2 θ) whereV0 = 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 difference is indeed greater. While in Fig. 5-3 the difference is almost
negligible, the disagreement for E8 is about five 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 E8 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+0002.00e-0054.00e-0056.00e-0058.00e-0051.00e-0041.20e-0041.40e-0041.60e-0041.80e-004
error
Figure 5-4: Fractional Error of E8 in a potential investigated by Curl, et. al. V = V02 (1−
cos2 θ) whereV0 = 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 finite 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 (θ ,φ) = λ cos2(θ) , (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
cos2(θ) =43
√π
5Y2,0(θ ,φ)+
23√
πY0,0(θ ,φ) , (5.2)
which is a relatively simple expression for V in the position basis. Therefore,
〈`′,m′|V |`,m〉= ∑θ ,φ
∑θ ′,φ ′
〈`′,m′|θ ′,φ ′〉〈θ ′,φ ′|V |θ ,φ〉〈θ ,φ |`,m〉 (5.3)
=43
√π
5
√(2`+1)(5)4π(2`′+1)
〈`,2;0,0|`′,0〉〈`,2;m,0|`′,m′〉
+23√
π
√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 coefficients into Wignar 3- j notation, it is clear that
`+ `′ must be even.12;19 Therefore, it must be that |`− `′|= 2 or ` = `′. These results
show thatm and the parity of ` together form useful quantum numbers 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 infinite 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 100×100 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 (θ ,φ) =λ cos2(θ) where λ = 1 is obtained by three methods: direct diagonalization of a 100× 100matrix, second order time-independent perturbation theory, and the computer code basedon the Lanczos method with ncut is 7 and nblock is 3. The energy is in units of rotationalconstant B.
Ei Lanczos Method (code) Direct Diag. 2nd Order TIPTE0 0.3189995 0.3190001 0.3185185E1 2.195489 2.195548 2.195429E2 2.195489 2.195548 2.195429E3 2.593025 2.593085 2.593143E4 6.140771 6.140949 6.140914E5 6.140771 6.140949 6.140914E6 6.424521 6.424699 6.424684E7 6.424521 6.424699 6.424684E8 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
first four or five significant figures, 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 (θ ,φ) =λ cos2(θ) where λ = 5 is obtained by three methods: direct diagonalization of a 100× 100matrix, second order time-independent perturbation theory, and the computer code basedon the Lanczos method with ncut is 7 and nblock is 3. The energy is in units of rotationalconstant B.
Ei Lanczos Method (code) Direct Diag. 2nd Order TIPTE0 1.357345 1.357357 1.296296E1 2.899550 2.899616 2.885714E2 2.899550 2.899616 2.885714E3 4.822738 4.822809 4.828571E4 6.669674 6.669857 6.665695E5 6.669674 6.669857 6.665695E6 8.047620 8.047807 8.045675E7 8.047620 8.047807 8.045675E8 8.810557 8.810735 8.872800
Table 5.3: The energy levels of the hindered rotor Hamiltonian with potential V (θ ,φ) =λ cos2(θ) where λ = 10 is obtained by three methods: direct diagonalization of a 100× 100matrix, second order time-independent perturbation theory, and the computer code basedon the Lanczos method with ncut is 7 and nblock is 3. The energy is in units of rotationalconstant B.
Ei Lanczos Method (code) Direct Diag. 2nd Order TIPTE0 2.305006 2.305040 1.851852E1 3.643815 3.643895 3.542857E2 3.643815 3.643895 3.542857E3 7.264849 7.265043 7.234208E4 7.264849 7.265043 7.234208E5 7.285149 7.285254 7.314286E6 9.915992 9.916207 9.896987E7 9.915992 9.916207 9.896987E8 11.79020 11.79039 12.25310
results of direct diagonalization and the Lanczos code still agree with each other to
the first four significant figures.
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 significant 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 E0 and E1, 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 160.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 E0 and E1 States
E0E1
λμ
Energy (B)
Figure 5-5: The energy eigenvalues of the first 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 first two states. Fig. 5-6
and Fig. 5-7 show the ground state and first excited state, respectively, when λ = 10
and µ = 0.
Here it is clear that the first two states are very different 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 E0 (λ=10, μ=0)
E0 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 E1 (λ=10, μ=0)
E1 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 different picture. As one can see by comparing Fig. 5-8, the
ground state, and Fig. 5-9, the first exicted state, they are very similar except for a
difference 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 first 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 E0 (λ=10, μ=16)
E0 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.10000.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, confirming 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, E2 and
E3 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 E1 (λ=10, μ=16)
E1 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.20000.00000.20000.40000.60000.80001.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 E0 (λ=10, μ=16)
E0 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.00000.10000.20000.30000.40000.50000.60000.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 E1 (λ=10, μ=16)
E1 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.00000.10000.20000.30000.40000.50000.60000.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 160.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 (E1, E2, E3)
E1E2E3
λ
μ
Energy (B)
Figure 5-12: The energy eigenvalues of the first three excited states (J = 1) calculatedat 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 efficiently 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 efficient.
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 Schrodinger 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 Sams19 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 difference 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 flexibility 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 effects and find the energy spectrum of
D2 and even heteronuclear diatomic molecules such as HD. In fact, any rigid rotor
can be used, such as N2, CO or CO2, given that the potential is adjusted appropri-
ately. Investigation of these various potentials and molecules may reveal interesting
physics and new phenomena.
While significant 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 different 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 first finding the associated Legendre polyno-
mials of the form P`` , and then use raising and lowering operators to find the other
associated Legendre polynomials.
The normalized associated Legendre polynomial,
Pmn (x) =
√2n+1
2
√(n−m)!(n+m)!
12nn!
(1−x2)m2dm+n
dxn+m (x2−1)n , (A.1)
can be simplified tremendously in the case that n =m = ` by noting that only the first
term in the derivative remains nonzero. Therefore, the expression simplifies to
P`` (x) =
√2`+12
√1
(2`)!1
2``!(1−x2)
`2 (2`)! . (A.2)
88
Hang 89
Consinder the ratio P`` (x)
P`−1`−1
(x) , then
P`` (x)
P`−1`−1 (x)
=
√2`+12
√1
(2`)!1
2``!(1−x2)
`2 (2`)! (A.3)
(√2(`−1)+1
2
√1
(2(`−1))!1
2(`−1)(`−1)!(1−x2)
(`−1)2 (2(`−1))!
)−1
=
√2`+12`−1
√1
(2`)(2`−1)12`
(1−x2)12 (2`)(2`−1) (A.4)
=
√2`+12`
(1−x2)12 . (A.5)
Therefore, a simple recursive formula for the associated Legendre polynomials can
be used to find polynomials of the form P`` (x) and then use raising and lowering
operators to find the other associated Legendre polynomials.
Appendix B
Code
B.1 Modules and External Routines
B.1.1 datatype mod
1 module datatype_mod
i m p l i c i t nonesave
! 2006 p rov id e s da t a t yp e s and con s t an t s5 ! i n t e g e r da t a t yp e s :
! i 8 k ind ( 8 b i t ) , i 1 6k ind ( 1 6 b i t ) , i 3 2k ind ( 3 2 b i t )!! r e a l da t a t yp e s : ( c u r r e n t l y no quad )! spk ind ( s i n g l e ) , dpkind ( double ) , qpkind ( quad )
10 !! mathemat i ca l c on s t an t s! p i ( rounded to 50 dec . p l a c e s )!! d e r i v ed t yp e mo l e cu l e
15 ! and a s s o c i a t e d a c c e s s i n g f un c t i on s
! 2006 i n t e g e r da t a t yp e si n t e g e r , paramete r :: i8kind = selected_int_kind(r=2)
i n t e g e r , paramete r :: i16kind = selected_int_kind(r=4)
20 i n t e g e r , paramete r :: i32kind = selected_int_kind(r=9)
! 2006 f l o a t / r e a l da t a t yp e si n t e g e r , paramete r :: spkind = selected_real_kind(p=6,r=37)
! 2006 IEEE standard s i n g l e p r e c i s i o n25 i n t e g e r , paramete r :: dpkind = selected_real_kind(p=15,r=307)
! 2006 IEEE standard double p r e c i s i o n
! 2006 No standard for 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 ind quad p r e c i s i o n
! ! ! i n t e g e r , parameter : : q pk ind 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 p i! ROUNDED to f i r s t 50 d i g i t s should be enough for most t h i n g s . . .
90
B.1. MODULES AND EXTERNAL ROUTINES Hang 91
! change dpkind to o t h e r kind i f you ev e r need g r e a t e r p r e c i s i o nr e a l (dpkind), paramete r :: pi &
= 3.14159265358979323846264338327950288419716939937511 _dpkind
40
! 2006 de r i v ed t yp e mo l e cu l etype , p u b l i c :: molecule
p r i v a t er e a l (dpkind) :: mass
45 ! reduced massr e a l (dpkind) :: blength
! bond l e n g t hend type molecule
50 c o n t a i n s
! 2006 g e t s reduced mass of mo l e cu l ef u n c t i o n getmass(molecules)
r e a l (dpkind) :: getmass
55 type (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 n g t h of mo l e cu l e60 f u n c t i o n getblength(molecules)
r e a l (dpkind) :: getblength
type (molecule), i n t e n t ( i n ) :: molecules
getblength = molecules%blength
end f u n c t i o n getblength
65
end module datatype_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 92
B.1.2 input
module input_mod
use datatype_mod
i m p l i c i t nonesave
! 2006 This module s a v e s a l l p h y s i c a l i npu t s fo r t h e sy s t em! of i n t e r e s t and th e computa t iona l! parameter s n e c e s s a r y
! 2006 from atomic un i t s to Ke lv inr e a l (dpkind), paramete r :: convautok = 3.157772 e5_dpkind
! 2006 input s t u f f! IMPORTANT parameter s
! ! ! ! ! ! ! ! ! !! 2006 computa t iona l parameter s
i n t e g e r (i32kind), paramete r :: nrd = 1, nmd=32, nmd1=nmd+1, &
nprod = nrd * nmd1 * nmd
! 2006 s i z e si n t e g e r (i32kind), paramete r :: nstate=9, nblock=3, &
ndiag = nstate*nblock
! 2006 maximum s i z e si n t e g e r (i32kind), paramete r :: nstatem=9, nblockm =15, nblockm1=nblockm +1
i n t e g e r (i32kind), paramete r :: ndiagm=nblockm*nstatem
! 2006 t ime s t e pr e a l (dpkind), paramete r :: dt0 =1000 _dpkind
i n t e g e r (i32kind), paramete r :: ncut = 7_i32kind
r e a l (dpkind) :: dt, rdt , dt2 , cut
! 2006 parameter s fo r i t e r a t i o n s i z e si n t e g e r (i32kind), paramete r :: nr = nrd , nl = nmd , nm = nmd , nn = 2*nr
! 2006 s t u f f fo r gauss− l e g e nd r e quadraturesr 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 computa t iona l parameter s! ! ! ! ! ! ! ! ! ! ! ! !
! ! ! ! ! ! ! ! ! ! ! ! !! 2006 p h y s i c a l parameter s
! 2006 MORE INPUT STUFF! 2006 d e f i n e hydrogentype (molecule), paramete r :: hydrogen = molecule (1836.0 _dpkind , 1.449 _dpkind)
! 2006 p o t e n t i a l g r i d! can upgrade by adding more coord inat e , e . g . c e n t e r of massr 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 parameter s! ! ! ! ! ! ! ! ! ! ! !
! 2006 s t a t e v e c t o rr e a l (dpkind) :: psi(nmd1 ,nmd ,nstatem ,nblockm1), eigfinal(nstatem)
! 2006 s i n t e t c are used for t r i g o n ome t r i c c a l c u l a t i o n s ,! 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 in s e p a r a b l e c o o rd ina t e sr 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 to be used to s e t vps when vang i s de f in eds u b r o u t i n e set_vps ()
! 2006 c u r r e n t l y i npu t s from matrix , t h i s par t can be! r e w r i t t e n to input 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
enddoenddo
r e t u r nend s u b r o u t i n e set_vps
! 2006 to be used to f ind t h e w e i g h t s of Gauss−Legendre quadraturess u b r o u t i n e 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), paramete r :: 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 o r t o l e r a n c e of gau s s l e g e nd r e quadraturer 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)
enddor e t u r nend s u b r o u t i n e set_gaussleg
s u b r o u t i n e set_psi(delt)
! ! ! ! ! 2006 I t g e t s a f i r s t approximation to t h e wave func t i on! ! ! ! ! I t h i nk by w i g g l i n g around th e f r e e ro t o r s o l u t i o n
! ! ! ! ! 2006 s i n t cosp s inp are in common , t h e o t h e r array s l o c a l l y! ! ! ! ! k ind of odd I know . . .
! ! ! ! ! 2006 c o n t r o l s t h e spac e s l i c e / s t e pr e a l (dpkind), i n t e n t ( i n ) :: delt
! ! ! ! ! 2006 i n t e r n a l v a r i a b l e si n t e g e r (i32kind) :: ix , ip , ist , ib
r e a l (dpkind) :: dp, phi , tphi , rphi , anorm_const , aa
! ! ! ! ! 2006 co s ( 2 ph i ) s i n ( 2 ph i ) co s ( 3 ph i ) s i n ( 3 ph i )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)
enddodo ix = 1, nl+1
sint(ix) = sqrt(1 - x(ix)*x(ix))
enddo! ! ! ! ! 2006 s e t up p s i! ! ! ! ! 2006 s e t to 0 f i r s tpsi = 0
! ! ! ! ! 2006 redo loop i n s t e ad of ip ix , do ix ip to i n c r e a s e e f f i c i e n c ydo 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)
enddoenddo
! ! ! ! ! 2006 normal izedo 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)
enddoenddo
anorm_const = anorm_const*delt
aa = 1/sqrt(anorm_const)
psi(:,:,ist ,1) = psi(:,:,ist ,1) * aa
enddor e t u r nend s u b r o u t i n e set_psi
end module input_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 95
B.1.3 fft mod
module fft_mod
use datatype_mod
! 2006 i f i n i t i a l i z e d work array s then i t i s true ,! by d e f au l 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), d imens ion (:), 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 ss u b r o u t i n e cfft(transform , isign)
i m p l i c i t nonecomplex(dpkind), d imens ion (:), i n t e n t ( i n o u t ) :: 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
! d e a l l o c a t e i f a l r eady a l l o c a t e di f ((. not. workinit) .and. (isign .eq. 0)) then
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)) thenwr i t e (*,*) "Error , initialize work arrays first."
s tope n d i f
i f (isign .lt. 0) thenc a l l cfft1b(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s e i f (isign .gt. 0) thenc a l l cfft1f(numm ,1,transform ,numm ,worksav ,savlen ,work ,2*numm ,istatus)
e l s ec a l l cfft1i(numm ,worksav ,savlen ,istatus)
e n d i f
i f (istatus .ne. 0) thenwr i t e (*,*) "Error in cfft"
s tope n d i fend s u b r o u t i n e cfft
end module fft_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 96
B.1.4 overlap mod
module overlap
use datatype_mod
i n t e r f a c e set_wtot
module procedure set_rwtot
module 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 o r (. overlap .)module procedure real_overlap
module procedure complex_overlap
end i n t e r f a c e
complex(dpkind), d imens ion (:,:), 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 ss u b r o u t i n e set_rwtot(rwin)
r e a l (dpkind) , d imens ion (:,:) , 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 u b r o u t i n e set_rwtot
s u b r o u t i n e set_cwtot(cwin)
complex(dpkind) , d imens ion (:,:) , 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 u b r o u t i n e set_cwtot
f u n c t i o n real_overlap(rpsi1 ,rpsi2)
r e a l (dpkind) , d imens ion (:,:) , i n t e n t ( i n ) :: rpsi1
r e a l (dpkind) , d imens ion ( 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)) thenreal_overlap = sum(rpsi1 * rpsi2 * r e a l (wtot ,dpkind ))
e l s ereal_overlap = sum(rpsi1 * rpsi2)
e n d i fend f u n c t i o n real_overlap
f u n c t i o n complex_overlap(cpsi1 ,cpsi2)
complex(dpkind) , d imens ion (:,:) , i n t e n t ( i n ) :: cpsi1
complex(dpkind) , d imens ion ( s i z e (cpsi1 ,1), s i z e (cpsi1 ,2)) , &
i n t e n t ( i n ) :: cpsi2
complex(dpkind) :: complex_overlap
i f (allocated(wtot)) thencomplex_overlap = sum(cpsi1 * conjg(cpsi2) * wtot)
e l s ecomplex_overlap = sum(cpsi1 * conjg(cpsi2 ))
e n d i fend f u n c t i o n complex_overlap
end module overlap
B.1. MODULES AND EXTERNAL ROUTINES Hang 97
B.1.5 prop mod
module prop_mod
use datatype_mod
use input_mod
i m p l i c i t nonesave
! 2006 propaga t i on s t u f f exp (− tau e i g )! 2006 should be in co rpora t ed in t o a module for! a p p l i c a t i o n of propaga torr e a l (dpkind) :: prop(nl+1), propl(nl+1)
end module prop_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 98
B.1.6 trans mod
module trans_mod
use datatype_mod
use input_mod
i m p l i c i t nonesave
! 2006 s t u f f fo r l e g e nd r e t rans format ion! changed names from p and p i to! p l t r a n s to p i l t r a n s! 2006 should be in co rpora t ed to wrapper l i k e in c f f t moduler e a l (dpkind) :: p_ltrans(nmd+nmd1 , nmd+nmd1 , nmd1), &
pi_ltrans(nmd+nmd1 ,nmd+nmd1 ,nmd1)
end module trans_mod
B.1. MODULES AND EXTERNAL ROUTINES Hang 99
B.1.7 gasleg
s u b r o u t i n e gasleg(z,a,nrm ,p,pd ,nrm21 ,crit ,n,pi)
i n t e g e r nrm , nrm21
doub l e p r e c i s i o n crit , pi
doub l e p r e c i s i o n z(nrm), a(nrm)
doub l e p r e c i s i o n p(nrm21), pd(nrm21)
i n t e g e r n
c 2006 o ld s t u f f , e x i s t s b e caus e I j u s t do not want to break t h i n g s aga ini m p l i c i t doub l e p r e c i s i o n (a-h,o-z)
c 2006 g e t w e i g h t s and nodes of gauss− l e g e nd r e quadrature
c 2006 t h i s r ou t i n e s o l v e s fo r t h e r oo t s of t h e l e g e nd r e po lynomia lc and f i nd s t h e w e i g h t s fo r a gau s s i an quadraturec n i s t h e number of po i n t s used in t h e quadraturec z ( ) ’ s are t h e nodes and th e a ( ) ’ s are t h e w e i g h t s
c 2006 i n t e r n a l v a r i a b l e si n t e g e r nn , ifin , iodd , nknt , k, in
doub l 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 to 1
wr i t e (6 ,900) n
900 fo rmat (10x,31h***** gasleg n too large *****,’ n is ’,i8)
go to 9
1 con t i n u enn=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 con t i n u ebes=zbes(k)
x=cos(bes/den)
pdx =1.00d0 /(1.0d0-x*x)
4 con t i n u ep(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 con t i n u ei f (ifin.eq.1) go to 10
i f (abs(p(nn)).lt.crit) go to 3
x=x-(p(nn)/pd(nn))
pdx =1.0d0 /(1.0d0 -x*x)
go to 4
3 con t i n u ez(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 to 5
k=k+1
go to 6
5 con t i n u ei f (iodd.eq.0) go to 9
x=0.0d0
k=nknt+1
z(k)=x
ifin=1
go to 4
10 con t i n u eta=dble(n)*p(n)
ta=ta*ta
a(k)=2.0 d0/ta
cha=cha+a(k)
9 con t i n u er e t u r nend
B.1. MODULES AND EXTERNAL ROUTINES Hang 101
B.1.8 zbes
f u n c t i o n zbes(k)
use datatype_mod
i m p l i c i t none! 2006 This module i s s imp ly cop i ed from th e o ld code to make t h i n g 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 n t e r n a l v a r i a b l e sr 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 u r nend f u n c t i o n zbes
B.2. CENTRAL PROCESS Hang 102
B.2 Central Process
B.2.1 estates
s u b r o u t i n e estates(energy)
use datatype_mod
use input_mod
i m p l i c i t none! 2006 t h e only t h i n g you need i s t h e e i g e n v a l u e .r e a l (dpkind), i n t e n t ( i n o u t ) :: energy(nstate)
! 2006 This 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 n t i a l! wrapper s i t e to add modules .c a l l lanch2(energy ,nstate)
r e t u r nend s u b r o u t i n e estates
B.2. CENTRAL PROCESS Hang 103
B.2.2 lanch2
s u b r o u t i n e lanch2(eig)
use datatype_mod
use input_mod
use trans_mod
i m p l i c i t none! 2006 run l an c zo s sub rou t in e! 2006 more l i k e a wrapper for both i n i t i a l i z a t i o n and ex e cu t i on! of t h e Lanczos r ou t i n e! I t c a l l s g e t t to i n i t i a l i z e rou t in e s ,! then f o u r i e r to do t h e a c t ua l e i g e n v a l u e s o l v i n g .
! 2006 The e i g e n v a l u e sr e a l (dpkind), i n t e n t ( i n o u t ) :: eig(nstate)
! 2006 i n t e r n a l v a r i a b l e s! 2006 r ad i a l p r o b a b i l i t y d e n s i t yr e a l (dpkind) :: pr(1)
! 2006 l e f t over b e caus e can ’ t i n i t i a l i z e t h i s in a module! f o r some very odd reasoncut = sqrt (5.0 _dpkind)
! 2006 ch e c k t h i n g s out! 2006 probab ly l e g a c y from when read in g from f i l e ,! but probab ly a good idea to keepi f (nblock .gt. nblockm) then
wr i t e (*,*) "nblock too large"
r e t u r ne n d i fi f (nstate .gt. nstatem) then
wr i t e (*,*) "nstate too large"
r e t u r ne n d i f
! 2006 g e t tranform matrix! 2006 indeed , seems to g e t some matrix / v e c t o r for a v e c t o r i z e d! l e g e nd r e t rans format ion rou t i n ec a l l gett(p_ltrans ,pi_ltrans ,anode ,weight ,nl,nm)
! 2006 c a l c u l a t e t h e e i g e n v a l u e s! 2006 e i g r e t u rn s t h e e i g e n v a l u e s , pr are t h e r ad i a l! p r o b a b i l i t y d i s t r i b u t i o n sc a l l fourier(eig ,pr)
r e t u r nend s u b r o u t i n e lanch2
B.2. CENTRAL PROCESS Hang 104
B.2.3 gett
s u b r o u t i n e gett(pr ,pir ,xr,weightr ,lmax ,mmax)
use datatype_mod
use input_mod
use trans_mod
i m p l i c i t none! 2006 t h i s r ou t i n e g e s t s t h e t rans format ion ma t r i c e s to go! and from lm! 2006 i t g e t s t h e matrix e l emen t s fo r! Le g endre transform
i n t e g e r (i32kind), i n t e n t ( i n ) :: lmax , mmax
! 2006 pr i s t rans format ion v e c t o r! p i r i s another t rans format ion v e c t o r! xr and w e i g h t r are ho l d in g t empora r i l y x and we i g h tr e a l (dpkind), i n t e n t ( i n o u t ) :: pr(nmd+nmd1 ,nmd+nmd1 ,nmd1), &
pir(nmd+nmd1 ,nmd+nmd1 ,nmd1), xr(nmd+nmd1), weightr(nmd+nmd1)
! 2006 i n t e r n a l v a r i a b l er 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 (*,*) "lmax too small"
! 2006 g e t g au s s i an quadrature p o s i t i o n and w e i g h t sc a l l set_gaussleg(lmax +1)
! 2006 use r e c u r r s i on r e l a t i o n s for a s s o c i a t e d! l e g e nd r e func t i on s , modif i ed to i n c l ud e normal izat ion ,! to s e t up t h e ma t r i c e s fo r t h e t ran s fo rma t i on sdo ix = 1, lmax+1
sx = sqrt(1 -x(ix)*x(ix))
am = 0
pi_ltrans (1,ix ,1) = 1 / sqrt (2.0 _dpkind)
! 2006 increment l , f i x ed mc 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 increment l and m for l = mpi_ltrans(im+1,ix,im+1) = aa*sx*pi_ltrans(im,ix ,im)
! 2006 incremnet l f i x ed mc a l l upn(im+1,lmax ,pi_ltrans (1,ix ,im+1),x(ix),am)
enddoenddodo 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)
enddoenddo
enddoxr = x
weightr = weight
r e t u r nend s u b r o u t i n e
B.2. CENTRAL PROCESS Hang 105
B.2.4 upn
s u b r o u t i n e upn(nmin ,nmax ,p_upn ,x_upn ,am)
use datatype_mod
use input_mod
i m p l i c i t none! 2006 r a i s i n g and l ow e r i n g op e ra t o r s to f ind 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 n o u t ) :: p_upn(nmax +1)
! 2006 i n t e r n a l v a r i a b l e si 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))
enddor e t u r nend s u b r o u t i n e upn
B.2. CENTRAL PROCESS Hang 106
B.2.5 fourier
s u b r o u t i n e fourier(eig0 ,pr)
use datatype_mod
use input_mod
use overlap
i m p l i c i t none! 2006 This s o l v e s t h e e i g e n v a l u e problem . P r e t t y much .
! 2006 This u s e s dsyev from th e lapack l i b r a r i e s .! Be c a r e f u l . Lapack depends on b l a s .
! 2006 e i g e n v a l u e sr e a l (dpkind), i n t e n t ( i n o u t ) :: eig0(nstate)
! 2006 pr i s t h e p r o b a b i l i t y d i s t r i b u t i o nr e a l (dpkind), i n t e n t ( i n o u t ) :: pr(1)
! 2006 i n t e r n a l v a r i a b l e s! 2006 ntime i s number of i t e r a t i o n ai n t e g e r (i32kind) :: ntime = ncut
! 2006 most of t h e s e are i n d i c e s and boundr i e si 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 d e l t seems to be a spac e s l i c e / s t e p c on t r o lr e a l (dpkind) :: delt , aa, prod , dr ! , phi , dp! 2006 for v e c t o r normal i za t ionr e a l (dpkind) :: anorm(nprod)
! 2006 a c t u a l l y fo r dsyev r a t h e r than f f t , odd .r e a l (dpkind) :: workfft(nprod)
! 2006 temporary s t o r a g e of e i g e n v a l u e I t h inkr e a l (dpkind) :: eigv(ndiagm)
! 2006 H matrixr e a l (dpkind) :: hmat(ndiagm , ndiagm)
! 2006 ground s t a t er e a l (dpkind) :: ground(nmd1 ,nmd)
dr = getblength(hydrogen)
delt = 2 * pi / nm
! 2006 g e t w e i g h t s fo r ov e r l ap of wave f un c t i on sdo ix = 1, nl+1
do ip = 1, nm
wtot(ix ,ip) = delt * weight(ix)
enddoenddo
c a l l set_wtot(wtot)
! 2006 i n i t i a l i z e t h e s t a t e v e c t o rc a l l set_psi(delt)
! 2006 i n i t i a l i z e t h e p o t e n t i a lvps = 0
c a l l set_vps ()
istart = 0
dt = dt0 * cut
! 2006 s t a r t l an c zo s w i th o r t h a g o n a l i t y! 2006 This i s a huge loop . Cleared up most of t h e 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 (−\ tau / 2 V)ev2 = exp(-dt2*vps)
B.2. CENTRAL PROCESS Hang 107
hmat = 0
! 2006 s e t up a l l t h e b l o c k s and or thonorma l i z e themdo ib = 1, nblock
do ibp = 1, ib -1
! 2006 o r t h o g ona l i z e to a l l l ower 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)
enddodo j = 1, nstate
psi(:,:,k,ib) = psi(:,:,k,ib) - anorm(j) * psi(:,:,j,ibp)
enddoenddo
enddodo k = 1, nstate
! 2006 s e l f o r t h a g ona l i z e to t h i s b l o c kanorm = 0 * anorm
do j = 1, k
anorm(j) = anorm(j) + psi(:,:,j,ib) .overlap. psi(:,:,k,ib)
enddodo j = 1, k-1
anorm(k) = anorm(k) - anorm(j)* anorm(j)
enddodo j = 1, k-1
psi(:,:,k,ib) = psi(:,:,k,ib) - anorm(j) * psi(:,:,j,ib)
enddopsi(:,:,k,ib) = psi(:,:,k,ib) / sqrt(anorm(k))
enddo! 2006 app ly exp (− tau H) to PsiE and s t o r e in PsiE ( i b +1 )! 2006 This i s t h e i t e r a t i o n par t! of Lanczos methods where you app ly t h e matrix 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 a l ua t e t h e matrix e l emen t s of T , t h e b l o c k t r i d i a g o n a l onekkk = (ib -1) * nstate + k
istart = max(1,ib -1)
! 2006 c o n s t r u c t s B ib −1ˆ da g g e r ( e x c e p t when ib = 1 ) ( h e r e i b = k in 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)
enddoenddo
! 2006 c o n s t r u c 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)
enddoenddo
enddo! 2006 d i a g ona l i z e! 2006 d s y e v must have t h e under s core for a b s o f t l apack! l i b r a r i e s , o t h e r c omp i l e r s may vary , a l s o has to be lower ca s e! dsyev does s i n g u l a r va lue decompos i t ion , so! s o l v e s t h e e i g e n v a l u e problem
c a l l dsyev_(’V’,’L’,ndiag ,hmat ,ndiagm ,eigv ,workfft ,3* ndiag +100, info)
! 2006 from e i g e n v a l u e s of exp (− tau H) to e i g e n v a l u e s of Hdo kkk = 1, nstate
i = ndiag - kkk + 1
eigfinal(kkk) = -log(eigv(i))/dt
B.2. CENTRAL PROCESS Hang 108
enddopsi(:,:,:, 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)
enddoenddo
enddoenddo
enddo! 2006 copy to c o r r e c t p l a c e! 2006 each i t e r a t i o n i t im e u s e s t h e p r e v i ou s r e s u l t s as t h e s t a r t i n g b l o c k
psi(:,:,:,1) = psi(:,:,:, nblockm1)
enddo
! 2006 ground s t a t e s t u f f! 2006 not sure i f t h i s ough t to be in t h i s sub rou t in e or in! another 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
enddoenddo
pr(1) = pr(1) * delt / dr
do i = 1, nstate
eig0(i) = eigfinal(i)
enddor e t u r nend s u b r o u t i n e fourier
B.2. CENTRAL PROCESS Hang 109
B.2.6 getProp
s u b r o u t i n e getProp ()
use datatype_mod
use input_mod
use prop_mod
i m p l i c i t none! 2006 This sub rou t in e i n i t i a l i z e s t h e propaga t i on rou t i n e .
! 2006 i n t e r n a l v a r i a b l e sr e a l (dpkind) :: aaa , al
i n t e g e r (i32kind) :: il
! 2006 r ad i a l par tprop = 1.0 _dpkind
! 2006 angu lar par tdo 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)
enddor e t u r nend s u b r o u t i n e
B.2. CENTRAL PROCESS Hang 110
B.2.7 fullProp
s u b r o u t i n e fullProp(psi0 , psi_prop , delt)
use datatype_mod
use input_mod
i m p l i c i t none! 2006 ” Propaga t ion ” by doing t h e Tro t t e r approximation! 2006 t h i s sub rou t in e a p p l i e s t h e propaga tor exp (− tau H)! to t h e wave func i t on p s i 0 to in t roduc e p s i
! 2006 spac e s l i c e / s t e pr e a l (dpkind), i n t e n t ( i n ) :: delt
! 2006 s t a t e v e c t o rr e a l (dpkind), i n t e n t ( i n o u t ) :: psi0(nmd1 ,nmd)
r e a l (dpkind), i n t e n t ( i n o u t ) :: psi_prop(nmd1 ,nmd)
! 2006 i n t e r n a l v a r i a b l e si n t e g e r (i32kind) :: ix , ip
! 2006 mu l t i p l y by t h e p o t e n t i a l a t tau / 2 in r e a l spac epsi_prop = psi0 * ev2
! 2006 app ly t h e k i n e t i c o epra to rc a l l trans_p(psi_prop)
! 2006 mu l t i p l y t h e p o t e n t a l a t tau / 2 in r e a l spac epsi_prop = psi_prop * ev2
r e t u r nend s u b r o u t i n e
B.2. CENTRAL PROCESS Hang 111
B.2.8 trans p
s u b r o u t i n e trans_p(psir)
use datatype_mod
use input_mod
use prop_mod
use fft_mod
i m p l i c i t none! 2006 s t a t e v e c t o rr e a l (dpkind), i n t e n t ( i n o u t ) :: psir(nmd1 ,nmd)
! 2006 i n t e r n a l parameter , used to make l i f e workcomplex(dpkind) :: cwk(nmd1), awk(nmd1)
! 2006 complex wave func t ion ho l d e r scomplex(dpkind) :: psic(nmd1 ,nmd), psic2(nmd1 ,nmd1)
complex(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 loop from ip ix to ix ip to i n c r e a s e e f f i c i e n c ypsic = psir
! 2006 i n i t i a l i z a t i o n for c f f t 1 f / b c a l l sc a l l cfft(psictemp ,0)
do il = 1, nl+1
do im = 1, nm
psictemp(im) = psic(il,im)
enddoc a l l cfft(psictemp ,1)
do im = 1, nm
psic(il ,im) = psictemp(im)
enddoenddo
! 2006 transform x= cos ( t h e t a )! m >=0do im = 0, mm
do i = 1, nl+1
cwk(i) = psic(i,im+1)
enddoc a l l sltf(cwk ,awk ,im)
istart = im + 1
do i = istart , nl+1
psic(i,im+1) = awk(i)
enddoenddo! 2006 s i n e transform r propaga t e and back transofmr! m >=0do im = 0, mm
do il = im , nl
psic2(il+1,im+1) = psic(il+1,im+1) * propl(il+1)
enddoenddo! 2006 dump p s i c 2 to p s i cdo im = 0, mm
do il = im , nl
psic(il+1,im+1) = psic2(il+1,im+1)
enddoenddo! 2006 back transform to x= co s ( t h e t a )! m >=0do im = 0, mm
istart = im + 1
B.2. CENTRAL PROCESS Hang 112
do i = istart , nl+1
cwk(i) = psic(i,im+1)
enddoc a l l sltb(cwk ,awk ,im)
do i = 1, nl+1
psic(i,im+1) = awk(i)
enddoenddo! 2006 m < 0! 2006 use symmetry to s imp l i f y l i f edo im = 1, mm -1
do i = 1, nl+1
psic(i,nm -im+1) = conjg(psic(i,im+1))
enddoenddo! 2006 back transform to phido il = 1, nl+1
do im = 1, nm
psictemp(im) = psic(il,im)
enddoc a l l cfft(psictemp ,-1)
do im = 1, nm
psic(il ,im) = psictemp(im)
enddoenddo
psir = r e a l (psic ,dpkind)r e t u r nend s u b r o u t i n e trans_p
B.2. CENTRAL PROCESS Hang 113
B.2.9 sltb and sltf
s u b r o u t i n e sltb(cwk ,awk ,im)
use datatype_mod
use input_mod
use prop_mod
use trans_mod
i m p l i c i t none
complex(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
complex(dpkind), i n t e n t ( i n o u t ) :: awk(nmd1)
! 2006 i n t e r n a l v a r i a b l e si n t e g e r (i32kind) :: i, il, ix
! 2006 i n i t i a l i z e t h e complex numberdo i = 1, nl+1
awk(i) = 0
enddo! 2006 app ly t h e matrix for t h e t rans format iondo il = im , nl
do ix = 1, nl+1
awk(ix) = awk(ix) + pi_ltrans(il -im+1,ix,im+1)* cwk(il+1)
enddoenddor e t u r nend s u b r o u t i n e sltb
s u b r o u t i n e sltf(cwk ,awk ,im)
use datatype_mod
use input_mod
use prop_mod
use trans_mod
i m p l i c i t none
complex(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
complex(dpkind), i n t e n t ( i n o u t ) :: awk(nmd1)
! 2006 i n t e r n a l v a r i a b l e si 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 ndo i = istart , nl1
awk(i) = 0
enddo! 2006 app ly t h e matrix for t h e t rans format iondo ix = 1, nl1
do il = im1 , nl1
awk(il) = awk(il) + p_ltrans(ix ,il -im ,im1)*cwk(ix)
enddoenddor e t u r nend s u b r o u t i n e 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. O’Keeffe, 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. Ratcliffe, 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 Scientific, 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: A Prac-
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 (Birkhauser, 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. Hausdorff, Ber. Verhandl. Sachs. 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.
12–16, 86
Krylov matrix
Given an n×n matrix A, a vector ~q of length n, and a natural number k, the
Krylov matrixK(A,~q1,k) is a n×k matrix defined asK = [~q1(A~q1) . . .(Ak−1~q1)]
(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 span~q1,A~q1,A2~q1, . . . ,A
k−1~q1. 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†A~x~x†~x . 39
rotational constant
Given a quantum rigid rotor of moment of inertia I , the rotational constant B
is defined as B = ~22I . 22
118
Index
Krylov
matrix, 42
subspace, 42, 44, 45
Lanczos
band, see Lanczos, block
block, 45, 46, 86
iteration, 42, 44–46, 49–51, 54, 63, 64
method, 18, 45–50, 64, 77, 79, 80, 86
vector, 42, 44, 45, 48–50
librator, 25, 76
Rayleigh quotient, 39–41
Ritz
value, 45
vector, 45
tridiagonal, 42
tridiagonalization, 42, 49
Trotter approximation, 51, 53, 54, 86
tunnel splitting, 12, 13, 15, 16, 18, 28–36
119