Projects for the Computational Physics course LMU, winter 2017/2018

Page created by Jill Jimenez
 
CONTINUE READING
Projects for the Computational Physics course
                        LMU, winter 2017/2018
                      Patrick Böhl, Jonas Bucher, and Armin Scrinzi
                                       December 18, 2017

   We will do the last part of the problem classes of the Computational Physics lecture in terms of
mini-problems to be solved by the individual teams. This should give you the opportunity to cover,
within each problem, the typical tasks for computational physics: get an idea about the physics and
mathematics involved, code the systems in an organized way, produce data and make sense of them,
and last but not least, tell us about it. It will also provide the teams with deeper insight into their
specific topic, which, because of time-limitations, will be covered only superficially in the lecture.

Project assignemts Projects have been assigned primarily by preference and the time of your
registration, but in one case work load considerations have also influenced the assignement.
                    Topic                       Team           Supervisor
                    (1) QM 3Body                Meyer            Scrinzi
                    (2) Class 3Body       PCM (Czechovski)        Böhl
                    (3) Monte Carlo     Monte Carlo (Grundner)  Bucher
                    (4) Wave equations         Monaco             Böhl
                    (5) Wigner distrib.        Poldaru          Bucher

Workflow We will define “milestones” for your selected project that should be delivered at the
regular problem classes. We will assist you individually also outside the problem classes. Depending
on how well the projects progress, we are considering to skip the last two or three problem classes
and merge them into a single final “mini-workshop” of a couple of hours, where the teams present
their results.
   You are welcome to suggest changes to the tasks, which we will accept if we consider them worthy
and feasible.

Schedule The first few milestones are given in some detail. Tentative dates for completing:
M1 January 11

M2 January 18
Further details will be given depending on the progress in the individual projects.

                                                  1
Submission and Tutoring Each team should have its own git repository on the gitlab. Tutors
and lecturer should be given read access to that repository. (See instructions on problem sheet 3).
   The main times for tutoring will be the exercise slots on Wednesday and Thursday. As one team
appears to be distributed over both dates, please, find an arrangement with the supervisor.

Presentations As part of the mini-project we plan a presentation on each of the topics. These
will take place during the last week of the semester during the problem classes, or, if needed, during
the last lecture slot. We will try set up a schedule based on the results we have seen by the end of
January.
    The presentations can be workshop-like, i.e. do not need to exclusively present results, but can
also (in a structured form) point to unsolved problems and discuss the difficulties.

Contents
1 The quantum-mechanical three-body Coulomb problem                                                 3

2 The classical three-body problem 2                                                                5

3 Monte Carlo methods                                                                               7

4 Wave-equations                                                                                    9

5 Wigner distributions                                                                             11

                                                  2
1     The quantum-mechanical three-body Coulomb problem
    • Discuss 3-body Coulomb problems: He-atom, H − -ion, H2+ -molecule, muonic molecular ion
      tdµ+ and their main characteristics.
    • Compare bound-state and resonant state spectra of the systems, compare to literature values.
    • Implement higher angular momentum states.
    • Compute photo-ionization cross-sections.

Milestones
M1 Helium and H − at angular momentum L = 0. A basic code will be provided. Verify it by
   computing the ground and first few excited states of both systems. How many bound states do
   you find? Try to push the accuracies for the ground and excited states, compare to literature
   values. Define an exchange symmetry operator. What are the states’s symmetries?
      Implement exchange symmetry explicitly by restricting the basis to functions with well-defined
      symmetry.
M2 Use complex scaling to find resonances as the eigenvalues Wn = En − iΓ/2 of H
                                                                               bθ :

                                       H             b θ = e−2iθ Tb + e−iθ Vb
                                       b = Tb + Vb → H                                                         (1)
      Mathematically, the eigenvalues should be independent of θ. In the finite numerical approxima-
      tion this holds true only approximately. Identify candidates for resonances by their approximate
      independence of θ.
M3 Angular momentum 1 states. Extend the operator to account for angular momentum L =
                                                                  (LM =10)
   1, M = 0. All you need for that are basis functions Gn                  (~r1 , ~r2 ), n = 0, 1, 2 that behave as
   vectors under rotations. These are ~r1 , ~r2 , ~r1 ×~r2 . Determine the operators for the new functions.
   Find eigenstates as above.
      Can you locate “unnatural parity” states? How do you actually identify a “bound” state? This
      is non-trivial an the case of unnatural parity.
M4 Compute photo-ionization rate. For given photon energy ω~ these are determined by squares
   of the bound-continuum dipole matrix elements as
                                      Z
                             M (E) = dΩk |hkω , Ωk , 1|r cos θ|Ψi|2 ,                    (2)

      where |Ψi is the initial neutral (ground) state with energy E0 and |~k, 1i are the scattering states
      with one electron having energies ~kω2 /2 while the other remains behind in the first ionic state.
      The photo-electron energy is E = kω2 /2 = ~ω − Ip with the “ionization potential” Ip = E1 − E0 .
      This can be rewritten without explicit reference to the continuum states
                                        M (E) ∝ limhΨ|(H − E − i)−1 |Ψi,                                      (3)
                                                   ↓0

                                                         3
which, surprisingly, can be easily evaluated using the complex scaling introduced above.

M5 Possible further extensions: energies of muonic molecular ions (needs “mass polariztion” term
   to account for finite masses. Higher angular moment. Stark shifts.

Presentation (See general comments on presentations in the introduction).
Give an overview of the properties of the bound-state 3-body coulomb problem. The subtopics should
be

   • Assess your results on He L=0 and L=1 state energies relative to literature values (PDF will
     be provided). Discuss the reasons the deviations you see.

   • Discsuss resonances (= doubly excited states = Auger states) and the complex scaling technique
     to find them

   • Discuss the problem of numerical contiumm functions. Show the cross-section as a function of
     photon energy.

                                                4
2     The classical three-body problem 2
    • Classical two-body problem.

    • Explore ODE-integrators for the problem.

    • Extend the solver to the classical three-body problem.

    • Verify various known solutions numerically.

    • Write a HDF5 (or NetCDF) output to organise your data.

    • Try to find a chaotic solution.

Milestones
M1 Reproduce Keplerian dynamics and gather experience about the accuracy of the time-propagators
   (select from the methods introduced in the lecture).

      Problem 2.1: Implement the propagators taking advantage of an abstract base class, such
      that you can easily switch between methods. Show that you can control errors of energy, an-
      gular momentum and the Runge-Lenz-vector on the level expected by the constistency order
      of the method used.

      Problem 2.2: Input the parameters of (Keplerian) planetary motion of earth and show
      correctness. Increase the initial velocity until you meet parabolic and hyperbolic trajectories.

M2 A comprehensive review of the three-body problem is “The three-body problem” by Musielak
   and Quarles http://iopscience.iop.org/article/10.1088/0034-4885/77/6/065901/meta.

      Problem 2.3: Summarize and report the chapter 3.1. on the Euler- and Lagrange-solutions
      and chapter 3.4 on the Pythagorean triangle solution.

      Problem 2.4: Program and verify the solutions. Study their behavior under small de-
      viations. How sensitive is the stability of the numerical solution to the chosen integration
      method?

M3 As one goal of the project will be the search for periodic solutions starting with “random”
   initial conditions, it will be useful to have a good organisation of your output data. Implement
   a HDF5 (or probably better NetCDF as metadata is useful for your simulations) output for
   your simulations.

Presentation (See general comments on presentations in the introduction). Present the individual
results (not closely connected)

                                                    5
• Kepler-Problem: Explain the numerical methods and show some comparison of the numerical
  methods used. Comment on the difficulties you encountered.

• Show results for the three-body-problem with different methods. Compare to analytically
  known results.

• Give a (rather) brief introduction on HDF5/NetCDF.

                                          6
3     Monte Carlo methods
    • Review tests of “randomness”.
    • Perform tests on a range of random number generators, demonstrate shortcomings of (bad)
      generators
    • Monte-Carlo integration: demonstrate performance and limitations at examples that will be
      provided
    • Compare Monte-Carlo integrations to quadrature for various functions and dimensions
    • Model the Ising chain using the Metropolis algorithm

Milestones
M1 We will see that the generation — more importantly: even he concept of a “randon number”
   is non-trivial. See the “Monte-Carlo”-chapter in the notes.
      Solve the following problems:
      Problem 3.5: Download the dieharder test suite for random generators. Select a few of
      the tests and discuss their idea. Find critical discussion of the selected tests: where would a
      given test fail to detect lack of “randomness”?
      Note: ”dieharder” can be downloaded in the form of rpm’s for Linux systems. Where you do
      not have rpm (readhad package management), e.g. on Windows, you may need to compile the
      C-code.
      Problem 3.6: Random number generators, and things that can go wrong: Historically, a
      famous example for a bad RNG was provided by “randu” by IBM, where a sequence of xn was
      generated by the prescription:
                                          xn+1 = 65539xn      mod 231 .                                  (4)
      Plot subsequent triples of the numbers (scaled into [0,1]) as dots in 3d into [0, 1] × [0, 1] × [0, 1],
      and you will see a nice pattern. (Note that this RNG violates condition 3.)
M2
      Problem 3.7: Monte-Carlo integration.
      (a) Create a class for Monte-Carlo integration in one dimension. For the integrals
                             Z 1              Z 2π                    Z 2π
                       (0)        2      (1)          2         (2)
                      I =        x dx, I =         sin (x)dx, I =          sin2 (1/x)dx
                                 0                   0                         0

           verify your routines.
                                                                       (i)
      (b) Demonstrate correct convergence: plot the deviation IN − I (i) as N increases, show that
          the errors tend to decrease as N −1/2 (clearly, you will not obtain exactly the a decrease
          by N −1/2 ).
          Note: General reminder: in a log-log plot any power will appear as a straight line.

                                                     7
(c) Verify the near-Gaussian behavior: for I = I (0) repeatedly compute IN at a fixed number
          of N = 100. Show how IN scatters around the true value I. Sort the results into a
          histogram HN (n), n = . . . − 3, −2, −1, 0, 1, 2, . . ., showing the counts that you find in
          equidistant bins [I + (n − 1/2)∆, I + (n + 1/2)∆] around the true value. For a nice graph,
          choose ∆ such that the central bin has about N/20 counts.
          Note: The desired ∆ could be determined by trial and error, but actually it can be
          predicted easily, how?
     (d) Plot the Gaussian distribution as predicted for N → ∞: the distribution ρ(IN ) should
         resemble your Gaussian. (Plot on a log-scale!).
      (e) Reduce the MC estimate IN of the integral to five points, N = 5, I5 . Read off the most
          likely result for I5 from the graph. How does it compare to the exact? Does ρ(I5 ) converge
          to a Gaussian? What is the expectation value for I5 ?
          Solution 3.7: the last point: is like a MC estimate with N=(rep)*5, i.e. mean is I
          —————————–

M3
     Problem 3.8: Write your own code implementing the Metropolis algorithm for the Ising
     spin chain. Prove its correctness by comparison to analytic results and, for small spin numbers,
     the average over all configurations. Speed up performance by taking as many floating operations
     as possible outside the main loop.

M4 Implement the 2D Ising model (or whichever model you prefer), compare results to known
   physics.

Presentation (See general comments on presentations in the introduction). Present the individual
results (not closely connected)

   • Function and ideas of the “dieharder” test suit.

   • Your results on MC integration: use your error estimates to illustrate the discussion of errors
     in MC during the lecture.

   • Present your solution for Ising by the Metropolis algorithm: show the code, discuss your
     attempts to keep it efficient, compare to analytical results.

                                                  8
4     Wave-equations
    • Solve a simple one-dimensional wave equation using FDTD (finite-difference time-domain).

    • Analyze the numerical dispersion relation, the stability etc.

    • Consider alternative intergrators, e.g. “exponential” integrators.

    • Simulate a nonlinear Kerr-medium with FDTD and an exponential integrator of your choice,
      compare performance and accuracy.

    • Learn some interesting physics from Kerr-media like self-focussing etc.

Milestones
M1 Learn what FDTD is and how to use it for the simple wave equation

                                          ∂t2 u(t, z) − ∂z2 u(t, z) = 0

      with periodic boundary conditions. Hint: Rewrite it as two first order equations. This cor-
      responds to Maxwell’s equations in one dimension with only one component of the electric
      and magnetic field. The most popular FDTD scheme for Maxwell’s equations is the “Yee”
      scheme. A standard reference is the book “Computational Electrodynamics: The Finite-
      Difference Time-Domain Method” by Taflove and Hagness. But you’ll also find tons of material
      on the web.

M2 Find out the properties of the scheme like numerical dispersion and stability (Courant-Friedrichs-
   Levy-criterium) and study them with your numerical simulations.

M3 Have a look at “exponential integrators” like “Lawson4” and “Hochbruck4” from “Time-
   Domain Simulations of the Nonlinear Maxwell Equations Using Operator-Exponential Meth-
   ods” by Pototschnig et. al. (IEEE TRANSACTIONS ON ANTENNAS AND PROPAGA-
   TION, VOL. 57, NO. 2, FEBRUARY 2009). If you don’t find the pdf, please ask the supervisor.
   Try to implement the one you like the best and compare the performance with FDTD.

M4 Implement an electric and magnetic conductance in your FDTD code. This allows you to
   study absorbing boundary conditions (like Perfectly Matched Layers, PMLs). Try if you
   can make them work properly. Implement an additional nonlinear optical Kerr-medium in
   your FDTD (you might find “General vector auxiliary differential equation finite-difference
   time-domain method for nonlinear optics” http://www.ece.northwestern.edu/ecefaculty/
   taflove/Paper111.pdf by Greene and Taflove useful) and exponential integrator. No need
   for UPMLs here. In the paper by Pototschnig you can also find a reference solution for a
   single Kerr-Medium without conductivity (or check against what you know from the Nonlin-
   ear Schrödinger Equation (NLSE)). Learn about interesting effects like “self-focussing” in a
   Kerr-Medium.

                                                    9
Presentation (See general comments on presentations in the introduction). Present the individual
results (not closely connected)

   • Explain and show comparison of the numerical methods you used. Comment on the difficulties
     you encountered.

   • Explain numerical dispersion relations and stability and show their consequences.

   • Explain the idea and implementation of PMLs and show their effects.

   • Explain what a Kerr-medium is, how to treat it numerically and some if it’s consequences (like
     a refractive index that depends on the field-amplitude, self-focussing etc.).

                                                10
5     Wigner distributions
    • Get the Wigner distribution of a harmonic oscillator

    • Set up time-dependent version (parts of codes from lecture)

    • Study its time-evolution: visualize phenomena known as “squeezing” in quantum mechanics

    • Wigner-function of a (one-dimensional) hydrogen atom in presence of a time-dependent field
      (parts of codes will be provided)

Milestones
M1 The Wigner distribution is an attempt to map a quantum-mechanical object into classical phase
   space. The phase space is introduced into quanum mechanics by defining the translation and
   reflection operators

                                      T̂(ξx ,ξp ) = exp [i(ξp x̂ − ξx p̂)] ,
                                                    Z
                                      2R̂(x,p) =      dξp dξx exp [i(pξx − xξp )] T̂(ξx ,ξp )

      (recall that p̂ generates translations and x̂ accelerations–or translations in momentum space)
      and expressing operators  as

                                                                   Z
                                                             −1
                                             Â = (2π)       dpdxA(x, p)2R̂(x,p) ,
                                                    h           i
                                        A(x, p) = tr 2R̂(x,p) Â .

      The Wigner function is this representation of a quantum mechanical state (that is density
      operator)

                                                       X                Z
                                         −1                        −1
                     W (x, p) = (2π) ρ(x, p) =              pi π            dyΨ∗i (x + y)Ψi (x − y) exp [2ipy]
                                                        i
                 P
      for ρ̂ =   i   pi |Ψi ihΨi |.
      The Wigner function has some nice properties, like
                                                h i Z
                                              tr Âρ̂ = dpdxW (x, p)A(x, p),

      however it cannot be interpreted as a probability density. Why? Look up other properties of
      the Wigner function.

                                                            11
Set up a class Wigner to compute the Wigner distribution for a density operator |ΨihΨ| given as
     Wavefunction Psi, which can be obtained on an equidistant grid by Wavefunction::on_grid.
     Checking the definition, one sees that the Wigner distribution W (x, p) is essentially the Fouri-
     ertransformation of Ψ(x+y)Ψ(x−y) w.r.t. y. Perform the transformation using the fast Fourier
     transform “fftw”.
     Make 2D-plots of various Wigner distributions.

M2 Plot the Wigner distribution of the first eigenstates of the harmonic oscillator. Do these
   have a “classical analogy,“ meaning, can the Wigner distribution be interpreted as a probility
   distribution?

          √ the coherent state |αi defined as the eigenstate of the annihilation operator â = (x̂ +
     Recall
     ip̂)/ 2. Plot the Wigner distribution for the coherent state for various values of α. Plot and
     compare for ρ1 = (|αi + |βi)(hα| + hβ|)/2 and ρ2 = (|αihα| + |βihβ|)/2. What is the physical
     interpretation of both these states? What about their classical analogies?
     Numerically and/or graphically check the equations
                          Z                         Z
                                                2
                            dpW (x, p) = |Ψ(x)| ,      dxW (x, p) = |Ψ(p)|2

M3 Solve the time-dependent Schrödinger equation given an initial state WaveFunction Psi0 and
   Hamiltonian Operator Ham taking snapshots of the Wigner distribution at intermediate times.
   Plot these distributions and create an animation showing the time evloution.
     Test your code with the harmonic oscillator and initial coherent state. Recall from youre QM
     lecture, that the expectation values evolve like in the classical case. Can you interpret your
     results in purely classical terms?
     Add an x4 perturbation (or whatever perturbation you like).
     Change the initial state to a Gaussian exp[−(x − x0 )2 /σ 2 ] with various displacements x0 and
     width σ. You should see an effect called “squeezing”.

M4 If there is time, implement QM time evolution for the Wigner function.

Presentation (See general comments on presentations in the introduction).

   • Introduce the Wigner transform and try to point out its meaning.

   • Show the Wigner transforms for Gaussians of different width.

   • Show the snapshots of the solution of the time-dependent Schrödinger equation.

   • Show the Wigner transform of the same snapshots. What does this tell us about the distribution
     in phase space? Discuss how it compares to the classical problem.

                                                 12
You can also read