ITensorNetworks.jl icon indicating copy to clipboard operation
ITensorNetworks.jl copied to clipboard

Use DataGraphs in ttn_svd and other changes

Open emstoudenmire opened this issue 1 year ago • 0 comments

This PR contains mostly minor but helpful improvements to the ttn_svd function and its sub functions.

Here is a list of changes, from most to least significant:

  • Use DataGraphs to hold the bond coefficients and sparse/symbolic vertex tensors returned from make_symbolic_ttn
  • Reduce the number of arguments going into make_symbolic_ttn, svd_bond_coefs, and compress_ttn. (They weren't really sharing as much state as the code made it look, even compared to the current code following the last PR.)
  • Significantly simplify svd_bond_coefs logic to just loop over all edges (it does a trivially parallel task of just forming and SVD'ing each edge coefficient matrix) rather than previous more complicated logic involving vertices and graph analysis.
  • Removed other unneeded dictionaries.
  • Use better graph analysis (vertex_path) to check which terms cross a given vertex. Could use steiner_tree but it seemed to have an issue with some disconnected components being left in the output.
  • Remove coefficient_type function barrier in ttn_svd since now that function just calls out to other functions anyway.
  • Simplify MatElem type keeping only code used for OpSum to TTN conversion. Will probably delete MatElem soon anyway in favor of SparseArray.

emstoudenmire avatar May 12 '24 19:05 emstoudenmire