From b0ca2ea93ace7b71bc89f6d82018a8d445eac157 Mon Sep 17 00:00:00 2001 From: Matthew Fishman Date: Mon, 13 Jul 2026 15:04:10 -0400 Subject: [PATCH] Support ITensorBase 0.12 Widens the ITensorBase compat to include 0.12. ITensorBase 0.12 removed the `Optimal` contraction-order backend (https://github.com/ITensor/ITensorBase.jl/pull/219), so the `contract_network` test that exercised `ITensorBase.Optimal` now uses OMEinsumContractionOrders' `ExhaustiveSearch`, which runs the same netcon algorithm. This also drops the test's now-unused TensorOperations dependency. Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 4 ++-- test/Project.toml | 4 +--- test/test_contract_network.jl | 9 ++++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index 2af51ad..b8cbd26 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ITensorNetworksNext" uuid = "302f2e75-49f0-4526-aef7-d8ba550cb06c" -version = "0.9.6" +version = "0.9.7" authors = ["ITensor developers and contributors"] [workspace] @@ -36,7 +36,7 @@ Combinatorics = "1" DataGraphs = "0.5" Dictionaries = "0.4.5" Graphs = "1.13.1" -ITensorBase = "0.10, 0.11" +ITensorBase = "0.10, 0.11, 0.12" LinearAlgebra = "1.10" MacroTools = "0.5.16" MatrixAlgebraKit = "0.6" diff --git a/test/Project.toml b/test/Project.toml index 0e5767a..c0b6ebf 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -19,7 +19,6 @@ SparseArraysBase = "0d5efcca-f356-4864-8770-e1ed8d78f208" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a" -TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources.ITensorNetworksNext] @@ -32,7 +31,7 @@ DataGraphs = "0.5" Dictionaries = "0.4.5" GradedArrays = "0.13.2" Graphs = "1.13.1" -ITensorBase = "0.10, 0.11" +ITensorBase = "0.10, 0.11, 0.12" ITensorNetworksNext = "0.9" ITensorPkgSkeleton = "0.3.42" MatrixAlgebraKit = "0.6" @@ -45,5 +44,4 @@ SparseArraysBase = "0.10.4" StableRNGs = "1" Suppressor = "0.2.8" TensorAlgebra = "0.16, 0.17" -TensorOperations = "5.3.1" Test = "1.10" diff --git a/test/test_contract_network.jl b/test/test_contract_network.jl index 08927a0..67c65b2 100644 --- a/test/test_contract_network.jl +++ b/test/test_contract_network.jl @@ -1,11 +1,10 @@ using Graphs: edges, vertices -using ITensorBase: Greedy, Index, Optimal +using ITensorBase: Greedy, Index using ITensorNetworksNext: Exact, ITensorNetwork, LeftAssociative, contract_network, linkinds, siteinds, tensornetwork using NamedGraphs.GraphsExtensions: arranged_edges, incident_edges using NamedGraphs.NamedGraphGenerators: named_grid -using OMEinsumContractionOrders: GreedyMethod, TreeSA -using TensorOperations: TensorOperations +using OMEinsumContractionOrders: ExhaustiveSearch, GreedyMethod, TreeSA using Test: @test, @testset @testset "contract_network" begin @@ -20,7 +19,7 @@ using Test: @test, @testset ABCD_1 = contract_network([A, B, C, D]; alg = orderalg(LeftAssociative())) ABCD_2 = contract_network([A, B, C, D]; alg = orderalg(Greedy())) - ABCD_3 = contract_network([A, B, C, D]; alg = orderalg(Optimal())) + ABCD_3 = contract_network([A, B, C, D]; alg = orderalg(ExhaustiveSearch())) ABCD_4 = contract_network([A, B, C, D]; alg = orderalg(GreedyMethod())) ABCD_5 = contract_network([A, B, C, D]; alg = orderalg(TreeSA())) @test ABCD_1 == ABCD_2 == ABCD_3 @@ -40,7 +39,7 @@ using Test: @test, @testset z1 = contract_network(tn; alg = orderalg(LeftAssociative()))[] z2 = contract_network(tn; alg = orderalg(Greedy()))[] - z3 = contract_network(tn; alg = orderalg(Optimal()))[] + z3 = contract_network(tn; alg = orderalg(ExhaustiveSearch()))[] z4 = contract_network(tn; alg = orderalg(GreedyMethod()))[] z5 = contract_network(tn; alg = orderalg(TreeSA()))[]