Closed
Description
Cases
Failed to pass these two tests if change Float64
to ComplexF64
.
TensorInference.jl/test/belief.jl
Lines 46 to 79 in d914583
Also there is some problem in using BP to approximately contracting MPS yuqingrong/IsoPEPS.jl#25
Possible bugs
It seems that it is because cost_and_gradient
is used to calculate a tensor network without certain tensors:
TensorInference.jl/src/belief.jl
Line 82 in d914583
One needs to do conj
instead of direct usage:
using OMEinsum
A = rand(ComplexF64, 4, 4)
B = rand(ComplexF64, 4, 4)
C = rand(ComplexF64, 4, 4)
code = ein"(ij, jk), ki->"
cost, grad = cost_and_gradient(code, (A, B, C))
@assert !isapprox(ein"ij, ij->"(grad[1], A)[], cost[])
@assert isapprox(ein"ij, ij->"(conj(grad[1]), A)[], cost[])
Fix
After adding conj
in the BP part and marginal
function:
Line 80 in d914583
the first test aforementioned is passed, but the second one ("belief propagation on circle") still fail. There might be some other issues.
Metadata
Metadata
Assignees
Labels
No labels