Skip to content

Commit 894a059

Browse files
committed
Add right_canonicalize!
1 parent b9db949 commit 894a059

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/operators/ortho.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,36 @@ function left_canonicalize!(H::MPOHamilonian, i::Int; alg = QRPos())
6363
H[i + 1] = JordanMPOTensor(V physicalspace(W′) domain(W′), A′, B′, C′, D′)
6464
return H
6565
end
66+
67+
function right_canonicalize!(H::MPOHamilonian, i::Int; alg = RQpos())
68+
@assert i != length(H) "TBA"
69+
70+
W = H[i]
71+
72+
# orthogonalize second row against last
73+
WI = removeunit(W[end, 1, 1, end], 4)
74+
@tensor t[l; r] := conj(WI[r p; p']) * W.B[l p; p']
75+
@plansor B′[l p; p'] := -WI[r p; p'] * t[l; r]
76+
add!(B′, W.B)
77+
78+
# LQ of second row
79+
AB = transpose(cat(insertleftunit(B′, 4), W.A; dims = 4), ((1,), (3, 4, 2)))
80+
R, Q = rightorth!(AB; alg)
81+
Q′ = transpose(Q, ((1, 4), (2, 3)))
82+
Q1 = SparseBlockTensorMap(Q′[1, 1, 1, 2:end])
83+
Q2 = removeunit(SparseBlockTensorMap(Q′[1:1, 1, 1, 1]), 4)
84+
V = BlockTensorKit.oplus(oneunit(spacetype(W)), left_virtualspace(Q′), oneunit(spacetype(W)))
85+
H[i] = JordanMPOTensor(V physicalspace(W) domain(W), Q1, Q2, W.C, W.D)
86+
87+
# absorb into previous site
88+
W′ = H[i - 1]
89+
@plansor A′[l p; p' r] := W′.A[l p; p' r] * R[r; r]
90+
@plansor B′[l p; p' r'] := W′.A[l p; p' r'] * t[r'; r] R[l; r] * W′.B[r p; p']
91+
B′ = add!(removeunit(B′, 4), W′.B)
92+
@plansor C′[p; p' r] := W′.C[p; p' r'] * R[r'; r]
93+
@plansor D′[p; p' r] := W′.C[p; p' l] *t[l; r]
94+
D′ = add!(removeunit(D, 3), W′.D)
95+
96+
H[i - 1] = JordanMPOTensor(V physicalspace(W′) domain(W′), A′, B′, C′, D′)
97+
return H
98+
end

0 commit comments

Comments
 (0)