This implements inner(x,A,y) for x,A,y all AbstractTTN with the same underlying graph, passing through the BP-backend. It addresses a performance issue of the previous implementation for certain TTN, leading to higher than necessary scaling in some situations (due to the traversal order). Thanks @JoeyT1994 for providing the contract_with_BP code.
Tests have been added to test_forms.jl to verify the correctness of the implementation.
This is not intended as a complete overhaul of the current implementations of inner, expect etc, which could be addressed in future PRs.
Closing in favor of first writing a better designed contract(::AbstractITensorNetwork) function (and logcontract(::AbstractITensorNetwork) function) based on BP.
This implements
inner(x,A,y)
forx,A,y
allAbstractTTN
with the same underlying graph, passing through the BP-backend. It addresses a performance issue of the previous implementation for certainTTN
, leading to higher than necessary scaling in some situations (due to the traversal order). Thanks @JoeyT1994 for providing thecontract_with_BP
code. Tests have been added totest_forms.jl
to verify the correctness of the implementation.This is not intended as a complete overhaul of the current implementations of
inner
,expect
etc, which could be addressed in future PRs.