227227Utility
228228===========================================================================================#
229229
230- function AC2(ψ:: InfiniteMPS , i:: Integer ; kind = :ACAR)
230+ function AC2(:: InfiniteChainStyle , ψ:: AbstractMPS , i:: Integer ; kind = :ACAR)
231231 if kind == :ACAR
232232 return ψ. AC[i] * _transpose_tail(ψ. AR[i + 1 ])
233233 elseif kind == :ALAC
276276
277277Base. eachindex(ψ:: InfiniteMPS ) = eachindex(ψ. AL)
278278Base. eachindex(l:: IndexStyle , ψ:: InfiniteMPS ) = eachindex(l, ψ. AL)
279- eachsite(ψ:: InfiniteMPS ) = PeriodicArray(eachindex(ψ))
279+ eachsite(:: InfiniteChainStyle , ψ:: AbstractMPS ) = PeriodicArray(eachindex(ψ))
280280
281281Base. checkbounds(:: Type{Bool} , ψ:: InfiniteMPS , i:: Integer ) = true
282282
@@ -294,87 +294,38 @@ physicalspace(ψ::InfiniteMPS, n::Integer) = physicalspace(ψ.AL[n])
294294# return ProductSpace{S}(space.(Ref(t), Base.front(Base.tail(TensorKit.allind(t)))))
295295# end
296296
297- TensorKit. norm(ψ:: InfiniteMPS ) = norm(ψ. AC[1 ])
298- function TensorKit. normalize!(ψ:: InfiniteMPS )
297+ TensorKit. norm(:: InfiniteChainStyle , ψ:: AbstractMPS ) = norm(ψ. AC[1 ])
298+ function TensorKit. normalize!(:: InfiniteChainStyle , ψ:: AbstractMPS )
299299 normalize!.(ψ. C)
300300 normalize!.(ψ. AC)
301301 return ψ
302302end
303303
304- function TensorKit. dot(ψ₁:: InfiniteMPS , ψ₂:: InfiniteMPS ; krylovdim = 30 )
304+ function TensorKit. dot(:: InfiniteChainStyle , ψ₁:: AbstractMPS , ψ₂:: AbstractMPS ; krylovdim = 30 )
305305 init = similar(ψ₁. AL[1 ], _firstspace(ψ₂. AL[1 ]) ← _firstspace(ψ₁. AL[1 ]))
306306 randomize!(init)
307307 val, = fixedpoint(
308308 TransferMatrix(ψ₂. AL, ψ₁. AL), init, :LM, Arnoldi(; krylovdim = krylovdim)
309309 )
310310 return val
311311end
312- function Base. isapprox(ψ₁:: InfiniteMPS , ψ₂:: InfiniteMPS ; kwargs... )
313- return isapprox(dot(ψ₁, ψ₂), 1 ; kwargs... )
314- end
315312
316313#= ==========================================================================================
317314Fixedpoints
318315===========================================================================================#
319316
320- """
321- l_RR(ψ, location)
322-
323- Left dominant eigenvector of the `AR`-`AR` transfermatrix.
324- """
325- l_RR(ψ:: InfiniteMPS , loc:: Int = 1 ) = adjoint(ψ. C[loc - 1 ]) * ψ. C[loc - 1 ]
326-
327- """
328- l_RL(ψ, location)
329-
330- Left dominant eigenvector of the `AR`-`AL` transfermatrix.
331- """
332- l_RL(ψ:: InfiniteMPS , loc:: Int = 1 ) = ψ. C[loc - 1 ]
333-
334- """
335- l_LR(ψ, location)
336-
337- Left dominant eigenvector of the `AL`-`AR` transfermatrix.
338- """
339- l_LR(ψ:: InfiniteMPS , loc:: Int = 1 ) = ψ. C[loc - 1 ]'
340-
341- """
342- l_LL(ψ, location)
343-
344- Left dominant eigenvector of the `AL`-`AL` transfermatrix.
345- """
346- function l_LL(ψ:: InfiniteMPS{A} , loc:: Int = 1 ) where {A}
347- return isomorphism(storagetype(A), left_virtualspace(ψ, loc), left_virtualspace(ψ, loc))
317+ l_RR(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = 1 ) = adjoint(ψ. C[loc - 1 ]) * ψ. C[loc - 1 ]
318+ l_RL(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = 1 ) = ψ. C[loc - 1 ]
319+ l_LR(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = 1 ) = ψ. C[loc - 1 ]'
320+ function l_LL(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = 1 )
321+ return isomorphism(storagetype(eltype(ψ)), left_virtualspace(ψ, loc), left_virtualspace(ψ, loc))
348322end
349323
350- """
351- r_RR(ψ, location)
352-
353- Right dominant eigenvector of the `AR`-`AR` transfermatrix.
354- """
355- function r_RR(ψ:: InfiniteMPS{A} , loc:: Int = length(ψ)) where {A}
324+ function r_RR(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = length(ψ))
356325 return isomorphism(
357- storagetype(A ), right_virtualspace(ψ, loc), right_virtualspace(ψ, loc)
326+ storagetype(eltype(ψ) ), right_virtualspace(ψ, loc), right_virtualspace(ψ, loc)
358327 )
359328end
360-
361- """
362- r_RL(ψ, location)
363-
364- Right dominant eigenvector of the `AR`-`AL` transfermatrix.
365- """
366- r_RL(ψ:: InfiniteMPS , loc:: Int = length(ψ)) = ψ. C[loc]'
367-
368- """
369- r_LR(ψ, location)
370-
371- Right dominant eigenvector of the `AL`-`AR` transfermatrix.
372- """
373- r_LR(ψ:: InfiniteMPS , loc:: Int = length(ψ)) = ψ. C[loc]
374-
375- """
376- r_LL(ψ, location)
377-
378- Right dominant eigenvector of the `AL`-`AL` transfermatrix.
379- """
380- r_LL(ψ:: InfiniteMPS , loc:: Int = length(ψ)) = ψ. C[loc] * adjoint(ψ. C[loc])
329+ r_RL(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = length(ψ)) = ψ. C[loc]'
330+ r_LR(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = length(ψ)) = ψ. C[loc]
331+ r_LL(:: InfiniteChainStyle , ψ:: AbstractMPS , loc:: Int = length(ψ)) = ψ. C[loc] * adjoint(ψ. C[loc])
0 commit comments