Difference between revisions of "ALPS 2 Tutorials:DWA-03 Time of Flight Images"

From ALPS
Jump to: navigation, search
(Preparing and running the simulation from Python)
(Preparing and running the simulation from Python)
Line 24: Line 24:
 
   
 
   
 
     'THERMALIZATION' : 1500 ,
 
     'THERMALIZATION' : 1500 ,
     'SWEEPS'        : 7000 ,
+
     'SWEEPS'        : 60000 ,
 
     'SKIP'          : 50 ,  
 
     'SKIP'          : 50 ,  
 
   
 
   

Revision as of 10:57, 18 September 2013

Time-of-flight images

As a third example of the dwa QMC code, we shall study the time-of-flight images of an optical lattice in an harmonic trap.

Preparing and running the simulation from Python

To set up and run the simulation in Python we use the script tutorial3a.py. The first parts of this script imports the required modules and then prepares the input files as a list of Python dictionaries:

import pyalps

parms = [
  {
    'LATTICE' : 'inhomogeneous simple cubic lattice' ,
    'L'       : 120 ,

    'MODEL'   : 'boson Hubbard' ,
    'Nmax'    : 20 ,

    't'  : 1. ,
    'U'  : 8.11 ,
    'mu' : '4.05 - (0.0073752*(x-(L-1)/2.)*(x-(L-1)/2.) + 0.0036849*(y-(L-1)/2.)*(y-(L-1)/2.) + 0.0039068155*(z-(L-1)/2.)*(z-(L-1)/2.))' ,

    'T'  : 1. ,

    'THERMALIZATION' : 1500 ,
    'SWEEPS'         : 60000 ,
    'SKIP'           : 50 , 

    'tof_phase'    : pyalps.dwa.tofPhase(time_of_flight=15.5, wavelength=[765,843,843], mass=86.99) ,

    'MEASURE[Green Function]': 1
  }
]

We next convert this into a job file in XML format and run the worm simulation:

input_file = pyalps.writeInputFiles('parm3a', parms)
res = pyalps.runApplication('dwa', input_file)

We now have the same output files as in the command line version.