NATIONAL UNIVERSITY OF SINGAPORE PC5215 NUMERICAL RECIPES WITH APPLICATIONS. (Semester I: AY ) Time Allowed: 2 Hours

Similar documents
NATIONAL UNIVERSITY OF SINGAPORE PC5215 NUMERICAL RECIPES WITH APPLICATIONS. (Semester I: AY ) Time Allowed: 2 Hours

Introduction CSE 541

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

CHAPTER 11. A Revision. 1. The Computers and Numbers therein

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018

Preliminary Examination, Numerical Analysis, August 2016

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

Analytical Mechanics for Relativity and Quantum Mechanics

Chapter 1 Error Analysis

Section 6.6 Gaussian Quadrature

In these chapter 2A notes write vectors in boldface to reduce the ambiguity of the notation.

Physics 115/242 Romberg Integration

Numerical Analysis for Statisticians

Random Walks A&T and F&S 3.1.2

Second quantization: where quantization and particles come from?

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Do not turn over until you are told to do so by the Invigilator.

COURSE Numerical integration of functions

ASSIGNMENT BOOKLET. Numerical Analysis (MTE-10) (Valid from 1 st July, 2011 to 31 st March, 2012)

Hamiltonian flow in phase space and Liouville s theorem (Lecture 5)

AS and A level Further mathematics contents lists

INTRODUCTION TO COMPUTATIONAL MATHEMATICS

8.3 Numerical Quadrature, Continued

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

Midterm for Introduction to Numerical Analysis I, AMSC/CMSC 466, on 10/29/2015

Math 216 First Midterm 18 October, 2018

1 Solutions to selected problems

Preface. Figures Figures appearing in the text were prepared using MATLAB R. For product information, please contact:

Math 411 Preliminaries

A Minimal Uncertainty Product for One Dimensional Semiclassical Wave Packets

One-dimensional harmonic oscillator. -motivation. -equation, energy levels. -eigenfunctions, Hermite polynomials. -classical analogy

MATHEMATICAL OBJECTS in

Quantum Mechanics-I Prof. Dr. S. Lakshmi Bala Department of Physics Indian Institute of Technology, Madras. Lecture - 21 Square-Integrable Functions

Elements of Floating-point Arithmetic

Neural Network Training

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

Langevin Methods. Burkhard Dünweg Max Planck Institute for Polymer Research Ackermannweg 10 D Mainz Germany

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

5. Hand in the entire exam booklet and your computer score sheet.

Notes for Chapter 1 of. Scientific Computing with Case Studies

1. Matrix multiplication and Pauli Matrices: Pauli matrices are the 2 2 matrices. 1 0 i 0. 0 i

A NOTE ON SUMS OF INDEPENDENT RANDOM MATRICES AFTER AHLSWEDE-WINTER

2 Canonical quantization

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor

A Brief Introduction to Numerical Methods for Differential Equations

Vector Spaces. Vector space, ν, over the field of complex numbers, C, is a set of elements a, b,..., satisfying the following axioms.

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 06

Final Exam, Machine Learning, Spring 2009

AIMS Exercise Set # 1

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460

Basic Theory of Linear Differential Equations

Midterm Review. Igor Yanovsky (Math 151A TA)

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract

Functions of Several Variables

nonlinear simultaneous equations of type (1)

NATIONAL BOARD FOR HIGHER MATHEMATICS. Research Scholarships Screening Test. Saturday, February 2, Time Allowed: Two Hours Maximum Marks: 40

NATIONAL UNIVERSITY OF SINGAPORE DEPARTMENT OF MATHEMATICS SEMESTER 2 EXAMINATION, AY 2010/2011. Linear Algebra II. May 2011 Time allowed :

Stat 451 Lecture Notes Numerical Integration

Stat 206: Linear algebra

CS 257: Numerical Methods

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

NUMERICAL ANALYSIS PROBLEMS

22.4. Numerical Determination of Eigenvalues and Eigenvectors. Introduction. Prerequisites. Learning Outcomes

NATIONAL UNIVERSITY OF SINGAPORE MA1101R

8 Numerical methods for unconstrained problems

Data Structures and Algorithms

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Why is Deep Learning so effective?

A =, where d n w = dw

Numerical Methods - Preliminaries

MP463 QUANTUM MECHANICS

Representations of Sp(6,R) and SU(3) carried by homogeneous polynomials

Elements of Floating-point Arithmetic

Electric and Magnetic Forces in Lagrangian and Hamiltonian Formalism

Chapter 11. Taylor Series. Josef Leydold Mathematical Methods WS 2018/19 11 Taylor Series 1 / 27

HW3 - Due 02/06. Each answer must be mathematically justified. Don t forget your name. 1 2, A = 2 2

Newton s Method and Localization

Numerical Algorithms. IE 496 Lecture 20

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Maxwell s equations. based on S-54. electric field charge density. current density

Gauss-Jordan elimination ( used in the videos below) stops when the augmented coefficient

Virtual University of Pakistan

Support Vector Machine (SVM) and Kernel Methods

Total Angular Momentum for Hydrogen

Eigenvalues and Eigenvectors

Solutions to Dynamical Systems 2010 exam. Each question is worth 25 marks.

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

Mathematics for Engineers. Numerical mathematics

df(x) = h(x) dx Chemistry 4531 Mathematical Preliminaries Spring 2009 I. A Primer on Differential Equations Order of differential equation

Vector Fields. It is standard to define F µν = µ ϕ ν ν ϕ µ, so that the action may be written compactly as

Applied Numerical Analysis Quiz #2

Quantization of scalar fields

Homework and Computer Problems for Math*2130 (W17).

G : Statistical Mechanics

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Test Code : CSB (Short Answer Type) Junior Research Fellowship (JRF) in Computer Science

Pattern Recognition and Machine Learning

Monte Carlo and cold gases. Lode Pollet.

SUPPLEMENTARY INFORMATION

Examination paper for TMA4145 Linear Methods

Transcription:

NATIONAL UNIVERSITY OF SINGAPORE PC5215 NUMERICAL RECIPES WITH APPLICATIONS (Semester I: AY 2014-15) Time Allowed: 2 Hours INSTRUCTIONS TO CANDIDATES 1. Please write your student number only. 2. This examination paper contains FIVE questions and comprises THREE printed pages. 3. Answer ALL the questions; questions carry equal marks. 4. Answers to the questions are to be written in the answer books. 5. Please start each question on a new page. 6. This is a CLOSED BOOK assessment. 7. Non-programmable calculators are allowed. 1

1. Answer briefly the following questions and concepts. a. What is the time computational complexity and space (memory) computational complexity of the LU decomposition algorithm of Crout? b. Give the mathematical definition of the norm x of a vector in a linear space. c. What is a heap as used in data sorting? d. Explain the main concept of conjugate gradient method and answer why the minimum can be located in a finite number of N steps. What is the meaning of N? a. The time computational complexity of an LU decomposition of a square matrix is O(N 3 ), while space (memory) complexity is O(N 2 ), where N is the dimension of the square matrix. Some students forget to say what is N. b. The norm x of a vector x in a linear space is a real number that must satisfy: positivity x 0, equal sign occurs only for zero vector x=0; scaling αx = α x, and triangle inequality x+y x + y. Many students only give specific examples, (e.g., Euclidean 2-norm), but we need a general definition. c. Heap is a binary tree arranged such that a parent node is not less than the two children. This forms a partial order. d. The key idea in the conjugate gradient method is to take the search direction ui such that u T i A uj = 0 if i j, called A-orthogonal. In this way the search stops in N steps where N is the dimensionality of the matrix A, and the function to minimize is of the quadratic form f=(1/2) x T A x b T x +c. Many students give the algorithm without mentioning the important point of A-orthogonality. 2. Consider an IEEE-like floating point representation with a 16-bit word size. The highest bit denotes the sign (0 bit for positive number and 1 bit for negative number). The next 5 bits are used for a biased exponent e. All values e = 0, 1, 2,, 31 will be used to represent a floating point number, without special types (such as NaN, or ). The rest of 10 bits will be used for the fractional part. a. What bias one should use so that both large and small number in magnitude as compared to 1 can be represented similar to the standard IEEE 754? b. What is the machine epsilon of this representation? c. What are the largest and smallest values in absolute magnitude in this representation? d. What is the number of significant figures in decimal for a typical 16-bit floatingpoint number? a. Since the 5 bits for the exponent takes values from 0 to 31, we take bias = 15, half way from 0 to 31. b. Machine epsilon = 2-10 = 1/1024 0.001. 2

c. Largest value 1.11 1 216 =(2-2 -10 )2 16 = 131008, smallest value 2-15 3.0510-5. d. Based on 0.001, the number of significant figures are 3 in decimal. If bias is choosing to be 16, the values change slightly accordingly. 3. In a closed Newton-Cotes integration formula of N points, polynomials of degrees N 1 is integrated exactly without error. a. Determine the coefficients αi in a three-point integration formula 2h f(x)dx = α 0 f 0 + α 1 f 1 + α 2 f 2 + O(h? ), where f 0 i = f(ih). b. By coincidence or otherwise, show that polynomials of degree 3 also integrate exactly by the above formula. c. Based on the derivation in part a and b, deduce the order of error of the integration formula. a. We set the function f(x) to be 1, x, and x 2, evaluating the left and right side of the equation, obtain, 2h = α0 + α1 + α2; (2h) 2 /2 = α0 0 + α1h + α22h; and (2h) 3 /3 = α0 0 + α1h 2 + α2(2h) 2. Solving the linear equations, one finds the Simpson s rule, α0 = h/3, α1 = 4h/3, and α2 = h/3. b. Set f(x) = x 3, we find left-hand side (4h 4 ) equals right-hand side. Since the formula is linear, this is sufficient to illustrate that it holds for general polynomials of degree 3. c. Since it is accurate to O(h 4 ) by part b, the error has to be of order h 5. Some students try to do Gaussian quadrature and determine the orthogonal polynomials, which is irrelevant here for this problem. Others try to do Taylor expansions. 4. Consider a three-spin system with the energy H = J(σ 1 σ 2 + σ 2 σ 3 + σ 3 σ 1 + σ 1 σ 2 σ 3 ), where J > 0, σ i = ±1, i = 1,2,3. Assume a single-spin flip dynamics, i.e., a site i is chosen at random with equal probability. a. Determine the transition matrix W at temperature T. b. What is the left eigenvector p with eigenvalue λ = 1, i.e., p = pw? c. Outline the pseudo-code to perform Metropolis Monte Carlo calculation of the total heat capacity C, using the Markov chain specified exactly as in part a by W. a. The energies of each of the states are label Spin configuration Energy E(i) 1 +++ 4J 2 ++ 2J 3 ++ 2J 4 ++ 2J 5 + 0 3

6 + 0 7 + 0 8 2J Using the order given above, the transition matrix W is z z z 1 z 0 0 0 0 3 3 3 1 1 1 0 0 0 0 0 3 3 3 1 1 1 0 0 0 0 0 3 3 3 1 1 1 0 0 0 0 0 3 3 3 y y 2 2y 1 0 0 0 0 3 3 3 3 y y 2 2y 1 0 0 0 0 3 3 3 3 y y 2 2y 1 0 0 0 0 3 3 3 3 y y y 0 0 0 0 1 y 3 3 3 Where z = y 3, y = exp(-2j/(kbt)). b. By construction, the equilibrium distribution is canonical, P(i) exp(-e(i)/(kbt)), so P =(1/Z) (exp(4j), exp(-2j), exp(-2j), exp(-2j), 1, 1, 1, exp(2j)), partition function Z = exp(4j) + 3 exp(-2j) + 3 + exp(2j). = 1/(kBT). There is no need to solve the linear equation, P = PW, explicitly. c. E=0, C=0; Do m = 1 to 10 6 { i = floor( 1 + 31); compute E = E(new) E(old); if( 2 < exp(-e)) { i = - i; } E = E + E(i); C = C + E(i) 2 ; }; C = (1/10 6 ) { C (E/10 6 ) 2 }/(kb T 2 ) Where E(new) means the energy with spin i flipped. E(i) is the energy recomputed after the Monte Carlo move. Some students forgot the formula for heat capacity, which is in our lab 3. 4

5. We prove the Trotter-Suzuki formula and use it to derive a symplectic integration scheme for a Hamiltonian system. a. The standard Trotter-Suzuki formula takes the form e ε(a +B ) = e εa e εb + O(ε 2 ) where A and B are non-commuting operators in some linear space, and ε is small. Prove this formula and show explicitly that the error is second order in the small quantity ε. b. Consider a mechanical system with the Hamiltonian H(p, q) of a one degree of freedom with the coordinate q and conjugate momentum p. Then the equation of motion is F = {H, F} = L HF, where the curly bracket is the Poisson bracket, {H, F} = H F F H, q p q p L H is the Liouvillian operator defined above by the Poisson bracket. Show that we can write the time-dependent solution of an arbitrary function of q and p formally in the form F(t) = e tl HF(0). c. Derive a symplectic algorithm for H = p2 + V(q), using the Trotter-Suzuki 2m formula derived in part a, identifying the operator A and B with the kinetic energy term, p2, and potential energy term V(q), respectively, in the Liouvillian. 2m a. Taylor expand both sides, multiply through (taken care of noncommuting nature of the operator), we find e ε(a +B ) e εa e εb = ε2 (B A A B ) +. 2 b. Take time derivative to the solution, F(t) = e tl HF(0), we find d F(t) = dt L He tl HF(0) = L HF(t). Some students try to solve the differential equation as if L H is a number, which is wrong. L H is operator acting on functions. c. Using the formal solution and Trotter-Suzuki formula, we have F(t) = e tl HF(0) e tl Te tl V F(0). Take F to be the vector (p,q), we obtain, p ˆ 1 p1/ 2 p1/ 2 ˆ T tl p tl V 0 e, e q1 q1/ 2 q1/ 2 q0 The explicit form can be found by Taylor expanding the exponentials, and use the definition of double hats and Poisson brackets, we find q q, p p t f 1/ 2 0 1/ 2 0 0 q q t p / m, p p 1 1/ 2 1/ 2 1 1/ 2 --- the end --- [WJS] 5