ITensor / ITensorNetworks.jl

A package with general tools for working with higher-dimensional tensor networks based on ITensor.
MIT License
56 stars 12 forks source link

Implement `inner(x,A,y)` for `TTN` via `BP`. #146

Closed b-kloss closed 6 months ago

b-kloss commented 6 months ago

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.

mtfishman commented 6 months ago

Closing in favor of first writing a better designed contract(::AbstractITensorNetwork) function (and logcontract(::AbstractITensorNetwork) function) based on BP.