Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 20 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
20
Dung lượng
269 KB
Nội dung
11.1. PHASE TRANSITIONS IN MAGNETIC SYSTEMS 189 where the vector contains the spin value . For the specific state , we have chosen all spins up. The energy of this configuration becomes then The other configurations give and 2. We can also choose so-called periodic boundary conditions. This means that if , we set the spin number to . In this case the energy for the one-dimensional lattice reads (11.7) and we obtain the following expression for the two-spin case (11.8) In this case the energy for is different, we obtain namely The other cases do also differ and we have and If we choose to use periodic boundary conditions we can code the above expression as jm=N; for ( j =1 ; j <=N ; j ++) { energy += spin [ j ] spin [ jm ] ; jm = j ; } 190 CHAPTER 11. MONTE CARLO METHODS IN STATISTICAL PHYSICS Table 11.1: Energy and magnetization for the one-dimensional Ising model with spins with free ends (FE) and periodic boundary conditions (PBC). State Energy (FE) Energy (PBC) Magnetization 2 0 0 -2 Table 11.2: Degeneracy, energy and magnetization for the one-dimensional Ising model with spins with free ends (FE) and periodic boundary conditions (PBC). Number spins up Degeneracy Energy (FE) Energy (PBC) Magnetization 2 1 2 1 2 0 0 1 -2 The magnetization is however the same, defined as (11.9) where we sum over all spins for a given configuration . Table 11.1 lists the energy and magnetization for both free ends and periodic boundary con- ditions. We can reorganize Table 11.1 according to the number of spins pointing up, as shown in Table 11.2. It is worth noting that for small dimensions of the lattice, the energy differs depending on whether we use periodic boundary conditions or fri ends. This means also that the partition functions will be different, as discussed below. In the thermodynamic limit however, , the final results do not depend on the kind of boundary conditions we choose. For a one-dimensional lattice with periodic boundary conditions, each spin sees two neigh- bors. For a two-dimensional lattice each spin sees four neighboring spins. How many neighbors does a spin see in three dimensions? In a similar way, we could enumerate the number of states for a two-dimensional system consisting of two spins, i.e., a Ising model on a square lattice with periodic boundary conditions. In this case we have a total of states. Some examples of configurations with their respective energies are listed here 11.1. PHASE TRANSITIONS IN MAGNETIC SYSTEMS 191 In the Table 11.3 we group these configurations according to their total energy and magneti- zation. Table 11.3: Energy and magnetization for the two-dimensional Ising model with spins with periodic boundary conditions. Number spins up Degeneracy Energy Magnetization 4 1 4 3 4 2 2 4 0 2 2 0 1 4 -2 0 1 -4 Exercise 11.1 Convince yourself that the values listed in Table 11.3 are correct. For a system described by the canonical ensemble, the energy is an expectation value since we allow energy to be exchanged with the surroundings (a heat bath with temperature ). This expectation value, the mean energy, can be calculated using the probability distribution as (11.10) with a corresponding variance defined as (11.11) If we divide the latter quantity with we obtain the specific heat at constant volume (11.12) Using the same prescription, we can also evaluate the mean magnetization through (11.13) and the corresponding variance (11.14) 192 CHAPTER 11. MONTE CARLO METHODS IN STATISTICAL PHYSICS This quantity defines also the susceptibility (11.15) It is also possible to show that the partition function for the one-dimensional case for spins with free ends is (11.16) If we use periodic boundary conditions it becomes (11.17) In the limit the two results agree. We can then calculate the mean energy with fri ends from the above formula or using (11.18) If we take our simple system with just two spins in one-dimension, we see immediately that the above expression for the partition function is correct. Using the definition of the partition function we have (11.19) If we take the limit ( ) and set , we obtain (11.20) which is the energy where all spins point in the same direction. At low , the system tends towards a state with the highest possible degree of order. The specific heat in one-dimension with free ends is (11.21) Exercise 11.2 Calculate the exact partition function for a system of three spins with the one- dimensional Ising model using both free ends and periodic boundary conditions. For our two-dimensional lattice we obtain the following partition function (11.22) and mean energy (11.23) 11.1. PHASE TRANSITIONS IN MAGNETIC SYSTEMS 193 The analytical expression for the Ising model in two dimensions was obtained in 1944 by the Norwegian chemist Lars Onsager (Nobel prize in chemistry). The exact partition function for spins is given by (11.24) with (11.25) and (11.26) Exercise 11.3 Calculate the heat capacity and the mean magnetization per spin for the ising model. 11.1.2 The Metropolis algorithm The algorithm of choice for solving the Ising model is the approach proposed by Metropolis et al. in 1953. As discussed in chapter ??, new configurations are generated from a previous one using a transition probability which depends on the energy difference between the initial and final states. In our case we have as the Monte Carlo sampling function the probability for finding the system in a state given by with energy , and is a normalization constant which defines the partition function in the canonical ensemble. As discussed above is difficult to compute since we need all states. In a calculation of the Ising model in two di- mensions, the number of configurations is given by with the number of spins for a lattice of length . Fortunately, the Metropolis algorithm considers only ratios between probabilities and we do not need to compute the partition function at all. The algorithm goes as follows 1. Establish an initial state with energy by positioning yourself at a random position in the lattice 2. Change the initial configuration by flipping e.g., one spin only. Compute the energy of this trial state . 3. Calculate . The number of values is limited to five for the Ising model in two dimensions, see the discussion below. 194 CHAPTER 11. MONTE CARLO METHODS IN STATISTICAL PHYSICS 4. If we accept the new configuration, meaning that the energy is lowered and we are hopefully moving towards the energy minimum at a given temperature. Go to step 7. 5. If , calculate . 6. Compare with a random number . If then accept the new configuration, else we keep the old configuration. 7. The next step is to update various expectations values. 8. The steps (2)-(7) are then repeated in order to obtain a sufficently good representation of states. 9. Each time you sweep through the lattice, i.e., when you have summed over all spins, con- stitutes what is called a Monte Carlo cyclus. You could think of one such cyclus as a measurement. At the end, you should divide the various expectation values with the total number of cycles. You can choose whether you wish to divide by the number of spins or not. If you divide with the number of spins as well, your result for e.g., the energy is now the energy per spin. The implementation of this algorithm is given in the next section. In the calculation of the energy difference from one spin configuration to the other, we will limit the change to the flipping of one spin only. For the Ising model in two dimensions it means that there will only be a limited set of values for . Actually, there are only five possible values. To see this, select first a random spin position and assume that this spin and its nearest neighbors are all pointing up. The energy for this configuration is . Now we flip this spin as shown below. The energy of the new configuration is , yielding . The four other possibilities are as follows with , 11.2. PROGRAM EXAMPLE 195 with , with and finally with . This means in turn that we could construct an array which contains all values of before doing the Metropolis sampling. Else, we would have to evaluate the exponential at each Monte Carlo sampling. 11.2 Program example We list here an example of a C/C++-program which computes various thermodynamical prop- erties of the Ising model in two dimensions You should especially pay attention to the function Metropolis which implements the algorithm described in the previous subsection and the func- tion which calculates the energy difference between the previous state and the trial state by flipping one spin. The program is set up with dynamic memory allocation for the matrix which contains the spin values at a position . One could alternatively have used a fixed size for the matrices to be used. But then one would need to recompile the program when larger systems are considered. 11.2.1 Program for the two-dimensional Ising Model programs/chap11/program1.cpp / Program to solve the two dimensional I sin g model The coupling co ns tant J = 1 Boltzmann ’ s c onsta nt = 1 , tem perature has thus dimension energy Metropolis sampling i s used . Pe riodi c boundary con dit ion s . / # include < iostream > # include < fstream > # include < iomanip > # include using namespace st d ; 196 CHAPTER 11. MONTE CARLO METHODS IN STATISTICAL PHYSICS ofstream o f i l e ; / / i n l i n e f unc t i o n for per iod ic boundary c on dit ion s i n line in t p e r io d i c ( in t i , int li mi t , i nt add ) { return ( i + li m i t +add ) % ( l i m i t ) ; } / / Function to read in data from screen void re ad_in put ( int & , in t & , double & , double & , double&) ; / / Function to i n i t i a l i s e energy and m ag netizat ion void i n i t i a l i z e ( int , double , i nt , double & , double&) ; / / The m et ro polis algorithm void Metropolis ( int , long & , i nt , double & , double & , double ) ; / / p r in t s to f i l e the r e s u l t s of the c a l c u l a t i o n s void o utput ( int , int , double , double ) ; in t main ( i nt argc , char argv [ ] ) { char outfil en am e ; long idum ; in t spin_matrix , n_spins , mcs ; double w[ 1 7 ] , average [ 5 ] , i niti a l_te m p , final_temp , E , M, temp_step ; / / Read in o utput f i l e , abort i f ther e are too few command l i n e arguments i f ( argc <= 1 ) { cout < < < < argv [0] < < < < endl ; e x i t (1 ) ; } e l se { ou tf ilena me =argv [ 1 ]; } o f i l e . open ( outfi le name ) ; / / Read in i n i t i a l v alues such as s i z e of l a t t i c e , temp and cyc les re ad _inpu t ( n_spins , mcs , i n itia l _ tem p , final_temp , temp_step ) ; sp in _m atrix = ( in t ) m atrix ( n_spins , n_spins , s i zeof ( int ) ) ; idum = 1; / / random s t a r t in g po in t for ( double temp = ini t i a l _ t e m p ; temp <= f in al_te mp ; temp+= temp_step ) { / / i n i t i a l i s e energy and magne ti zatio n E = M = 0 . ; / / setup array f or p o ssib l e energy changes for ( in t de = 8; de < = 8; de++) w[ de ] = 0 ; for ( in t de = 8; de < = 8; de+=4) w[ de + 8] = exp( de / temp ) ; 11.2. PROGRAM EXAMPLE 197 / / i n i t i a l i s e array fo r e xp e ct a ti o n valu es for ( in t i = 0 ; i < 5 ; i ++) average [ i ] = 0 . ; i n i t i a l i z e ( n_spins , temp , spin_matrix , E , M) ; / / s ta r t Monte Carlo computation for ( in t cy cl es = 1 ; cycle s <= mcs ; cy cl es ++){ Metropolis ( n_spins , idum , spin_m atri x , E , M, w) ; / / update e xp ect ati on v alues average [ 0 ] + = E ; average [ 1 ] + = E E ; average [ 2 ] + = M; average [ 3 ] + = M M; average [ 4 ] + = fabs (M) ; } / / p r i n t r e s u l t s ou tp ut ( n_spins , mcs , temp , average ) ; } f re e_m a tr i x (( void ) s pi n_matri x ) ; / / f r e e memory o f i l e . close ( ) ; / / clos e o ut put f i l e return 0 ; } / / read in i nput data void re ad_in put ( int & n_spins , i nt & mcs , double & in i t i a l_ t e m p , double & final_temp , double& temp_step ) { cout < < ; cin > > mcs ; cout < < ; cin > > n_spi ns ; cout < < ; cin > > i ni ti al _ t em p ; cout < < ; cin > > fi nal_tem p ; cout < < ; cin > > temp_step ; } / / end of f unc t i o n read_input / / f unc t i o n to i n i t i a l i s e energy , spin matrix and m agnet iz ation void i n i t i a l i z e ( in t n_spins , double temp , in t spin_m atri x , double & E , double & M) { / / setup spin mat rix and i n t i a l m agnetiz ation for ( in t y =0 ; y < n_spins ; y++) { for ( in t x = 0 ; x < n_spins ; x++){ sp in _m atrix [y ][ x ] = 1 ; / / spi n o r i en t a t i on f or the ground s t a t e M + = ( double ) s pin_m at ri x [ y ] [ x ] ; } } 198 CHAPTER 11. MONTE CARLO METHODS IN STATISTICAL PHYSICS / / setup i n i t i a l energy for ( in t y =0 ; y < n_spins ; y++) { for ( in t x = 0 ; x < n_spins ; x++){ E = ( double ) s pin_m at ri x [ y ] [ x] ( spin _m at rix [ pe riod i c (y , n_spins , 1) ] [ x ] + sp in _m atrix [y ][ p e r i odi c (x , n_spins , 1) ] ) ; } } } / / end f unct i o n i n i t i a l i s e void Metropolis ( i nt n_spins , long & idum , int spin_matr ix , double& E , double&M, double w) { / / loop over a l l s pins for ( in t y =0 ; y < n_spins ; y++) { for ( in t x = 0 ; x < n_spins ; x++){ in t ix = ( i nt ) ( ran1 (&idum ) ( double ) n_spins ) ; in t iy = ( i nt ) ( ran1 (&idum ) ( double ) n_spins ) ; in t de lt aE = 2 s pin_m at ri x [ iy ] [ ix ] ( spin _m at rix [ i y ][ p e r i odi c ( ix , n_spins , 1) ]+ sp in _m atrix [ p erio d i c ( iy , n_spins , 1) ] [ ix ] + sp in _m atrix [ iy ][ peri o d ic ( ix , n_spins , 1 ) ] + sp in _m atrix [ p erio d i c ( iy , n_spins , 1 ) ][ i x ]) ; i f ( ran1 (&idum ) <= w[ deltaE + 8] ) { sp in _m atrix [ iy ] [ ix ] = 1; / / f l i p one spin and accept new spin c onfig M += ( double ) 2 s pin_m at ri x [ iy ] [ ix ] ; E + = ( double ) de ltaE ; } } } } / / end of Metropolis sampling over spin s void o utput ( int n_spins , int mcs , double temp , double average ) { double norm = 1 / ( ( double ) ( mcs ) ) ; / / divi ded by t o t a l number of cyc les double Eaverage = average [0] norm ; double E2average = average [1] norm ; double Maverage = average [2] norm ; double M2average = average [3] norm ; double Mabsaverage = average [4] norm ; / / a l l e xpe cta tio n va lu es are per spin , d iv i de by 1/ n_spins / n_spins double Evariance = ( E2average Eaverage Eaverage ) / n_spins / n_spins ; double Mvariance = ( M2average Mabsaverage Mabsaverage ) / n_spins / [...]... selected examples 12. 2.1 First illustration of VMC methods, the one-dimensional harmonic oscillator The harmonic oscillator in one dimension lends itself nicely for illustrative purposes The hamiltonian is 1 This corresponds to the partition function ắ ắẹ ĩắ ã ẵ ĩắ ắ ắ in statistical physics ( 12. 10) 12. 2 VARIATIONAL MONTE CARLO FOR QUANTUM MECHANICAL SYSTEMS07 2 where ẹ is the mass of the particle and... they form a complete set, viz., âè ấà â ấà ( 12. 3) and assuming the set of eigenfunctions to be normalized, insertion of the latter equation in Eq ( 12. 1) results in ẩ Ê ề ấ ấâÊ ấà ấàâềấà ẹ ẹề ẹ ẩ Ê ề ấ ấâÊ ấàâềấà ẹ ẹ ẹề 20 3 ẩ Ê ềấ ẹề ẹ ấâÊ ấà ề ấàâềấà ẩẹ ắ ề ề ( 12. 4) 20 4 CHAPTER 12 QUANTUM MONTE CARLO METHODS ẩ ắ ề ề ẩ ềắ ề ề which can be rewritten as ẳ ( 12. 5) In general, the integrals involved in the... length is given by è à and if we set è ẵà è è (11. 32) è one obtains è à è è àơ è è ư ẻ è à and ơ (11.33) ô (11.34) è à ư è è ô (11.35) 11.3 .2 Heat capacity and susceptibility as functions of number of spins in preparation 11.4 OTHER SPIN MODELS 20 1 11.3.3 Thermalization in preparation 11.4 Other spin models 11.4.1 Potts model 11.4 .2 XY-model 11.5 Physics project: simulation of the Ising model In... ĩắ ( 12. 11) ẵ The exact wave function for the ground state is ẵ âẳĩà ẵ ĩắ ắ ( 12. 12) The energy of the ground state is then ẳ but since we wish to illustrate the use of Monte Carlo methods, we choose the trial function ễô âè ĩà ẵ ĩắ ôắ ắ ( 12. 13) Inserting this function in the expression for the local energy in Eq ( 12. 8), we obtain the following expression for the local energy ôắ ã ĩắ ẵ ô ĩà à ( 12. 14)... performed VMC calculation can aid in this context 12. 2 Variational Monte Carlo for quantum mechanical systems The variational quantum Monte Carlo (VMC) has been widely applied to studies of quantal systems Here we expose its philosophy and present applications and critical discussions 12. 2 VARIATIONAL MONTE CARLO FOR QUANTUM MECHANICAL SYSTEMS05 2 à The recipe, as discussed in chapter 4 as well,... ôắ ã ĩắ ẵ ô ĩà à ( 12. 14) with the expectation value for the hamiltonian of Eq ( 12. 9) given by ẵ è ẵ ĩà ắ ĩà ĩ ( 12. 15) which reads with the above trial wave function Using the fact that ấẵ ĩắ ôắ ôắ ã ĩắ ẵ ô ẵ ĩ ấ ẵ ĩắ ôắ ẵ ĩ ẵ ĩ ẵ we obtain and the variance ắ ĩắ ôắ à ( 12. 16) ệ ẵ ã ắôắ ắ ôắ ô ẵàắ ắô ôắ ( 12. 17) ( 12. 18) In solving this problem we can choose whether we wish to use the Metropolis... energy We could think of splitting the computation of the expectation value of the local energy into a kinetic energy part and a potential energy part If we are dealing with a three-dimensional system, the expectation value of the kinetic energy is ấ ấ ấâÊ ấàệắ âè ấà è ấâÊ ấàâè ấà è ( 12. 21) and we could be tempted to compute, if the wave function obeys spherical symmetry, just the second derivative with... inherent physics to the problem, since they form the starting point for a variational calculation of the expectation value of the hamiltonian Given a hamiltonian and a trial wave function è , the variational principle states that the expectation value of , dened through â ấ ấâÊ ấà ấàâè ấà è ấâÊ ấàâè ấà è ấ ( 12. 1) is an upper bound to the ground state energy ẳ of the hamiltonian , that is ẳ ( 12. 2)... If ẩ ấẳ à ẩ ấà ẵ where ấẳ is the new position, the new step is accepted, or 2 ệ ẩ ấẳà ẩ ấà where ệ is random number generated with uniform PDF such that also accepted ệ ắ ẳ ẵ, the step is 20 6 CHAPTER 12 QUANTUM MONTE CARLO METHODS In the Ising model we were ipping one spin at the time Here we change the position of say a given particle to a trial position ấẳ , and then evaluateấthe ratio between two... behavior ẳ ẳ ẵ 20 0 CHAPTER 11 MONTE CARLO METHODS IN STATISTICAL PHYSICS We will however notice a broad maximum in e.g., ẻ near è This maximum, as discussed below, becomes sharper and sharper as is increased Near è we can characterize the behavior of many physical quantities by a power law behavior As an example, the mean magnetization is given by è à è è àơ (11 .27 ) where ơ is a so-called critical . exponential at each Monte Carlo sampling. 11 .2 Program example We list here an example of a C/C++-program which computes various thermodynamical prop- erties of the Ising model in two dimensions You. to recompile the program when larger systems are considered. 11 .2. 1 Program for the two-dimensional Ising Model programs/chap11/program1.cpp / Program to solve the two dimensional I sin g model The. up a histogram. What does the histogram mean? Chapter 12 Quantum Monte Carlo methods 12. 1 Introduction The aim of this chapter is to present examples of applications of Monte Carlo methods in