-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partitioned ITensorNetwork #126
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #126 +/- ##
==========================================
+ Coverage 72.55% 72.68% +0.12%
==========================================
Files 71 68 -3
Lines 4055 3935 -120
==========================================
- Hits 2942 2860 -82
+ Misses 1113 1075 -38 ☔ View full report in Codecov by Sentry. |
Okay I have made changes which avoid the if statements that were in the |
Okay I re-wrote it based on function callback like we said. Currently the |
Let's leave that for a future PR. This is definitely a big improvement to the BP code, and will make it a lot easier to implement more ambitious plans, like using BP in other functions like |
This PR utilizes the new
PartitionedGraph
structure fromNamedGraphs.jl
(see ITensor/NamedGraphs.jl#44) to re-write the belief propagation code.Specifcally, we can now define a
PartitionedITensorNetwork
simply viapitn = PartitionedGraph(itn, args....)
whereargs
are just some arguments on how to partition the network.The resulting data structure contains
itn
and partitioning information. This simplifies the nested data graph implementation we were using previously for a partitioned ITensorNetwork.The belief propagation code, examples and tests are now all re-written to reflect this and the code should be simpler. Message tensors are now just taken to be a map between the edges of
partitioned_graph(pitn)
andVector{ITensor}
. Partitioning information is contained entirely inpitn
.Lots of the code in
src/partition.jl
has been deleted as it is redundant now. Code has only been kept when it is relevant toapprox_itensornetwork.jl
which has not been re-written with the new formalism yet. This has all been moved to the foldersrc/approx_itensornetwork