/
SingleSite3.py
38 lines (32 loc) · 1.49 KB
/
SingleSite3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
__author__ = 'Abuenameh'
import pyalps
import numpy as np
import matplotlib.pyplot as plt
import pyalps.plot
#prepare the input parameters
parms = [ {
'optimization' : 'singlesite',
'LATTICE' : 'open chain lattice',
'L' : 20,
'MODEL' : 'spin',
'local_S0' : '0.5',
'local_S1' : '1',
'CONSERVED_QUANTUMNUMBERS' : 'N,Sz',
'Sz_total' : 9,
'J' : 1,
'SWEEPS' : 4,
'NUMBER_EIGENVALUES' : 1,
'MAXSTATES' : 50,
'MEASURE_LOCAL[Spin]' : 'Sz',
# 'init_state' : 'local_quantumnumbers',
# 'initial_local_Sz' : ','.join(['0.5']*10+['-0.5']*1+['0.5']*9),#'0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5',#'1,0,0,0,0,0,0,0,0,0',
# 'initial_local_S' : ','.join(['0.5']*20+['-0.5']*0),#'0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,-0.5',#'1,0,0,0,0,0,0,0,0,0',
} ]
#write the input file and run the simulation
input_file = pyalps.writeInputFiles('SingleSite3/parm_spin_one',parms)
res = pyalps.runApplication('mps_optim',input_file,writexml=True)
#load all measurements for all states
data = pyalps.loadEigenstateMeasurements(pyalps.getResultFiles(prefix='SingleSite3/parm_spin_one'))
# print properties of the eigenvector:
for s in data[0]:
print s.props['observable'], ' : ', s.y[0]