@@ -380,8 +380,9 @@ for it:
380
380
mutable struct EntanglementObserver <: AbstractObserver
381
381
end
382
382
383
- function ITensors. measure! (o:: EntanglementObserver ; bond, psi, kwargs... )
384
- U,S,V = svd (psi[bond], uniqueinds (psi[bond],psi[bond+ 1 ]))
383
+ function ITensors. measure! (o:: EntanglementObserver ; bond, psi, half_sweep, kwargs... )
384
+ wf_center, other = half_sweep== 1 ? (psi[bond+ 1 ],psi[bond]) : (psi[bond],psi[bond+ 1 ])
385
+ U,S,V = svd (wf_center, uniqueinds (wf_center,other))
385
386
SvN = 0.0
386
387
for n= 1 : dim (S, 1 )
387
388
p = S[n,n]^ 2
@@ -402,8 +403,9 @@ using ITensors
402
403
mutable struct EntanglementObserver <: AbstractObserver
403
404
end
404
405
405
- function ITensors. measure! (o:: EntanglementObserver ; bond, psi, kwargs... )
406
- U,S,V = svd (psi[bond], uniqueinds (psi[bond],psi[bond+ 1 ]))
406
+ function ITensors. measure! (o:: EntanglementObserver ; bond, psi, half_sweep, kwargs... )
407
+ wf_center, other = half_sweep== 1 ? (psi[bond+ 1 ],psi[bond]) : (psi[bond],psi[bond+ 1 ])
408
+ U,S,V = svd (wf_center, uniqueinds (wf_center,other))
407
409
SvN = 0.0
408
410
for n= 1 : dim (S, 1 )
409
411
p = S[n,n]^ 2
0 commit comments