Difference between revisions of "ALPS 2 Tutorials:MC-01 Equilibration"

From ALPS
Jump to: navigation, search
(Using command line)
(Using Python)
Line 35: Line 35:
  
 
Script file [http://alps.comp-phys.org/static/tutorials2.1.0/mc-01b-equilibration/tutorial1a.py tutorial1a.py]:
 
Script file [http://alps.comp-phys.org/static/tutorials2.1.0/mc-01b-equilibration/tutorial1a.py tutorial1a.py]:
 +
 +
import pyalps
 +
 +
parms = [];
 +
for T in [0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0]:
 +
  parms.append({
 +
    'LATTICE'        : "square lattice",         
 +
    'MODEL'          : "boson Hubbard",
 +
    'L'              : 20,
 +
    'Nmax'            : 20,
 +
    't'              : 1.,
 +
    'U'              : 16.,
 +
    'mu'              : 32.,
 +
    'T'              : T,
 +
    'THERMALIZATION'  : 10000,
 +
    'SWEEPS'          : 100000,
 +
    'SKIP'            : 400
 +
  })
 +
 +
input_file = pyalps.writeInputFiles('parm1a',parms)
 +
res = pyalps.runApplication('dwa',input_file)

Revision as of 16:09, 27 August 2013

Equilibration

Rule of thumb: All Monte Carlo simulations have to be equilibrated before taking measurements.

Example: Quantum Monte Carlo (directed worm algorithm) simulations

As an example, we consider a Quantum Monte Carlo simulation implemented in the directed worm algorithm for boson Hubbard model in square lattice geometry of size 202.

Using command line

The parameter file parm1a:

LATTICE="square lattice"
MODEL="boson Hubbard"

L=20  
Nmax=20

t=1.
U=16.
mu=32.

THERMALIZATION=10000
SWEEPS=100000 
SKIP=400

{T=1.0}

We first convert the input parameters to XML and then run the application dwa:

parameter2xml parm1a
dwa parm1a.in.xml

Using Python

Script file tutorial1a.py:

import pyalps
parms = [];
for T in [0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0]:
  parms.append({
    'LATTICE'         : "square lattice",          
    'MODEL'           : "boson Hubbard",
    'L'               : 20,
    'Nmax'            : 20,
    't'               : 1.,
    'U'               : 16.,
    'mu'              : 32.,
    'T'               : T,
    'THERMALIZATION'  : 10000,
    'SWEEPS'          : 100000,
    'SKIP'            : 400
  })
input_file = pyalps.writeInputFiles('parm1a',parms)
res = pyalps.runApplication('dwa',input_file)