1
- function contract_mpo_mpo (M1:: MPO , M2:: MPO ; alg:: String = " densitymatrix" , kwargs... ):: MPO
1
+ function contract_mpo_mpo (M1:: MPO , M2:: MPO ; alg:: String = " densitymatrix" , kwargs... ):: MPO
2
2
if alg == " densitymatrix"
3
3
return contract_densitymatrix (M1, M2; kwargs... )
4
4
elseif alg == " fit"
5
5
return contract_fit (M1, M2; kwargs... )
6
6
elseif alg == " zipup"
7
- return ITensors. contract (M1, M2; alg = " zipup" , kwargs... )
7
+ return ITensors. contract (M1, M2; alg= " zipup" , kwargs... )
8
8
elseif alg == " naive"
9
- return ITensors. contract (M1, M2; alg = " naive" , kwargs... )
9
+ return ITensors. contract (M1, M2; alg= " naive" , kwargs... )
10
10
else
11
11
error (" Unknown algorithm: $alg " )
12
12
end
@@ -21,7 +21,7 @@ function apply(A::MPO, Ψ::MPO; alg::String="fit", cutoff::Real=1e-25, kwargs...
21
21
@warn " cutoff is too small for densitymatrix algorithm. Use fit algorithm instead."
22
22
end
23
23
AΨ = replaceprime (
24
- contract_mpo_mpo (A' , MPO (collect (Ψ)); alg, kwargs... ), 2 => 1 )
24
+ contract_mpo_mpo (A' , MPO (collect (Ψ)); alg, cutoff, kwargs... ), 2 => 1 )
25
25
MPO (collect (AΨ))
26
26
end
27
27
@@ -33,6 +33,6 @@ function apply(A::MPO, Ψ::MPS; alg::String="fit", cutoff::Real=1e-25, kwargs...
33
33
if alg == " densitymatrix" && cutoff <= 1e-10
34
34
@warn " cutoff is too small for densitymatrix algorithm. Use fit algorithm instead."
35
35
end
36
- AΨ = noprime .(contract_mpo_mpo (A, MPO (collect (Ψ)); alg, kwargs... ))
36
+ AΨ = noprime .(contract_mpo_mpo (A, MPO (collect (Ψ)); alg, cutoff, kwargs... ))
37
37
MPS (collect (AΨ))
38
38
end
0 commit comments