Skip to content

Commit 59c49b2

Browse files
authored
Normalize tensors before svd-truncation (#283)
1 parent 20530be commit 59c49b2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/algorithms/changebonds/optimalexpand.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function changebonds(ψ::InfiniteMPS, H::InfiniteMPOHamiltonian, alg::OptimalExp
3030
# Use the nullspaces and SVD decomposition to determine the optimal expansion space
3131
VL = leftnull.AL[i])
3232
VR = rightnull!(_transpose_tail.AR[i + 1]))
33-
intermediate = adjoint(VL) * AC2 * adjoint(VR)
33+
intermediate = normalize!(adjoint(VL) * AC2 * adjoint(VR))
3434
U, _, V, = tsvd!(intermediate; trunc=alg.trscheme, alg=alg.alg_svd)
3535

3636
AL′[i] = VL * U
@@ -56,7 +56,7 @@ function changebonds(ψ::MultilineMPS, H, alg::OptimalExpand, envs=environments(
5656
# Use the nullspaces and SVD decomposition to determine the optimal expansion space
5757
VL = leftnull.AL[i, j])
5858
VR = rightnull!(_transpose_tail.AR[i, j + 1]))
59-
intermediate = adjoint(VL) * AC2 * adjoint(VR)
59+
intermediate = normalize!(adjoint(VL) * AC2 * adjoint(VR))
6060
U, _, V, = tsvd!(intermediate; trunc=alg.trscheme, alg=alg.alg_svd)
6161

6262
AL′[i, j] = VL * U
@@ -87,7 +87,7 @@ function changebonds!(ψ::AbstractFiniteMPS, H, alg::OptimalExpand, envs=environ
8787
NR = rightnull!(_transpose_tail.AR[i + 1]))
8888

8989
#Use this nullspaces and SVD decomposition to determine the optimal expansion space
90-
intermediate = adjoint(NL) * AC2 * adjoint(NR)
90+
intermediate = normalize!(adjoint(NL) * AC2 * adjoint(NR))
9191
_, _, V, = tsvd!(intermediate; trunc=alg.trscheme, alg=alg.alg_svd)
9292

9393
ar_re = V * NR

src/algorithms/changebonds/randexpand.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function changebonds(ψ::InfiniteMPS, alg::RandExpand)
2828
# Use the nullspaces and SVD decomposition to determine the optimal expansion space
2929
VL = leftnull.AL[i])
3030
VR = rightnull!(_transpose_tail.AR[i + 1]))
31-
intermediate = adjoint(VL) * AC2 * adjoint(VR)
31+
intermediate = normalize!(adjoint(VL) * AC2 * adjoint(VR))
3232
U, _, V, = tsvd!(intermediate; trunc=alg.trscheme, alg=alg.alg_svd)
3333

3434
AL′[i] = VL * U
@@ -52,7 +52,7 @@ function changebonds!(ψ::AbstractFiniteMPS, alg::RandExpand)
5252
NR = rightnull!(_transpose_tail.AR[i + 1]))
5353

5454
#Use this nullspaces and SVD decomposition to determine the optimal expansion space
55-
intermediate = adjoint(NL) * AC2 * adjoint(NR)
55+
intermediate = normalize!(adjoint(NL) * AC2 * adjoint(NR))
5656
_, _, V, = tsvd!(intermediate; trunc=alg.trscheme, alg=alg.alg_svd)
5757

5858
ar_re = V * NR

0 commit comments

Comments
 (0)