From a9215718500d812448d42b675f6a93946a03a3d5 Mon Sep 17 00:00:00 2001 From: ArrogantGao Date: Wed, 7 Aug 2024 19:22:36 +0800 Subject: [PATCH] add tests for ExactTreewidth solver with scalars --- test/treewidth.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/treewidth.jl b/test/treewidth.jl index 901e941..5313598 100644 --- a/test/treewidth.jl +++ b/test/treewidth.jl @@ -34,4 +34,10 @@ using Test, Random cc = contraction_complexity(optcode, size_dict) @test cc.sc == 7 @test decorate(eincode)(tensors...) ≈ decorate(optcode)(tensors...) + + eincode = OMEinsumContractionOrders.EinCode([['a', 'b'], ['a', 'c', 'd'], ['b', 'c', 'e'], ['e'], ['f'], Char[]], ['a', 'f']) + tensors = tensors ∪ fill(2.0,()) + optcode = optimize_exact_treewidth(optimizer, eincode, size_dict) + cc = contraction_complexity(optcode, size_dict) + @test decorate(eincode)(tensors...) ≈ decorate(optcode)(tensors...) end \ No newline at end of file