The Variational-Relaxation Algorithm for Finding Quantum Bound States Daniel V
Total Page:16
File Type:pdf, Size:1020Kb
The variational-relaxation algorithm for finding quantum bound states Daniel V. Schroeder Citation: American Journal of Physics 85, 698 (2017); View online: https://doi.org/10.1119/1.4997165 View Table of Contents: http://aapt.scitation.org/toc/ajp/85/9 Published by the American Association of Physics Teachers Articles you may be interested in The geometry of relativity American Journal of Physics 85, 683 (2017); 10.1119/1.4997027 On the definition of the time evolution operator for time-independent Hamiltonians in non-relativistic quantum mechanics American Journal of Physics 85, 692 (2017); 10.1119/1.4985723 An analysis of the LIGO discovery based on introductory physics American Journal of Physics 85, 676 (2017); 10.1119/1.4985727 DEEP LEARNING IN PHYSICS American Journal of Physics 85, 648 (2017); 10.1119/1.4997023 Interference between source-free radiation and radiation from sources: Particle-like behavior for classical radiation American Journal of Physics 85, 670 (2017); 10.1119/1.4991396 Student understanding of electric and magnetic fields in materials American Journal of Physics 85, 705 (2017); 10.1119/1.4991376 COMPUTATIONAL PHYSICS The Computational Physics Section publishes articles that help students and their instructors learn about the physics and the computational tools used in contemporary research. Most articles will be solicited, but interested authors should email a proposal to the editors of the Section, Jan Tobochnik ([email protected]) or Harvey Gould ([email protected]). Summarize the physics and the algorithm you wish to include in your submission and how the material would be accessible to advanced undergraduates or beginning graduate students. The variational-relaxation algorithm for finding quantum bound states Daniel V. Schroedera) Department of Physics, Weber State University, Ogden, Utah 84408-2508 (Received 2 February 2017; accepted 19 July 2017) I describe a simple algorithm for numerically finding the ground state and low-lying excited states of a quantum system. The algorithm is an adaptation of the relaxation method for solving Poisson’s equation, and is fundamentally based on the variational principle. It is especially useful for two- dimensional systems with nonseparable potentials, for which simpler techniques are inapplicable yet the computation time is minimal. VC 2017 American Association of Physics Teachers. [http://dx.doi.org/10.1119/1.4997165] I. INTRODUCTION II. THE ALGORITHM Solving the time-independent Schrodinger€ equation for an A standard exercise in computational physics9–11 is to arbitrary potential energy function VðÞ~r is difficult. There solve Poisson’s equation, are no generally applicable analytical methods. In one dimension it is straightforward to integrate the equation r2/ðÞ~r ¼qðÞ~r ; (1) numerically, starting at one end of the region of interest and working across to the other. For bound-state problems for where qðÞ~r is a known function, by the method of relaxation: which the energy is not known in advance, the integration Discretize space with a rectangular grid, start with an arbi- must be repeated for different energies until the correct trary function /ðÞ~r that matches the desired boundary condi- boundary condition at the other end is satisfied; this algo- tions, and repeatedly loop over all the grid points that are not rithm is called the shooting method.1–4 on the boundaries, adjusting each / value in relation to its For a nonseparable5 potential in two or more dimensions, nearest neighbors to satisfy a discretized version of however, the shooting method does not work because there Poisson’s equation. To obtain that discretized version, write are boundary conditions that must be satisfied on all sides. each term of the Laplacian operator in the form One can still use matrix methods,6–8 but the amount of @2/ /ðÞ~r þ dx^ þ /ðÞ~r À dx^ À 2/ðÞ~r computation required can be considerable and the diagonal- ; (2) ization routines are mysterious black boxes to most @x2 d2 students. This paper describes a numerical method for obtaining where d is the grid spacing and x^ is a unit vector in the x ðÞ the ground state and low-lying excited states of a bound direction. Solving the discretized Poisson equation for / ~r system in any reasonably small number of dimensions. then gives the needed formula, The algorithm is closely related to the relaxation 1 method9–11 for solving Poisson’s equation, with the com- / ¼ / þ q d2; (3) 0 nn 2d 0 plication that the equation being solved depends on the energy, which is not known in advance. The algorithm where /0 and q0 are the values of / and q at ~r (the current does not require any sophisticated background in quantum grid location), d is the dimension of space, and /nn is the mechanics or numerical analysis. It is reasonably intuitive average of the / values at the 2d nearest-neighbor grid loca- andeasytocode. tions. As this formula is applied repeatedly at all grid loca- The following section explains the most basic version of tions, the array of / values “relaxes” to the desired self- the algorithm, while Sec. III derives the key formula using the consistent solution of Poisson’s equation that matches the variational method. Section IV presents a two-dimensional fixed boundary conditions, to an accuracy determined by the implementation of the algorithm in MATHEMATICA.SectionV grid resolution. generalizes the algorithm to find low-lying excited states, and What is far less familiar is that this method can be Sec. VI presents two nontrivial examples. The last two sec- adapted to solve the time-independent Schrodinger€ equa- tions briefly discuss other related algorithms and how such tion. To see the correspondence, write Schrodinger’s€ equa- calculations can be incorporated into the undergraduate phys- tion with only the Laplacian operator term on the left-hand ics curriculum. side: 698 Am. J. Phys. 85 (9), September 2017 http://aapt.org/ajp VC 2017 American Association of Physics Teachers 698 ÀÁ 2 DhwjKjwi¼À2d w À w w ddÀ2 r wðÞ~r ¼2ðÞE À VðÞ~r wðÞ~r ; (4) 0;new 0;old nn d w2 w2 ddÀ2; (13) where E is the energy eigenvalue, VðÞ~r is the given potential þ 0;new À 0;old energy function, and I am using natural units in which h and the particle mass are equal to 1. Discretizing the Laplacian where the factor of 2 in the first term of Eq. (13) arises gives a formula of the same form as Eq. (3), because there is an identical contribution of this form from the terms in the sum of Eq. (10) in which i is one of the 1 neighboring grid locations. w ¼ w þ ðÞE À V w d2; (5) 0 nn d 0 0 The algorithm, then, is as follows: where the subscripts carry the same meanings as in Eq. (1) Discretize space into a rectangular grid, placing the boundaries far enough from the region of interest that the (3). The appearance of w0 on the right-hand side creates no difficulty at all, because we can solve algebraically for ground-state wave function will be negligible there. w : (2) Initialize the array of w values to represent a smooth, 0 nodeless function such as the ground state of an infinite square well or a harmonic oscillator. All the w values on wnn w ¼ : (6) the boundaries should be zero and will remain unchanged. 0 d2= 1 À ðÞE À V0 d (3) Use Eqs. (8)–(10) to calculate hwjwi; hwjHjwi, and hEi for the initial w array. The more pressing question is what to do with E, the energy (4) Loop over all interior grid locations, setting the w value eigenvalue that we do not yet know. The answer is that we at each location to can replace it with the energy expectation value w hwjHjwi w ¼ nn : (14) hEi¼ ; (7) 0 2 hwjwi 1 hðÞEiV0 d =d 1 2 ðÞ Also use Eqs. (11)–(13) to compute the changes to where H ¼2 r þ V ~r is the Hamiltonian operator. We then update this expectation value after each step in the cal- hwjHjwi and hwjwi that result from this change to w0 and culation. (The denominator in Eq. (7) is needed because the use these quantities to update the value of hEi before algorithm does not maintain the normalization of w.) As the proceeding to the next grid location. ðÞ relaxation process proceeds hEi will steadily decrease, and (5) Repeat step 4 until hEi and w ~r no longer change, we will eventually obtain a self-consistent solution for the within the desired accuracy. ground-state energy and wave function. The simplest procedure, as just described, is to update each The inner products in Eq. (7) are integrals, but we can w value “in place,” so that a change at one grid location compute them to sufficient accuracy as ordinary sums over immediately affects the calculation for the next grid location. the grid locations. The denominator is simply In the terminology of relaxation methods, this approach is called the Gauss–Seidel algorithm.9–11 X w w w2dd; h j i¼ i (8) III. VARIATIONAL INTERPRETATION i In the previous section I asserted, but did not prove, that where the index i runs over all grid locations and I have hEi will steadily decrease during the relaxation process. To assumed that w is real. Similarly, the potential energy contri- see why this happens, it is instructive to derive Eq. (14) using 12 bution to the numerator is the variational method of quantum mechanics. The idea is X to treat each local value w0 as a parameter on which the func- 2 d tion wðÞ~r depends, and repeatedly adjust these parameters, hwjVjwi¼ Viwi d : (9) i one at a time, to minimize the energy expectation value hEi.