ITensorNetworks.jl
ITensorNetworks.jl copied to clipboard
Use DataGraphs in ttn_svd and other changes
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, andcompress_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_coefslogic 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 usesteiner_treebut it seemed to have an issue with some disconnected components being left in the output. - Remove
coefficient_typefunction barrier inttn_svdsince now that function just calls out to other functions anyway. - Simplify
MatElemtype keeping only code used forOpSumtoTTNconversion. Will probably deleteMatElemsoon anyway in favor ofSparseArray.