Skip to content

Conversation

@JoeyT1994
Copy link
Collaborator

This PR setsAbstractBeliefPropagationCache <: AbstractITensorNetwork so that functionality defined on that type can be utilized.

Specifically it allows accession of the tensors in the tensor network inside a bpc::AbstractBeliefPropagationCache via bps[v] and operations that were previously forwarded onto the network to immediately work (finding indices etc). Extra tests are added in test/test_beliefpropagation.jl.

Setting of the tensors inside the cache via bpc[v] = some_itensor is disabled just to the fact it may affect partitioning and message tensor information. Currently a set_index_preserve_graph version is supported, although maybe this should be changed to set_index_preserve_graph_and_messages so it is explicit to the user what they are doing.

Most importantly, this PR will allow us to more naturally use the BeliefPropagationCache representing say <x|A|y> in Problem types in NetworkSolvers without also requiring a separate copy of the state (|x>) to be passed around which is what the current implementation does.

@mtfishman mtfishman merged commit e429920 into ITensor:main May 12, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants