diff --git a/src/abstract_tensor_train.jl b/src/abstract_tensor_train.jl index 67a716d..594ed4d 100644 --- a/src/abstract_tensor_train.jl +++ b/src/abstract_tensor_train.jl @@ -176,9 +176,11 @@ end Compute the normalization ``Z=\\sum_{x^1,\\ldots,x^L} A^1(x^1)\\cdots A^L(x^L)`` """ -function normalization(A::AbstractTensorTrain; l = accumulate_L(A), r = accumulate_R(A)) +function normalization(A::AbstractTensorTrain; l = accumulate_L(A)) z = tr(l[end]) - @assert tr(r[begin]) ≈ z "z=$z, got $(tr(r[begin])), A=$A" # sanity check + @debug let r = accumulate_R(A) + @assert tr(r[begin]) ≈ z "z=$z, got $(tr(r[begin])), A=$A" # sanity check + end z end @@ -300,4 +302,4 @@ function LinearAlgebra.normalize!(A::AbstractTensorTrain) a ./= Z^(1/L) end c + log(Z) -end \ No newline at end of file +end