31.12.2013 Views

Numerical Methods in Quantum Mechanics - Dipartimento di Fisica

Numerical Methods in Quantum Mechanics - Dipartimento di Fisica

Numerical Methods in Quantum Mechanics - Dipartimento di Fisica

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

with V 0 > 0, b < a. The matrix elements of the Hamiltonian are given by<br />

Eq.(4.47) for the k<strong>in</strong>etic part. by Eq.(4.48) for the potential. The latter can be<br />

explicitly calculated:<br />

〈b i |V (x)|b j 〉 = − 1 a<br />

= − V 0<br />

a<br />

= V 0<br />

a<br />

∫ b/2<br />

V 0 e −i(k i−k j )x dx (4.51)<br />

−b/2<br />

e −i(k i−k j )x<br />

b/2<br />

−i(k i − k j ) ∣<br />

−b/2<br />

The case k i = k j must be separately treated, yield<strong>in</strong>g<br />

V 0 (4.52)<br />

s<strong>in</strong> (b(k i − k j )/2)<br />

, k i ≠ k j . (4.53)<br />

(k i − k j )/2<br />

Ṽ (0) = V 0b<br />

a . (4.54)<br />

Code pwell.f90 1 (or pwell.c 2 ) generates the k i , fills the matrix H ij and <strong>di</strong>agonalizes<br />

it. The code uses units <strong>in</strong> which ¯h 2 /2m = 1 (e.g. atomic Rydberg<br />

units). Input data are: width (b) and depth (V 0 ) of the potential well, width<br />

of the box (a), number of plane waves (2N + 1). On output, the code pr<strong>in</strong>ts<br />

the three lowest energy levels; moreover it writes to file gs-wfc.out the wave<br />

function of the ground state.<br />

4.4.1 Diagonalization rout<strong>in</strong>es<br />

The practical solution of the secular equation, Eq.(4.32), is not done by naively<br />

calculat<strong>in</strong>g the determ<strong>in</strong>ant and f<strong>in</strong>d<strong>in</strong>g its roots! Various well-established,<br />

robust and fast <strong>di</strong>agonalization algorithms are known. Typically they are based<br />

on the reduction of the orig<strong>in</strong>al matrix to Hessenberg or tri<strong>di</strong>agonal form via<br />

successive transformations. All such algorithms require the entire matrix (or at<br />

least half, exploit<strong>in</strong>g hermiticity) to be available <strong>in</strong> memory at the same time,<br />

plus some work arrays. The time spent <strong>in</strong> the <strong>di</strong>agonalization is practically<br />

<strong>in</strong>dependent on the content of the matrix and it is <strong>in</strong>variably of the order of<br />

O(N 3 ) float<strong>in</strong>g-po<strong>in</strong>t operations for a N × N matrix, even if eigenvalues only<br />

and not eigenvectors are desired. Matrix <strong>di</strong>agonalization used to be a major<br />

bottleneck <strong>in</strong> computation, due to its memory and time requirements. With<br />

modern computers, <strong>di</strong>agonalization of 1000 × 1000 matrix is done <strong>in</strong> less than<br />

no time. Still, memory grow<strong>in</strong>g as N 2 and time as N 3 are still a serious obstacle<br />

towards larger N. At the end of these lecture notes alternative approaches will<br />

be mentioned.<br />

The computer implementation of <strong>di</strong>agonalization algorithms is also rather<br />

well-established. In our code we use subrout<strong>in</strong>e dsyev.f 3 from the l<strong>in</strong>ear algebra<br />

library LAPACK 4 . Several subrout<strong>in</strong>es from the basic l<strong>in</strong>ear algebra library<br />

1 http://www.fisica.uniud.it/%7Egiannozz/Corsi/MQ/Software/F90/pwell.f90<br />

2 http://www.fisica.uniud.it/%7Egiannozz/Corsi/MQ/Software/C/pwell.c<br />

3 http://www.fisica.uniud.it/%7Egiannozz/Corsi/MQ/Software/Lapack/dsyev.f<br />

4 http://www.netlib.org/lapack/<br />

40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!