Remove approximate-contract (density_matrix / ttn_svd) algorithms#329
Merged
Remove approximate-contract (density_matrix / ttn_svd) algorithms#329
Conversation
6dec7e1 to
e16b951
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
==========================================
+ Coverage 71.23% 72.51% +1.27%
==========================================
Files 80 71 -9
Lines 4001 3496 -505
==========================================
- Hits 2850 2535 -315
+ Misses 1151 961 -190
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e16b951 to
1920b44
Compare
Delete the entire src/contract_approx/ module (8 files, ~1200 lines),
its two test files (test/test_binary_tree_partition.jl,
test/test_contract_deltas.jl), and the dead ITensorNetworksGraphsFlowsExt
extension that only served it. Drop the GraphsFlows weakdep + extension
entry from the root Project.toml; GraphsFlows stays as a direct test-time
dep for the graph mincut test in test/test_itensornetwork.jl.
Also drop the `contract(tn; alg = "density_matrix" | "ttn_svd")` dispatch
from src/contract.jl, which was a thin forwarder to contract_approx. The
remaining `alg = "exact"` dispatch is unaffected.
A few imports that were previously made available to other parts of the
package as a side effect of contract_approx/*.jl's `using` clauses now
need to be imported explicitly by the files that actually use them:
- Graphs: rem_vertex! in src/treetensornetworks/opsum_to_ttn/opsum_to_ttn.jl
- ITensors: inds in src/abstractitensornetwork.jl
- ITensors: noncommoninds in src/apply.jl
- NamedGraphs.GraphsExtensions: disjoint_union in src/formnetworks/{linear,bilinear}formnetwork.jl
Bump to 0.17.0 (breaking, pre-1.0 minor bump) and update pinned
ITensorNetworks compat in test/, docs/, and examples/ Project.toml.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1920b44 to
b8cfece
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delete the entire
src/contract_approx/module (8 files, ~1200 lines) and the deadITensorNetworksGraphsFlowsExtextension that only served it.Breaking:
contract(tn; alg = "density_matrix")andcontract(tn; alg = "ttn_svd")are removed.contract_approxfunction and all of its supporting machinery (path_graph_structure,binary_tree_structure,_partition,_mincut_partitions,_contract_deltas,_rem_leaf_vertices!, …) are gone.GraphsFlowsis no longer a weak-dep / extension trigger ofITensorNetworks. It remains a direct test-time dep for the graph mincut test intest/test_itensornetwork.jl.What stays:
contract(tn; alg = "exact")and the rest of the contraction pipeline (TensorOperations / OMEinsumContractionOrders extensions) are unaffected.Incidental import cleanups
A few imports were previously available inside
ITensorNetworksas a side effect ofusingclauses insrc/contract_approx/*.jl. They are now imported directly by the files that actually use them:Graphs: rem_vertex!—src/treetensornetworks/opsum_to_ttn/opsum_to_ttn.jlITensors: inds—src/abstractitensornetwork.jlITensors: noncommoninds—src/apply.jlNamedGraphs.GraphsExtensions: disjoint_union—src/formnetworks/linearformnetwork.jl,src/formnetworks/bilinearformnetwork.jlVersion
Bumps to
0.17.0(pre-1.0 minor bump = breaking) and updates pinnedITensorNetworkscompat intest/,docs/, andexamples/Project.toml.