@@ -13,6 +13,7 @@ struct TEBDResults
13
13
observables:: Dict{String,Tuple{Vector{ComplexF64},Vector{ComplexF64},Vector{ComplexF64}}}
14
14
localOperators:: Dict{String,Vector{Vector{ComplexF64}}}
15
15
correlationFunctions:: Dict{String,Vector{Matrix{ComplexF64}}}
16
+ maxBondDimension:: Vector{Int64}
16
17
end
17
18
18
19
function buildGatesTEBD1 (model:: Model , dt:: Float64 ):: Vector{ITensor}
@@ -64,6 +65,8 @@ function storeTEBDResult(file::String, result::TEBDResults)
64
65
HDF5. write (grpCorrelationFunctions, name, mat)
65
66
end
66
67
68
+ HDF5. write (fptr, " max_bond_dimension" , result. maxBondDimension)
69
+
67
70
HDF5. close (fptr)
68
71
end
69
72
@@ -95,7 +98,8 @@ function runTEBD(psi0::MPS, model::Model, options::TEBDOptions)::TEBDResults
95
98
Float64[],
96
99
Dict {String,Tuple{Vector{ComplexF64},Vector{ComplexF64},Vector{ComplexF64}}} (),
97
100
Dict {String,Vector{Vector{ComplexF64}}} (),
98
- Dict {String,Vector{Matrix{ComplexF64}}} ()
101
+ Dict {String,Vector{Matrix{ComplexF64}}} (),
102
+ Int64[]
99
103
)
100
104
101
105
push! (results. time, time)
@@ -107,6 +111,7 @@ function runTEBD(psi0::MPS, model::Model, options::TEBDOptions)::TEBDResults
107
111
push! (results. observables[observable. name][1 ], values[1 ])
108
112
push! (results. observables[observable. name][2 ], values[2 ])
109
113
push! (results. observables[observable. name][3 ], values[3 ])
114
+ push! (results. maxBondDimension, maxlinkdim (psi))
110
115
end
111
116
112
117
# measure initial local operators
@@ -121,6 +126,8 @@ function runTEBD(psi0::MPS, model::Model, options::TEBDOptions)::TEBDResults
121
126
push! (results. correlationFunctions[correlationFunction. name], expect (psi, correlationFunction))
122
127
end
123
128
129
+ maxBondDimension = 0
130
+
124
131
while time < options. tfinal
125
132
psi = apply (gates, psi; cutoff = options. cutoff)
126
133
time += options. dt
@@ -132,6 +139,8 @@ function runTEBD(psi0::MPS, model::Model, options::TEBDOptions)::TEBDResults
132
139
push! (results. observables[observable. name][1 ], values[1 ])
133
140
push! (results. observables[observable. name][2 ], values[2 ])
134
141
push! (results. observables[observable. name][3 ], values[3 ])
142
+ maxBondDimension = maxlinkdim (psi)
143
+ push! (results. maxBondDimension, maxBondDimension)
135
144
end
136
145
137
146
# measure initial local operators
@@ -149,6 +158,7 @@ function runTEBD(psi0::MPS, model::Model, options::TEBDOptions)::TEBDResults
149
158
timestamp = Dates. format (now (), " YYYY-mm-dd HH:MM:SS" )
150
159
151
160
@info " $timestamp : Finished time=$time ($percentage %)"
161
+ @info " max bond dimension=$maxBondDimension "
152
162
end
153
163
154
164
return results
0 commit comments