Skip to content

Commit b6d0729

Browse files
authored
Merge pull request #19 from tensor4all/18-use-a-small-cutoff-as-a-default-value
Use a small cutff 1e-30 as a default value
2 parents 8a00e4a + 205cc9a commit b6d0729

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/contractMPO.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
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", cutoff::Real=1e-30, kwargs...)::MPO
22
if alg == "densitymatrix"
3-
return contract_densitymatrix(M1, M2; kwargs...)
3+
return contract_densitymatrix(M1, M2; cutoff, kwargs...)
44
elseif alg == "fit"
5-
return contract_fit(M1, M2; kwargs...)
5+
return contract_fit(M1, M2; cutoff, kwargs...)
66
elseif alg == "zipup"
7-
return ITensors.contract(M1, M2; alg="zipup", kwargs...)
7+
return ITensors.contract(M1, M2; alg="zipup", cutoff, kwargs...)
88
elseif alg == "naive"
9-
return ITensors.contract(M1, M2; alg="naive", kwargs...)
9+
return ITensors.contract(M1, M2; alg="naive", cutoff, kwargs...)
1010
else
1111
error("Unknown algorithm: $alg")
1212
end
1313

1414
end
1515

16-
function apply(A::MPO, Ψ::MPO; alg::String="fit", cutoff::Real=1e-25, kwargs...)::MPO
16+
function apply(A::MPO, Ψ::MPO; alg::String="fit", cutoff::Real=1e-30, kwargs...)::MPO
1717
if :algorithm keys(kwargs)
1818
error("keyword argument :algorithm is not allowed")
1919
end
@@ -26,7 +26,7 @@ function apply(A::MPO, Ψ::MPO; alg::String="fit", cutoff::Real=1e-25, kwargs...
2626
end
2727

2828

29-
function apply(A::MPO, Ψ::MPS; alg::String="fit", cutoff::Real=1e-25, kwargs...)::MPS
29+
function apply(A::MPO, Ψ::MPS; alg::String="fit", cutoff::Real=1e-30, kwargs...)::MPS
3030
if :algorithm keys(kwargs)
3131
error("keyword argument :algorithm is not allowed")
3232
end

0 commit comments

Comments
 (0)