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.

BLAS 5 (collected here: dgemm.f 6 ) are also required. dsyev implements reduction<br />

to tri-<strong>di</strong>agonal form for a real symmetric matrix (d=double precision,<br />

sy=symmetric matrix, ev=calculate eigenvalues and eigenvectors). The usage<br />

of dsyev requires either l<strong>in</strong>k<strong>in</strong>g to a pre-compiled LAPACK and BLAS libraries,<br />

or compilation of the Fortran version and subsequent l<strong>in</strong>k<strong>in</strong>g. Instructions on<br />

the correct way to call dsyev are conta<strong>in</strong>ed <strong>in</strong> the header of the subrout<strong>in</strong>e.<br />

Beware: most <strong>di</strong>agonalization rout<strong>in</strong>es overwrite the matrix!<br />

For the C version of the code, it may be necessary to add an underscore (as <strong>in</strong><br />

dsyev () ) <strong>in</strong> the call<strong>in</strong>g program. Moreover, the tricks expla<strong>in</strong>ed <strong>in</strong> Sec.0.1.4<br />

are used to def<strong>in</strong>e matrices and to pass arguments to BLAS and LAPACK<br />

rout<strong>in</strong>es.<br />

4.4.2 Laboratory<br />

• Observe how the results converge with respect to the number of plane<br />

waves, verify the form of the wave function. Verify the energy you get for<br />

a known case. You may use for <strong>in</strong>stance the follow<strong>in</strong>g case: for V 0 = 1,<br />

b = 2, the exact result is E = −0.4538. You may (and should) also verify<br />

the limit V 0 → ∞ (what are the energy levels?).<br />

• Observe how the results converge with respect to a. Note that for values<br />

of a not so big with respect to b, the energy calculated with the variational<br />

method is lower than the exact value. Why is it so?<br />

• Plot the ground-state wavefunction. You can also mo<strong>di</strong>fy the code to<br />

write excited states. Do they look like what you expect?<br />

Possible code mo<strong>di</strong>fications and extensions:<br />

• Mo<strong>di</strong>fy the code, adapt<strong>in</strong>g it to a potential well hav<strong>in</strong>g a Gaussian form<br />

(whose Fourier transform can be analytically calculated: what is the<br />

Fourier transform of a Gaussian function?) For the same ”width”, which<br />

problem converges more quickly: the square well or the Gaussian well?<br />

• We know that for a symmetric potential, i.e. V (−x) = V (x), the solutions<br />

have a well-def<strong>in</strong>ed parity, alternat<strong>in</strong>g even and odd parity (ground state<br />

even, first excited state odd, and so on). Exploit this property to reduce<br />

the problem <strong>in</strong>to two subproblems, one for even states and one for odd<br />

states. Use s<strong>in</strong>e and cos<strong>in</strong>e functions, obta<strong>in</strong>ed by suitable comb<strong>in</strong>ations<br />

of plane waves as above. Beware the correct normalization and the k n = 0<br />

term! Why is this convenient? What is ga<strong>in</strong>ed <strong>in</strong> computational terms?<br />

5 http://www.netlib.org/blas/<br />

6 http://www.fisica.uniud.it/%7Egiannozz/Corsi/MQ/Software/Blas/dgemm.f<br />

41

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

Saved successfully!

Ooh no, something went wrong!