-
Notifications
You must be signed in to change notification settings - Fork 0
/
initresults.m
62 lines (58 loc) · 1.35 KB
/
initresults.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
61
62
function r = initresults(para)
%
% Modified:
% FS 25/10/2014: - added line for ~para.useVmat to prepare Vmat_sv == 1
% FS 12/10/2015: - better multi chain support: Vtens and StarMPS
L = para.L;
d_opt = para.d_opt;
if L ~= 1
D = para.D(end);
end
NC = para.nChains;
r.Vmat_sv = cell(1,L);
r.Amat_sv = cell(1,L-1);
r.Vmat_vNE = zeros(1,L); %phonon basis von Neumann Amat_vNEj
r.Amat_vNE = zeros(1,L-1);
r.Vmat_truncErr = zeros(1,L);
r.Amat_truncErr = zeros(1,L-1);
if para.parity~='n'
% old code:
%r.Vmat_sv=zeros(L,max(d_opt)/2);
%r.Amat_sv=zeros(L,D/2);
else
if para.useVtens
r.Vmat_sv = cell(NC+1,L);
elseif para.useStarMPS
r.Vmat_sv = cell(NC,L);
r.Vmat_vNE = zeros(NC,L);
r.Amat_sv = cell(NC,L-1);
r.Amat_vNE = zeros(NC,L-1);
else
r.Vmat_sv = cell(1,L);
end
%r.Vmat_sv=zeros(L,max(d_opt));
%r.Amat_sv=zeros(L,D);
end
if ~para.useVmat
% initialise with any dummy values to prevent error
for i = 1:L
r.Vmat_sv{i} = eye(para.dk(i));
end
end
r.leftge = zeros(L,1);
r.geoffset=zeros(L,1);
r.Eerror(1)=1;
r.lastVmat_vNE=zeros(1,L);
if para.logging
r.d_opt = cell(1);
r.d_opt{1} = para.d_opt;
r.D = cell(1);
r.D{1} = para.D;
r.dk = cell(1);
r.dk{1} = para.dk;
r.shift = cell(1);
r.shift{1} = para.shift;
r.Vmat_svLog = cell(1);
r.EvaluesLog = cell(1);
r.flowdiag = cell(1);
end