Example #1
0
    def compute(self):
        of = self.interpreter.filePool.create_file()
        os.unlink(of.name)
        os.mkdir(of.name)
        dir = basic.Directory
        dir.name = of.name
        o = self.interpreter.filePool.create_file()
        if self.hasInputFromPort('simulationid'):
            base_name = self.getInputFromPort('simulationid')
        else:
            base_name = os.path.basename(o.name)

        input_values = self.forceGetInputListFromPort('parms')
        if type(input_values[0]) == list:
            input_values = input_values[0]
        nmlList = pyalps.writeTEBDfiles(input_values,
                                        os.path.join(dir.name, base_name))
        pyalps.copyStylesheet(dir.name)

        self.setResult("output_dir", dir)
        self.setResult("output_files", nmlList)
Example #2
0
          'INITIAL_STATE' : 'kink',
          'CHI_LIMIT' : 40,
          'TRUNC_LIMIT' : 1E-12,
          'NUM_THREADS' : 1,
          'TAUS' : [20.0],
          'POWS' : [0.0],
          'GS' : ['H'],
          'GIS' : [0.0],
          'GFS' : [0.0],
          'NUMSTEPS' : [500],
          'STEPSFORSTORE' : [5],
          'SIMID': count
            })

baseName='tutorial_2d'
nmlnameList=pyalps.writeTEBDfiles(parms, baseName)
res=pyalps.runTEBD(nmlnameList)

#Get magnetization data
Magdata=pyalps.load.loadTimeEvolution( pyalps.getResultFiles(prefix='tutorial_2d'), measurements=['Local Magnetization'])

#Compute the integrated magnetization across the center
for q in Magdata:
    syssize=q[0].props['L']
    #Compute the integrated flow of magnetization through the center \Delta M=\sum_{n>L/2}^{L} (<S_n^z(t)>+1/2)
    #\Delta M= L/4
    loc=0.5*(syssize/2)
    #\Delta M-=<S_n^z(t)> from n=L/2 to L
    q[0].y=[0.5*(syssize/2)+sum(q[0].y[syssize/2:syssize])]