-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsavepara.m
60 lines (53 loc) · 1.55 KB
/
savepara.m
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function savepara(para)
%%%%%%%%%%%%%%%%%%-------WRITE TO FILES--------%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%------Problem Parameters
filename=[para.folder '/problemparmeters.dat'];
fid=fopen(filename, 'wb');
fwrite(fid,para.L,'int32');
fwrite(fid,para.TGQN,'int32');
fclose(fid);
%%%%%%------Site info
filename=[para.folder '/site_base.dat'];
fid=fopen(filename, 'wb');
sitebase2file(fid,para.site{1}.Dim,para.site{1}.subnum,para.site{1}.dim,para.site{1}.gtypenum,para.site{1}.gqn,para.site{1}.ordermap);
for i=2:para.L
sitebase2file(fid,para.site{2}.Dim,para.site{2}.subnum,para.site{2}.dim,para.site{2}.gtypenum,para.site{2}.gqn,para.site{2}.ordermap);
end
fclose(fid);
filename=[para.folder '/site_operators.dat'];
fid=fopen(filename, 'wb');
mat2file(fid,para.site{1}.sigmax);
mat2file(fid,para.site{1}.sigmaz);
for i=2:para.L
mat2file(fid,para.site{2}.cm);
mat2file(fid,para.site{2}.n);
end
fclose(fid);
%%%%%%-----Starting State Hamiltonian
filename=[para.folder '/Hfac.dat'];
fid=fopen(filename, 'wb');
fwrite(fid,para.hopT, 'real*8');
fwrite(fid,para.onesiteE,'real*8');
fwrite(fid,para.twositesV,'real*8');
fclose(fid);
filename=[para.folder '/HC.dat'];
fid=fopen(filename, 'wb');
for i=1:para.L-1
mat2file(fid, para.h0{i});
end
fclose(fid);
%%%%%%-----Time evolving Hamiltonian
filename=[para.folder '/rt_T0.dat'];
fid=fopen(filename, 'wb');
fwrite(fid,para.t_num,'int32');
for i=1:para.L-1
mat2file(fid,para.U{i});
end
fclose(fid);
filename=[para.folder '/rt_H1_T0.dat'];
fid=fopen(filename, 'wb');
for i=1:para.t_num
mat2file(fid, para.U_imp{i});
end
fclose(fid);
end