コード例 #1
0
        'UPDATE': "cluster",
        'MODEL': "Ising",
        'L': 8
    })

#write the input file and run the simulation
input_file = pyalps.writeInputFiles('parm1', parms)
pyalps.runApplication('spinmc', input_file, Tmin=5, writexml=True)

#get the list of result files
result_files = pyalps.getResultFiles(prefix='parm1')
print("Loading results from the files: ", result_files)

#print the observables stored in those files:
print("The files contain the following mesurements:", end=' ')
print(pyalps.loadObservableList(result_files))

#load a selection of measurements:
data = pyalps.loadMeasurements(result_files,
                               ['|Magnetization|', 'Magnetization^2'])

#make a plot for the magnetization: collect Magnetziation as function of T
plotdata = pyalps.collectXY(data, 'T', '|Magnetization|')
plt.figure()
pyalps.plot.plot(plotdata)
plt.xlim(0, 3)
plt.ylim(0, 1)
plt.title('Ising model')
plt.show()

# convert the data to text file for plotting using another tool
コード例 #2
0
input_file = pyalps.writeInputFiles('parm1',parms)

# The queue is loaded from a configuration file which should either be located in the execution directory or in ~/.batchq/configuration
q = load_queue(LSFBSub, "brutus")
desc = runApplicationBackground('spinmc',input_file,Tmin=5,writexml=True, queue = q, force_resubmit = False )

if not desc.finished():
   print "Your simulations has not yet ended, please run this command again later."
else:
    if desc.failed():
        print "Your submission has failed"
        sys.exit(-1)
    result_files = pyalps.getResultFiles(prefix='parm1')
    print result_files
    print pyalps.loadObservableList(result_files)
    data = pyalps.loadMeasurements(result_files,['|Magnetization|','Magnetization^2'])
    print data
    plotdata = pyalps.collectXY(data,'T','|Magnetization|')
    plt.figure()
    pyalps.plot.plot(plotdata)
    plt.xlim(0,3)
    plt.ylim(0,1)
    plt.title('Ising model')
    plt.show()
    print pyalps.plot.convertToText(plotdata)
    print pyalps.plot.makeGracePlot(plotdata)
    print pyalps.plot.makeGnuplotPlot(plotdata)
    binder = pyalps.DataSet()
    binder.props = pyalps.dict_intersect([d[0].props for d in data])
    binder.x = [d[0].props['T'] for d in data]
コード例 #3
0
ファイル: replace.py プロジェクト: potass13/ALPS
	else:
		val = in_val.replace('_', ' ')
	
	return(val)
	
try:
	if args.debug:
		cmd.write(str(args))
	
	#define x-value and y-value 
	read_file = pyalps.getResultFiles(prefix=args.prefix)
	
	x_val = conv_val(args.x)
	y_val = conv_val(args.y)
	
	val_list = pyalps.loadObservableList(read_file)
	val_list = list(set(list(chain.from_iterable(val_list))))
	no_error_val = ['T', 'h', 'L', 'N', 'local_S', 'THERMALIZATION', 'SEED', 'SWEEPS']
	val_list = val_list + no_error_val
	
	if args.debug:
		cmd.write('\nval_list is ' + str(val_list) + '\n')
		cmd.write('no_error_val is ' + str(no_error_val) + '\n')
		cmd.write('x_val is ' + x_val + '\n')
		cmd.write('y_val is ' + y_val + '\n')
	
	if not x_val in val_list:
		cmd.write('The X-value you inputted do not exist.\n')
		cmd.write('You should choose this list, ' + str(val_list) + '\n')
		sys.exit(1)
	elif not y_val in val_list:
コード例 #4
0
ファイル: checkSS.py プロジェクト: potass13/ALPS
    cmd.write(str(args))

try:
    if args.debug and (not os.path.exists(args.path_drc_xml)):
        cmd.write('path_drc_xml(' + str(args.path_drc_xml) +
                  ') do not exist.\n')
        sys.exit(1)
    os.chdir(args.path_drc_xml)

    #get result files
    read_file = pyalps.getResultFiles(prefix=args.prefix)

    #define physical quantity
    pq = conv_val(args.y)

    val_list = pyalps.loadObservableList(read_file)
    val_list = list(set(list(chain.from_iterable(val_list))))
    no_error_val = [
        'T', 'h', 'L', 'N', 'local_S', 'THERMALIZATION', 'SEED', 'SWEEPS'
    ]
    val_list = val_list + no_error_val

    label = args.label

    if not pq in val_list:
        cmd.write('The physical quantity you inputted do not exist.\n')
        cmd.write('You should choose this list, ' + str(val_list) + '\n')
        sys.exit(1)

    if not label in no_error_val:
        cmd.write('The label you inputted do not exist or cannot use.\n')