-
Notifications
You must be signed in to change notification settings - Fork 6
/
ITend.m
60 lines (51 loc) · 1.68 KB
/
ITend.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
% Print out the energies in output file -----------------------------------
fprintf(FNOUT, '%s %i \n','Iteration =', it);
fprintf(FNOUT,'---------------\n');
fprintf(FNOUT, ' %3s %2s %5s %3s %10s \n', 'It.', '#', '2Sz', 'Q', 'E');
fprintf(FNOUT,'--------------------------------------\n');
for i=1:min(KEPT,L)
fprintf(FNOUT, '%3i %3i %4i %4i %20.16f \n', it, i, Sz(i), Q(i), E(i));
end
fprintf(FNOUT, '\n');
% Save even/odd energies for plotting ------------------------------------
if(PLOT_E || EO_PRINT)
if( mod(it,2) == 0 )
EvenIt((it/2)+1) = it;
for i = 1:min(L,ENMAX_PL)
EvenE((it/2)+1,i) = E(i);
end
else
OddIt(int16(it/2)) = it;
for i = 1:min(L,ENMAX_PL)
OddE(int16(it/2),i) = E(i);
end
end
end
% Print Even/Odd Energies -------------------------------------------------
if(EO_PRINT)
if( mod(it,2) == 0 )
NP = FNEVEN;
else NP = FNODD;
end
fprintf(NP,'%3i', it);
for i = 1:min(L,ENMAX_PR)
fprintf(NP, '%8.4f', E(i));
end
fprintf(NP,'\n');
end
% Print out Thermodynamic qts. --------------------------------------------
if(THERMO)
fprintf(FNTHERM, '%4i %14.6e %14.8f %14.8f %14.8f \n', it, temp(it+1), s(it+1), tchi(it+1), Cv(it+1));
end
% Print out Exp. Values of Operators. -------------------------------------
if(OPMAT)
if ( NOP == 1)
fprintf(FNOPMAT, '%14.4e %16.8f \n', temp(it+1), op_exp(it+1,1));
else
fprintf(FNOPMAT, '%14.4e', temp(it+1));
for i = 1:NOP
fprintf(FNOPMAT, '%16.8f',op_exp(it+1,i));
end
fprintf(FNOPMAT, '\n');
end
end