Skip to content

Commit 86c0ad1

Browse files
committed
Remove condition_number
1 parent 522b358 commit 86c0ad1

4 files changed

Lines changed: 8 additions & 22 deletions

File tree

src/algorithms/ctmrg/c4v.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function ctmrg_iteration(
146146
corner′, projector, info = c4v_projector!(enlarged_corner, alg.projector_alg)
147147
edge′ = c4v_renormalize_edge(network, env, projector)
148148
info = (;
149-
contraction_metrics = (; info.truncation_error, info.condition_number),
149+
contraction_metrics = (; info.truncation_error),
150150
info.D, info.V,
151151
)
152152
return CTMRGEnv(corner′, edge′), info
@@ -196,11 +196,6 @@ function c4v_projector!(enlarged_corner, alg::C4vEighProjector)
196196

197197
D, V, truncation_error = eigh_trunc!(enlarged_corner, eigh_alg)
198198

199-
# get some decomposition info
200-
condition_number = ignore_derivatives() do
201-
return cond(D)
202-
end
203-
204199
# Check for degenerate eigenvalues
205200
Zygote.isderiving() && ignore_derivatives() do
206201
if alg.verbosity > 0 && is_degenerate_spectrum(D)
@@ -209,7 +204,7 @@ function c4v_projector!(enlarged_corner, alg::C4vEighProjector)
209204
end
210205
end
211206

212-
return D / norm(D), V, (; D, V, truncation_error, condition_number)
207+
return D / norm(D), V, (; D, V, truncation_error)
213208
end
214209
"""
215210
c4v_projector!(enlarged_corner, alg::C4vQRProjector)
@@ -225,7 +220,7 @@ Compute the C₄ᵥ projector by decomposing the column-enlarged corner with `le
225220
function c4v_projector!(enlarged_corner, alg::C4vQRProjector)
226221
Q, R = left_orth!(enlarged_corner, decomposition_algorithm(alg))
227222
# TODO: what's a meaningful way to compute a truncation error/condition number in this scheme?
228-
return Q, (; Q, R, truncation_error = zero(scalartype(Q)), condition_number = 0)
223+
return Q, (; Q, R, truncation_error = zero(scalartype(Q)))
229224
end
230225

231226
"""

src/algorithms/ctmrg/projectors.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ function compute_projector(enlarged_corners, alg::HalfInfiniteProjector)
171171

172172
# get some decomposition info
173173
truncation_error = truncation_error / norm(S) # normalize truncation error
174-
condition_number = ignore_derivatives() do
175-
return cond(S)
176-
end
177174

178175
# Check for degenerate singular values
179176
Zygote.isderiving() && ignore_derivatives() do
@@ -184,7 +181,7 @@ function compute_projector(enlarged_corners, alg::HalfInfiniteProjector)
184181
end
185182

186183
P_left, P_right = contract_projectors(U, S, V, enlarged_corners...)
187-
return (P_left, P_right), (; U, S, V, truncation_error, condition_number)
184+
return (P_left, P_right), (; U, S, V, truncation_error)
188185
end
189186
function compute_projector(enlarged_corners, alg::FullInfiniteProjector)
190187
halfinf_left = half_infinite_environment(enlarged_corners[1], enlarged_corners[2])
@@ -197,9 +194,6 @@ function compute_projector(enlarged_corners, alg::FullInfiniteProjector)
197194

198195
# get some decomposition info
199196
truncation_error = truncation_error / norm(S) # normalize truncation error
200-
condition_number = ignore_derivatives() do
201-
return cond(S)
202-
end
203197

204198
# Check for degenerate singular values
205199
Zygote.isderiving() && ignore_derivatives() do
@@ -210,5 +204,5 @@ function compute_projector(enlarged_corners, alg::FullInfiniteProjector)
210204
end
211205

212206
P_left, P_right = contract_projectors(U, S, V, halfinf_left, halfinf_right)
213-
return (P_left, P_right), (; U, S, V, truncation_error, condition_number)
207+
return (P_left, P_right), (; U, S, V, truncation_error)
214208
end

src/algorithms/ctmrg/sequential.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,15 @@ end
5959

6060
function ctmrg_iteration(network, env::CTMRGEnv, alg::SequentialCTMRG)
6161
truncation_error = zero(real(scalartype(network)))
62-
condition_number = zero(real(scalartype(network)))
6362
for _ in 1:4 # rotate
6463
for col in 1:size(network, 2) # left move column-wise
6564
env, info = ctmrg_leftmove(col, network, env, alg)
6665
truncation_error = max(truncation_error, info.truncation_error)
67-
condition_number = max(condition_number, info.condition_number)
6866
end
6967
network = rotate_north(network, EAST)
7068
env = rotate_north(env, EAST)
7169
end
72-
return env, (; contraction_metrics = (; truncation_error, condition_number))
70+
return env, (; contraction_metrics = (; truncation_error))
7371
end
7472

7573
"""

src/algorithms/ctmrg/simultaneous.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function ctmrg_iteration(network, env::CTMRGEnv, alg::SimultaneousCTMRG)
4949
projectors, info = simultaneous_projectors(enlarged_corners, env, alg.projector_alg) # compute projectors on all coordinates
5050
env′ = renormalize_simultaneously(enlarged_corners, projectors, network, env) # renormalize enlarged corners
5151
info = (;
52-
contraction_metrics = (; info.truncation_error, info.condition_number),
52+
contraction_metrics = (; info.truncation_error),
5353
info.U, info.S, info.V,
5454
)
5555
return env′, info
@@ -61,11 +61,10 @@ function _split_proj_and_info(proj_and_info)
6161
P_left = map(x -> x[1][1], proj_and_info)
6262
P_right = map(x -> x[1][2], proj_and_info)
6363
truncation_error = maximum(x -> x[2].truncation_error, proj_and_info)
64-
condition_number = maximum(x -> x[2].condition_number, proj_and_info)
6564
U = map(x -> x[2].U, proj_and_info)
6665
S = map(x -> x[2].S, proj_and_info)
6766
V = map(x -> x[2].V, proj_and_info)
68-
info = (; truncation_error, condition_number, U, S, V)
67+
info = (; truncation_error, U, S, V)
6968
return (P_left, P_right), info
7069
end
7170

0 commit comments

Comments
 (0)