Computational Physics - Department of Physics

(Axel Boer) #1

5.7 Exercises 149



  1. Use Gauss-Legendre quadrature and compute the integral by integrating for each variable
    x 1 ,y 1 ,z 1 ,x 2 ,y 2 ,z 2 from−∞to∞. How many mesh points do you need before the results con-
    verges at the level of the third leading digit? Hint: the single-particle wave functione−αriis
    more or less zero atri≈?(find the appropriate limit). You can therefore replace the integra-
    tion limits−∞and∞with−?and?, respectively. You need to check that this approximation
    is satisfactory, that is, make a plot of the function and check if the abovementioned limits
    are appropriate. You need also to account for the potential problems which may arise when
    |r 1 −r 2 |= 0.

  2. The Legendre polynomials are defined forx∈[− 1 , 1 ]. The previous exercise gave a very
    unsatisfactory ad hoc procedure. We wish to improve our results. It can therefore be useful
    to change to another coordinate frame and employ the Laguerre polynomials. The Laguerre
    polynomials are defined forx∈[ 0 ,∞)and if we change to spherical coordinates


dr 1 dr 2 =r^21 dr 1 r 22 dr 2 dcos(θ 1 )dcos(θ 2 )dφ 1 dφ 2 ,

with
1
r 12 =

√^1

r^21 +r^22 − 2 r 1 r 2 cos(β)
and
cos(β) =cos(θ 1 )cos(θ 2 )+sin(θ 1 )sin(θ 2 )cos(φ 1 −φ 2 ))
we can rewrite the above integral with different integration limits. Find these limits and
replace the Gauss-Legendre approach in a) with Laguerre polynomials. Do your results
improve? Compare with the results from a).


  1. Make a detailed analysis of the time used by both methods and compare your results.
    Parallelize your codes and check that you have an optimal speed up.

Free download pdf