PHY8X08
PHY8X08
Please note:
• Hint: The marks for each question scale roughly with the effort required to answer. Avoid
overly long answers.
1/ 3
1. Answer the following short questions. [XX]
(a) Define underflow and overflow in the context of number representation on the computer.
Give an example when these can occur.
Devise an algorithm (list of steps or flowchart) to test for the under- and overflow of a
computer. Present it in such a way, that it can be programmed unambiguously. (4)
(b) Explain the following python snippet and its output. (3)
>>> xt = 1 . e20 ; yt = −1. e20 ; z t = 1 .
>>> ( xt + yt ) + z t
1.0
>>> xt + ( yt + z t )
0.0
(c) Explain the concept of compensated summation. Give an algorithm on how use it. (3)
(d) Describe the idea of finite representation of a function f (x) on a regular grid in an
interval [a, b]. How can we use finite differences to compute derivatives, and why would
we use this approach? (3)
(e) How is the particle number N (t) modelled for decay processes in the limit of small and
large N ? Connect the two expressions mathematically. (3)
Rb Rb
(f) Explain the variance reduction method, defined as a f (x)dx = a [f (x) − g(x)]dx −
Rb
a g(x)dx. What is g(x)? (2)
2. Assume that numbers xc stored on a computer are related to the exact numbers x by xc '
x(1 + εx ). [8]
4. The attached programme numerical derivatives.py produces the figure below. [10]
(a) Briefly describe the functionality of the code, including which quantities are plotted.
Use the line numbers printed on the left to refer to specific lines of code. (4)
(b) Give a detailed analysis and interpretation of the figure, including theoretical justifica-
tions of why we see what we see. (6)
2/ 3
5. Derive the condition number for a matrix problem A~x = ~b under the assumption that a
perturbed matrix A + ∆A will yield a perturbed solution vector ~x + ∆~x. [6]
Rx
6. Derive the approximation error of the mid-point version of rectangle rule xii+1 f (x)dx ≈
hf (xi + h2 ). Give expressions for both a single panel and the whole interval [a, b]. [6]
7. The Variational Monte-Carlo method can be used to solve high-dimensional eigenvalue prob-
lems, like an interacting n electron system with the Hamiltonian [11]
n−1 n−1 n−1
~2 X 2 1 X 2 2 2 2 2 2
X
exp −(~rj − ~rk )2 .
Ĥ = − ∇j + m ωx [(~rj )x ] + ωy [(~rj )y ] + ωz [(~rj )z ] + g
2m 2
j=0 j=0 j,k=0
j<k
(a) Shortly describe how to use random numbers to evaluate the integral of a function. (2)
(b) Make use of arguments, equations, and the python codes in eloc.py and vmc.py to ex-
plain how Variational Monto Carlo works and how we can use it to find an approximation
for the ground-state solution of Ĥ. 6
(c) The below figures show the results of vmc.py for Ncalc = 1000 on the left and Ncalc =
10000 on the right. Discuss the results. [3]
—END OF PAPER—
3/ 3