# **************************************************************************** # # ALPS Project: Algorithms and Libraries for Physics Simulations # # ALPS Libraries # # Copyright (C) 2010 by Brigitte Surer # # 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 import numpy as np #prepare the input parameters parms = [] for l in [8,10,12,16]: for j2 in [0.2,0.25,0.3,0.35,0.4]: parms.append( { 'LATTICE' : "coupled ladders", 'local_S' : 0.5, 'ALGORITHM' : 'loop', 'SEED' : 0, 'BETA' : 2*l, 'J0' : 1 , 'J1' : 1, 'J2' : j2, 'THERMALIZATION' : 5000, 'SWEEPS' : 50000, 'MODEL' : "spin", 'L' : l, 'W' : l/2 } ) #write the input file and run the simulation input_file = pyalps.writeInputFiles('parm8b',parms) pyalps.runApplication('loop',input_file) data = pyalps.loadMeasurements(pyalps.getResultFiles(pattern='parm8b.task*.out.h5'),['Binder Ratio of Staggered Magnetization','Stiffness']) binder=pyalps.collectXY(data,x='J2',y='Binder Ratio of Staggered Magnetization', foreach=['L']) stiffness =pyalps.collectXY(data,x='J2',y='Stiffness', foreach=['L']) for q in stiffness: q.y = q.y*q.props['L'] #make plot plt.figure() pyalps.plot.plot(stiffness) plt.xlabel(r'$J2$') plt.ylabel(r'Stiffness $\rho_s L$') plt.title('coupled ladders') plt.figure() pyalps.plot.plot(binder) plt.xlabel(r'$J_2$') plt.ylabel(r'$g(m_s)$') plt.title('coupled ladders') plt.show()