# **************************************************************************** # # ALPS Project: Algorithms and Libraries for Physics Simulations # # ALPS Libraries # # Copyright (C) 2009-2010 by Matthias Troyer # # This software is part of the ALPS libraries, published under the ALPS # Library License; you can use, redistribute it and/or modify it under # the terms of the license, either version 1 or (at your option) any later # version. # # You should have received a copy of the ALPS Library License along with # the ALPS Libraries; see the file LICENSE.txt. If not, the license is also # available from http://alps.comp-phys.org/. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT # SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE # FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # # **************************************************************************** import pyalps import matplotlib.pyplot as plt import pyalps.plot #prepare the input parameters parms = [] for t in [0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.25, 1.5, 1.75, 2.0]: parms.append( { 'LATTICE' : "ladder", 'T' : t, 'J0' : -1 , 'J1' : -1 , 'THERMALIZATION' : 10000, 'SWEEPS' : 500000, 'UPDATE' : "cluster", 'MODEL' : "Heisenberg", 'L' : 60 } ) #write the input file and run the simulation input_file = pyalps.writeInputFiles('parm2b',parms) pyalps.runApplication('spinmc',input_file,Tmin=5) #load the susceptibility and collect it as function of temperature T data = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm2b'),'Susceptibility') susceptibility = pyalps.collectXY(data,x='T',y='Susceptibility') #make plot plt.figure() pyalps.plot.plot(susceptibility) plt.xlabel('Temperature $T/J$') plt.ylabel('Susceptibility $\chi J$') plt.ylim(0,0.22) plt.title('Heisenberg ladder') plt.show()