monte-carlo sampling techniques for statistical...

Post on 24-Feb-2020

7 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ORNL is managed by UT-Battelle, LLC for the US Department of Energy

Monte-Carlo Sampling Techniques for Statistical Physics

Markus EisenbachYing Wai LiScientific Computing GroupNational Center for Computational SciencesOak Ridge National Laboratory

Alfred C. FarrisUniversity of GeorgiaAthens, GA

22 Open slide master to edit

DOE’s Office of Science Computation User Facilities

• DOE is leader in open High-Performance Computing

• Provide the world’s most powerful computational tools for open science

• Access is free to researchers who publish

• Boost US competitiveness

• Attract the best and brightest researchers

NERSC Edison is 2.57 PF

OLCFTitan is 27 PF

ALCFMira is 10 PF

OAK RIDGE NATIONAL LABORATORYU. S. DEPARTMENT OF ENERGY

Oak Ridge National LaboratoryTennessee

3

Oak Ridge Leadership Computing Facility

Spallation Neutron Source

44 Open slide master to edit

Outline

• Overview of Statistical Mechanics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• (2d Heisenberg Model)

55 Open slide master to edit

Outline

• Overview of Statistical Mechanics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• (2d Heisenberg Model)

66 Open slide master to edit

Statistical Mechanics

Picture: http://upload.wikimedia.org/wikipedia/en/6/63/Zentralfriedhof_Vienna_-_Boltzmann.JPG

77 Open slide master to edit

Statistical Mechanics

• Describes the behavior of a large ensemble of constituent particles that gives rise to macroscopic observables: thermodynamics.

• A physical system is described by phase space coordinates that describe the state of each constituents of the particles, e.g. position, momentum, atomic species, magnetic moment, etc.

• The dimension of 𝛺𝛺 is huge: for a system describing the position and velocities of N atoms 𝛺𝛺=ℝ6N.

• The behavior of the system is determined by its Hamiltonian , or energy, that maps 𝛺𝛺⟶ℝ

88 Open slide master to edit

Statistical Mechanics

• At finite, non zero, temperature T (or inverse temperature 𝛽𝛽=1/kBT) a system is in state 𝜉𝜉 with a probability that is given by the Boltzmann distribution:

• Observables of a system are measured as the averages over this probability density:

• The evaluation of this integral is the original application of the Metropolis algorithm

99 Open slide master to edit

Statistical Ensembles• Micro-Canonical Ensemble (NVE)

– Closed isolated system with constant energy– Entropy:– Temperature:

• Canonical Ensemble (NVT)– Closed system in contact with a temperature

bath– Energy distributed according to Boltzmann

distribution: – Partition function:– Free Energy: – Entropy:

1010 Open slide master to edit

Thermodynamic Observables

• Thermodynamic observables are related to the partition function Z and free energy F

• If we can calculate Z(β) thermodynamic observables can be calculated as logarithmic derivatives.

1111 Open slide master to edit

Outline

• Overview of Statistical Mechanics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• (2d Heisenberg Model)

1212 Open slide master to edit

Wang-Landau Method F. Wang and Landau, PRL 86, 2050 (2001)

• Conventional Monte Carlo methods calculate expectation values by sampling with a weight given by the Boltzmann distribution

• In the Wang-Landau Method we rewrite the partition function in terms of the density of states which is calculated by this algorithm

• To derive an algorithm to estimate g(E) we note that states are randomly generated with a probability proportional to 1/g(E) each energy interval is visited with the same frequency (flat histogram)

Wang-Landau sampling: a brief review

F. Wang and D. P. Landau, Phys. Rev. Lett. 86, 2050 (2001); Phys. Rev. E 64, 056101 (2001)

• An iterative Monte Carlo method to estimate density of states in energy, g(E)

• Determine and modify sampling weight “on-the-fly”

• Physical observables are available for all temperatures from a singlesimulationHistogram H(E), density of states g(E), modification factor f

1. Initialize: H(E) = 0, g(E) = 1, f0 = e1

2. Generate a trial configuration, accept with probability:

3. Update g(E) → g(E) * f , H(E) → H(E) + 14. Repeat steps 2-3 until the histogram is “flat”; reset H(E) = 0, fi+1 = fi

½

5. Repeat steps 2-4 until f = ffinal ~ exp(10-8)

Final density of states, g(E)

( )( ) min ,1( )

oldold new

new

g Ep E Eg E

→ =

, if accepted, otherwise

new

old

EE

E

=

1515 Open slide master to edit

Calculation of thermodynamic quantities• Note: g(E) as calculated by the algorithm

described has an unknown normalization factor

• Free Energy:

• Internal Energy

• Specific Heat

• Entropy

1616 Open slide master to edit

Outline

• Overview of Statistical Mechanics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• (2d Heisenberg Model)

1717 Open slide master to edit

• Traditionally MC sampling had been applied to model systems where the energy is fast and easy to evaluate.

• We are combining the statistical mechanics with first principles density functional theory calculations, where the energy of the system is the smallest eigenvalue of a partial differential equation with constraints that are given by the state of the system.

• Thus, H(𝜉𝜉) requires multiple CPU-hours to evaluate a single energy.

• ⇒ any reduction in the number of energy evaluations will save significant computational resources.

1818 Open slide master to edit

HP Protein model [Ying Wai Li]

Wang-Landau vs Metropolis [same CPU time]

1919 Open slide master to edit

Case study: Magnetism of iron (Fe)

• Ferromagnetic transition temperature TC = 1050K

• Bulk Fe with N atoms (hundreds) in unit cell

• Sample non-collinear magnetic moment configurations

• Compute energy with LSMS using local spin density approximation (LSDA) and frozen potential approximation

• Obtain density of states with Wang-Landau algorithm

εXC of a homogeneous, non-interacting electron gas

2020 Open slide master to edit

Case study: Magnetism of iron (Fe)

16 atoms(2×2×2 unit cells)

250 atoms(5×5×5 unit cells)

16 atoms 250 atoms

WL walkers 200 400

total cores 3,208 100,008

WL samples 23,200 590,000

CPU-core hours 12,300 4,885,720

Courtesy: M. Eisenbach

2121 Open slide master to edit

Case study: Magnetism of iron (Fe)

16 atoms(2×2×2 unit cells)

250 atoms(5×5×5 unit cells)

16 atoms 250 atoms

WL walkers 200 400

total cores 3,208 100,008

WL samples 23,200 590,000

CPU-core hours 12,300 4,885,720

2222 Open slide master to edit

First Principles Calculated Curie temperatures

exp Curie Temperature

calc Curie Temperature

Fe 1050K 980K

Fe3C 480K 425K

Tc(Fe)/Tc(Fe3C) 2.2 2.3

M.E. et al., J. Appl. Phys. 109, 07E138 (2011)

2323 Open slide master to edit

Outline

• Overview of Statistical Physics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• (2d Heisenberg Model)

2424 Open slide master to edit

Motivation

• For systems with continuous observables, the discreteness introduced by binning causes an artificial source of error for histogram methods Is it possible to avoid binning?

• Provided some physical insights from a smoothed form of the density of states of a system, can one obtain the coefficients of an expansion through computer simulations?

• Is there a systematic way to quantify how well the approximations for the density of states has progressed during the simulation, which can be used as a termination criterion?

2525 Open slide master to edit

Ansatz

• We expand the log of the density of states, i.e. the microcanonical entropy in an orthonormal basis:

• If energy samples are generated by sampling phase space and accepting states according to a guess of the density of states, i.e.

• The energy samples will be generated from a distribution that is the ratio of the guess and the true density of states

“Binless Wang-Landau sampling”

1. Assume an expansion of the density of states and the correction:

ϕi(E): a basis set The number of terms, N, and the coefficients {ci} are to be found iteratively

2. Initial guess: g0(E) = 1

3. Generate a series of k energies as data set D = {E1, E2, E3, …, Ek}, with acceptance probability:

4. At intervals, use D to find the correction ln c(E)

5. Update g(E) with correction c(E): . Discard D .

6. Repeat steps 3-5 until

, if accepted, otherwise

new

old

EE

E

=

• An iterative Monte Carlo method to estimate an expansion of the density of states, g(E)

• Determine and modify sampling weight at intervals (multicanonicalsampling)

Representing data without a histogram• Generate k energy measurements and stored as a data set:

D = {E1, E2, E3, …, Ek}, E1 < … < Ek

• Construct cumulative distribution function, CDF:

Histogram, H(E) CDF, CDF(E)

B. A. Berg and R. C. Harris, Comput. Phys. Commun. 179, 443-448 (2009)

Representing data without a histogram

• Rewrite CDF with a straight line and remainder R(E):

CDF(E) Remainder, R(E)

At convergence, a flat histogram is obtained a straight line of constant slope for the CDF

Finding correction c(E) from R(E) • R(E) is the deviation of the empirical CDF from the

uniform distribution (flat histogram)

• It provides a means of calculating the correction to g(E), i.e., the coefficients ci in ln c(E)

• Recall that:

• Finally, update ln g(E) ln g(E) + ln c(E)

ln c(E)

3030 Open slide master to edit

Approximating remainder R(E) • Expand R(E) into a series of orthonormal basis set:

• The coefficients ri are then found by:

where N is some constants dependent on choice of basis set

• Start from m = 0. Perform a statistical test to obtain the probability p that the empirical remainder comes from R(E).

• If not, m m+1. Repeat until p reaches a predefined value, normally, 0.5.

3131 Open slide master to edit

Outline

• Overview of Statistical Physics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• (2d Heisenberg Model)

Test case: numerical integration by WL• A “model” with continuous “phase space”

• A stringent test with exact answer available

Y. W. Li, T. Wüst, D. P. Landau and H. Q. Lin, Comput. Phys. Commun. 177, 524 (2007)

Test case: numerical integration by WL• A “model” with continuous “phase space”

• A stringent test with exact answer available

Y. W. Li, T. Wüst, D. P. Landau and H. Q. Lin, Comput. Phys. Commun. 177, 524 (2007)

Test case: numerical integration• Simple one-dimensional integral

• With known g(y):

• We expand ln g and ln c in a Fourier seriesDensity of states at the 120th iteration, obtained

using 1000 data points in a data set (black curve), a total of 1.2 x105 MC steps are used. The final g(y) obtained using Wang-Landau

sampling (red curve) requires 1.1 x 106 MC steps to complete. The DOS obtained from our

algorithm falls within the statistical noise of the Wang-Landau DOS.

Integration for

• D = {E1, E2, E3, …, Ek}, k = 500

• Basis set to fit the remainder, : Fourier sine seriesBasis set for ln g(E) and ln c(E), : Fourier cosine series

exact = 5.3333…

(error bars are obtained from 5 independent runs)

Average # of terms = 16.6

• D = {E1, E2, E3, …, Ek}, k = 1000

• Basis set to fit the remainder, : Fourier sine seriesBasis set for ln g(E) and ln c(E), : Fourier cosine series

exact = 5.3333…

(error bars are obtained from 5 independent runs)

Average # of terms = 28.5

Integration for

• D = {E1, E2, E3, …, Ek}, k = 1000

• Update of and using a random permutation at each iteration i>1

• Update using

exact = 5.3333…

(error bars are obtained from 5 independent runs)

Integration for

3838 Open slide master to edit

Outline

• Overview of Statistical Physics

• Classical Monte-Carlo and Wang-Landau– Combined with expensive Hamiltonians, e.g. DFT

• “Histogram-free” Multicanonical Monte-Carlo (FLE)

• 1d Integration example

• Binned version

• 2d Heisenberg Model

4040 Open slide master to edit

2d Heisenberg Model

• An important simple model to investigate for magnetic systems is the Heisenberg model:

• Here: the magnetic moments are arranged on a 2d square lattice.

• Simulations were performed for 4x4 systems with periodic boundary conditions

4141 Open slide master to edit

2d Heisenberg Model

Results converge very slowly due to global nature of the sin/cos basis set.Corrections in localized regions of the dos will influence and potentially degrade regions that are already well converged or that were not sufficiently covered by the sampling process in a given iteration

4242 Open slide master to edit

2d Heisenberg model, binned version• Instead of using sin/cos representation of ln g and ln c,

represent them as piecewise constant functions between fixed energy grid point. (We are back to the bins we wanted to avoid originally. )

Bin width 0.1

• Why is the scheme useful?– greatly reduces the number of energy evaluations

from WL by a facto of 10-100(considerable speedup for expensive models, e.g. DFT)

– provides an expansion for the density of states

Observations and follow-up

• Accuracy depends on basis functions– … but a good choice is not trivial!– require human insights / lots of experiments to select

a suitable set of basis functions (work in progress)

• First iteration dominantly determines the quality of the results– need to refine update scheme to improve the

“healing power” of the later iterations (work in progress)

4444 Open slide master to edit

Acknowledgements

• Laboratory-Directed Research and Development (LDRD) Oak Ridge National Laboratory

• Oak Ridge Leadership Computing Facility (OLCF), Oak Ridge National Laboratory

• Ying Wai Li, Markus Eisenbach, Proceedings of the Platform for Advanced Scientific Computing Conference (PASC' 17), 10 (2017). https://doi.org/10.1145/3093172.3093235

• Alfred C. Farris, Ying Wai Li, Markus Eisenbach, Computer Physics Communications (in press).

top related