@@ -126,14 +126,14 @@ function Base.:+(mpo1::FiniteMPO{<:MPOTensor}, mpo2::FiniteMPO{<:MPOTensor})
126126 A, (right_virtualspace (mpo1, 1 ) ⊕ right_virtualspace (mpo2, 1 )),
127127 right_virtualspace (mpo1, 1 )
128128 )
129- F₂ = leftnull (F₁)
129+ F₂ = left_null (F₁)
130130 @assert _lastspace (F₂) == right_virtualspace (mpo2, 1 )'
131131
132132 @plansor O[- 3 - 1 - 2 ; - 4 ] := mpo1[1 ][- 1 - 2 ; - 3 1 ] * conj (F₁[- 4 ; 1 ]) +
133133 mpo2[1 ][- 1 - 2 ; - 3 1 ] * conj (F₂[- 4 ; 1 ])
134134
135135 # making sure that the new operator is "full rank"
136- O, R = leftorth ! (O)
136+ O, R = qr_compact ! (O)
137137 O′ = transpose (O, ((2 , 3 ), (1 , 4 )))
138138 mpo = similar (mpo1, typeof (O′))
139139 mpo[1 ] = O′
@@ -148,13 +148,13 @@ function Base.:+(mpo1::FiniteMPO{<:MPOTensor}, mpo2::FiniteMPO{<:MPOTensor})
148148 A, (right_virtualspace (mpo1, i) ⊕ right_virtualspace (mpo2, i)),
149149 right_virtualspace (mpo1, i)
150150 )
151- F₂ = leftnull (F₁)
151+ F₂ = left_null (F₁)
152152 @assert _lastspace (F₂) == right_virtualspace (mpo2, i)'
153153 @plansor O[- 3 - 1 - 2 ; - 4 ] := O₁[- 1 - 2 ; - 3 1 ] * conj (F₁[- 4 ; 1 ]) +
154154 O₂[- 1 - 2 ; - 3 1 ] * conj (F₂[- 4 ; 1 ])
155155
156156 # making sure that the new operator is "full rank"
157- O, R = leftorth ! (O)
157+ O, R = qr_compact ! (O)
158158 mpo[i] = transpose (O, ((2 , 3 ), (1 , 4 )))
159159 end
160160
@@ -165,14 +165,14 @@ function Base.:+(mpo1::FiniteMPO{<:MPOTensor}, mpo2::FiniteMPO{<:MPOTensor})
165165 A, left_virtualspace (mpo1, N) ⊕ left_virtualspace (mpo2, N),
166166 left_virtualspace (mpo1, N)
167167 )
168- F₂ = leftnull (F₁)
168+ F₂ = left_null (F₁)
169169 @assert _lastspace (F₂) == left_virtualspace (mpo2, N)'
170170
171171 @plansor O[- 1 ; - 3 - 4 - 2 ] := F₁[- 1 ; 1 ] * mpo1[N][1 - 2 ; - 3 - 4 ] +
172172 F₂[- 1 ; 1 ] * mpo2[N][1 - 2 ; - 3 - 4 ]
173173
174174 # making sure that the new operator is "full rank"
175- L, O = rightorth ! (O)
175+ L, O = lq_compact ! (O)
176176 mpo[end ] = transpose (O, ((1 , 4 ), (2 , 3 )))
177177
178178 for i in (N - 1 ): - 1 : (halfN + 1 )
@@ -185,13 +185,13 @@ function Base.:+(mpo1::FiniteMPO{<:MPOTensor}, mpo2::FiniteMPO{<:MPOTensor})
185185 A, left_virtualspace (mpo1, i) ⊕ left_virtualspace (mpo2, i),
186186 left_virtualspace (mpo1, i)
187187 )
188- F₂ = leftnull (F₁)
188+ F₂ = left_null (F₁)
189189 @assert _lastspace (F₂) == left_virtualspace (mpo2, i)'
190190 @plansor O[- 1 ; - 3 - 4 - 2 ] := F₁[- 1 ; 1 ] * O₁[1 - 2 ; - 3 - 4 ] +
191191 F₂[- 1 ; 1 ] * O₂[1 - 2 ; - 3 - 4 ]
192192
193193 # making sure that the new operator is "full rank"
194- L, O = rightorth ! (O)
194+ L, O = lq_compact ! (O)
195195 mpo[i] = transpose (O, ((1 , 4 ), (2 , 3 )))
196196 end
197197
@@ -247,7 +247,7 @@ function Base.:*(mpo::FiniteMPO, mps::FiniteMPS)
247247 Fᵣ = fuser (A, right_virtualspace (mps, i), right_virtualspace (mpo, i))
248248 return _fuse_mpo_mps (mpo[i], A1, Fₗ, Fᵣ)
249249 end
250- trscheme = truncbelow ( eps (real (T)))
250+ trscheme = trunctol (; atol = eps (real (T)))
251251 return changebonds! (FiniteMPS (A2), SvdCut (; trscheme); normalize = false )
252252end
253253function Base.:* (mpo:: InfiniteMPO , mps:: InfiniteMPS )
@@ -392,8 +392,8 @@ function Base.isapprox(
392392end
393393
394394@doc """
395- swap(mpo::FiniteMPO, i::Integer; inv::Bool=false, alg=SDD (), trscheme)
396- swap!(mpo::FiniteMPO, i::Integer; inv::Bool=false, alg=SDD (), trscheme)
395+ swap(mpo::FiniteMPO, i::Integer; inv::Bool=false, alg=Defaults.alg_svd (), trscheme)
396+ swap!(mpo::FiniteMPO, i::Integer; inv::Bool=false, alg=Defaults.alg_svd (), trscheme)
397397
398398Compose the mpo with a swap gate applied to indices `i` and `i + 1`, effectively creating an
399399operator that acts on the Hilbert spaces with those factors swapped.
@@ -405,7 +405,7 @@ swap(mpo::FiniteMPO, i::Integer; kwargs...) = swap!(copy(mpo), i; kwargs...)
405405function swap! (
406406 mpo:: FiniteMPO{<:MPOTensor} , i:: Integer ;
407407 inv:: Bool = false ,
408- alg = SDD (), trscheme = truncbelow ( eps (real (scalartype (mpo)))^ (4 / 5 ))
408+ alg = Defaults . alg_svd (), trscheme = trunctol (; atol = eps (real (scalartype (mpo)))^ (4 / 5 ))
409409 )
410410 O₁, O₂ = mpo[i], mpo[i + 1 ]
411411
@@ -417,7 +417,7 @@ function swap!(
417417 τ[- 3 - 6 ; 4 5 ] * O₁[- 2 4 ; 2 1 ] * O₂[1 5 ; 3 - 5 ] * τ' [2 3 ; - 1 - 4 ]
418418 end
419419
420- U, S, Vᴴ, = tsvd ! (O₂₁; alg, trunc = trscheme)
420+ U, S, Vᴴ = svd_trunc ! (O₂₁; alg, trunc = trscheme)
421421 sqrtS = sqrt (S)
422422 @plansor mpo[i][- 1 - 2 ; - 3 - 4 ] := U[- 3 - 1 - 2 ; 1 ] * sqrtS[1 ; - 4 ]
423423 @plansor mpo[i + 1 ][- 1 - 2 ; - 3 - 4 ] := sqrtS[- 1 ; 1 ] * Vᴴ[1 ; - 3 - 4 - 2 ]
0 commit comments