19
Spectral Differentiation Matrices for the Numerical Solution of Schr ¨ odinger’s Equation J.A.C. Weideman Department of Applied Mathematics University of Stellenbosch South Africa http://dip.sun.ac.za/ weideman Thanks to: NRF-FA2005032300018 “I have no satisfaction in formulas NSF DMS-9404399 unless I feel their numerical magnitude” Lord Kelvin

Numerical Solution of Schrodinger’s Equation¨ Spectral

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Numerical Solution of Schrodinger’s Equation¨ Spectral

Spectral Differentiation Matrices for theNumerical Solution of Schrodinger’s Equation

J.A.C. WeidemanDepartment of Applied Mathematics

University of StellenboschSouth Africa

http://dip.sun.ac.za/ weideman

Thanks to:

• NRF-FA2005032300018 “I have no satisfaction in formulas

• NSF DMS-9404399 unless I feel their numerical magnitude”

Lord Kelvin

Page 2: Numerical Solution of Schrodinger’s Equation¨ Spectral

Overview of talk:

1. Quick Introduction

2. Software (DMSUITE)

3. Solving Schrodinger’s Equation

Page 3: Numerical Solution of Schrodinger’s Equation¨ Spectral

1. QUICK INTRODUCTION

Consider toy problem

y′′(x) = λy(x), −1 ≤ x ≤ 1,

subject to boundary conditions

y(−1) = y(+1) = 0.

Discretize by Method of Finite Differences

x0

x1

x2

xN

h = (b−a)/Na b

Denoteyj ≈ y(xj)

Page 4: Numerical Solution of Schrodinger’s Equation¨ Spectral

Approximate second derivative by central differences

y′′(x) = λy(x)

=⇒ yj+1 − 2yj + yj−1

h2= λyj, j = 1, . . . , N − 1

=⇒ D2y = λ y

Here

D2 =1

h2

−2 1

1 −2. . .1 −2

, y =

y1

y2...yN−1

Differentiation matrix: D2 = matrix representation of d2

dx2 + BCs

Page 5: Numerical Solution of Schrodinger’s Equation¨ Spectral

Basic idea of Spectral Collocation a.k.a. Pseudospectral Method:Do not use local interpolants, use a single global interpolant instead

Finite Differences Spectral Collocation

Page 6: Numerical Solution of Schrodinger’s Equation¨ Spectral

Lagrange form of polynomial interpolant

pN(x) = L0(x) u0 + L1(x) u1 + . . . + LN(x) uN

whereLk(x) = pol. degree N, Lk(xj) =

{1 k = j

0 k 6= j

Differentiate twice and evaluate at x = xj

p′′N(xj) = L′′0(xj) u0 + L′′1(xj) u1 + . . . + L′′N(xj) uN

Substitute intop′′N(xj) = λy(xj)

=⇒

L′′1(x1) L′′2(x1) . . . L′′N−1(x1)

L′′1(x2) L′′2(x2) . . . L′′N−1(x2)... ... ...

L′′1(xN−1) L′′2(xN−1) . . . L′′N−1(xN−1)

u1

u2...

uN−1

= λ

u1

u2...

uN−1

Defines spectral differentiation matrix D2.

Page 7: Numerical Solution of Schrodinger’s Equation¨ Spectral

Important: Do not use equidistantpoints: they lead to ill-conditioning& Runge phenomenon −→

Rather use Chebyshev points of thesecond kind, defined by

xk = cos(

N

), k = 0, . . . , N

x0

xN

π/N

References:

L.N. Trefethen, Spectral Methods in MATLAB, SIAM, 2000

B. Fornberg, A Practical Guide to Pseudospectral Methods, CUP, 1996

Page 8: Numerical Solution of Schrodinger’s Equation¨ Spectral

Solve Toy Example as test problem

y′′(x) = λy(x) =⇒ D2y = λy

On [-1,1] exact eigenvalues/functions are given by

λk = −k2π2

4, yk(x) =

cos(

12kπx

)k odd

sin(

12kπx

)k even.

Solve algebraic eigenvalue problem D2y = λy numericallyand plot absolute errors in k = 1 eigenvalues as functions of N:

Page 9: Numerical Solution of Schrodinger’s Equation¨ Spectral

0 5 10 15 20 2510

−16

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

102

N

Abs

olut

e E

rror

in λ

1

Finite Difference

Spectral

0 5 10 15 20 250

200

400

600

800

1000

1200

1400

1600

1800

2000

−λ k

k

O(N2)

O(N4)

SpectralFinite Difference

Page 10: Numerical Solution of Schrodinger’s Equation¨ Spectral

Variations on the Theme

Weighted Polynomial Methods:

pN(x) = w(x)(L0(x) u0 + L1(x) u1 + . . . + LN(x) uN

)

? Hermite weight:

w(x) = e−x2/2, x ∈ (−∞, ∞), xk = zeros of HN+1(x)

? Laguerre weight:

w(x) = e−x, x ∈ [0, ∞), xk = zeros of LN+1(x)

Non-Polynomial Methods:

? Trigonometric (Fourier)

? Sinc (cardinal)

Page 11: Numerical Solution of Schrodinger’s Equation¨ Spectral

2. SOFTWARE

DMSUITE = MATLAB package developed by JACW and SC Reddy

? It computes pseudospectralD matrices corresponding to

– Chebyshev– Hermite– Laguerre– Fourier– Sinc

? plus utilities for BCs.

Attention to:

? efficient MATLAB coding(i.e., vectorization)

? numerical stability

Paper in ACM Trans Math Software, Vol. 26, pp. 465–519 (2000)

Software is free and may be downloaded from

www.mathworks.com http://dip.sun.ac.za/ weideman

Page 12: Numerical Solution of Schrodinger’s Equation¨ Spectral

Tutorial-style Applications:

? Schrodinger −y′′(x) + y(x) = λq(x) y(x), x ∈ [0, ∞)

? Error Function y(x) = ex2erfc(x), x ∈ [0, ∞)

? Mathieu Equation

y′′(x) + (a − 2 q cos 2x)y = 0

x ∈ [0, 2π)0 2 4 6 8 10 12

−10

−5

0

5

10

15

20

25

30

q

a

? Sine-Gordon

utt = uxx − sin u,

x ∈ (−∞, ∞)

? Orr-Sommerfeld R−1 (y′′′′ − 2y′′ + y)−2 i y−i (1−x2) (y′′ − y) = c (y − y′′)

Page 13: Numerical Solution of Schrodinger’s Equation¨ Spectral

3. APPLICATION

Schrodinger’s equation on −∞ < x < ∞−y′′(x) + p(x) y(x) = λy(x)

Approximate by−D2y + diag

(p(xk)

)y = λy

Numerically compute the eigenvalues of

A = −D2 + diag(p(xk)

)

For D2, we use Hermite differentiation matrix. I.e., D2y provides exactsecond derivatives whenever y is sampled from a function of the form

y(x) = e−x2/2 ×(

Polyn. degree < N)

Page 14: Numerical Solution of Schrodinger’s Equation¨ Spectral

Quadratic oscillator

−y′′(x) + x2 y(x) = λy(x)

Eigenvalues/functions k = 0, 1, 2, . . . ,

λk = 2k + 1, yk(x) = e−x2/2Hk(x)

Expect numerical method based on N×N Hermite differentiation matrixto produce exact eigenvalues/functions, for k = 0, . . . , N − 1.

[x, DM] = herdif(N, 2, b)D2 = DM(:,:,2)A = -D2+diag(x.ˆ2)

lambda = sort(eig(A))

Page 15: Numerical Solution of Schrodinger’s Equation¨ Spectral

Test quartic oscillator against WKB formula (Bender & Orszag, p. 523)

λk ∼

[3√

π Γ(

34

)(k + 1

2

)

Γ(

14

)]4/3

, k → ∞.

Numerical WKB

1.0604 0.86713.7997 3.75197.4557 7.414011.6447 11.611516.2618 16.233621.2384 21.213726.5285 26.506332.0986 32.078537.9230 37.904543.9812 43.9639

Page 16: Numerical Solution of Schrodinger’s Equation¨ Spectral

Now change problem to

−y′′(x) +(x4 + iax

)y(x) = λy(x)

CM Bender, M Berry, et. al.,“Complex WKB Analysis ofenergy-level degeneracies ofnon-Hermitian Hamiltonians”,J. Phys. A: Math. Gen. Vol.34 (2001) L31-L36.

Page 17: Numerical Solution of Schrodinger’s Equation¨ Spectral

With D2 defined as above the complete code is

figure(1); axis([0 15 0 25]); hold on;

for a = linspace(0,15,300);A = -D2+diag(x.ˆ4+i*a*x);

lambda = sort(eig(A));lambda = lambda(1:6);

ell = find(abs(imag(lambda)) < sqrt(eps));lambda = lambda(ell);plot(a*ones(size(lambda)),lambda,’*’,’MarkerSize’,4);drawnowend;

Page 18: Numerical Solution of Schrodinger’s Equation¨ Spectral

0 5 10 150

5

10

15

20

25

a

λ 1 ,...,λ

6

Page 19: Numerical Solution of Schrodinger’s Equation¨ Spectral

DMSUITE combines well with EigTool (Trefethen, Wright)

For example, compute pseudospectrum of matrix

A = −D2 + diag(x4

k + i a xk

), a = 3.169

Plots show values of F(z) = ‖(A − zI)−1‖

0 5 10 15 20 25 30−10

−8

−6

−4

−2

0

2

4

6

8

10

−50

510

1520

2530

−10−5

05

10−1

−0.5

0

0.5

1

1.5

2

RealImag

log 10

(res

olve

nt n

orm

)