Skip to content

Add OMEinsumContractionOrders extension for contraction-order optimization#209

Merged
mtfishman merged 1 commit into
mainfrom
mf/omeinsum-contraction-order-ext
Jul 2, 2026
Merged

Add OMEinsumContractionOrders extension for contraction-order optimization#209
mtfishman merged 1 commit into
mainfrom
mf/omeinsum-contraction-order-ext

Conversation

@mtfishman

Copy link
Copy Markdown
Member

Summary

Adds an OMEinsumContractionOrders extension so any of its optimizers (GreedyMethod, TreeSA, KaHyParBipartite, SABipartite, ExactTreewidth, ...) can be passed directly as the algorithm to optimize_evaluation_order/optimize_contraction_order. The extension dispatches on the abstract CodeOptimizer, so it forwards whichever optimizers the resolved OMEinsumContractionOrders version provides (including ExhaustiveSearch once released) with no per-optimizer wrapping. It builds an EinCode from the flattened product, calls optimize_code, and translates the returned NestedEinsum back into a nested contraction expression.

…ation

Adds an OMEinsumContractionOrders extension so any of its optimizers (`GreedyMethod`, `TreeSA`, `KaHyParBipartite`, `SABipartite`, `ExactTreewidth`, ...) can be passed directly as the algorithm to `optimize_evaluation_order`/`optimize_contraction_order`. The extension dispatches on the abstract `CodeOptimizer`, so it forwards whichever optimizers the resolved OMEinsumContractionOrders version provides (including `ExhaustiveSearch` once released) with no per-optimizer wrapping. It builds an `EinCode` from the flattened product, calls `optimize_code`, and translates the returned `NestedEinsum` back into a nested contraction expression.
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.58%. Comparing base (7e82c77) to head (4e94824).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
+ Coverage   74.35%   74.58%   +0.23%     
==========================================
  Files          29       30       +1     
  Lines        1505     1519      +14     
==========================================
+ Hits         1119     1133      +14     
  Misses        386      386              
Flag Coverage Δ
docs 24.07% <0.00%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman mtfishman enabled auto-merge (squash) July 2, 2026 22:37
@mtfishman mtfishman merged commit ca0d801 into main Jul 2, 2026
18 checks passed
@mtfishman mtfishman deleted the mf/omeinsum-contraction-order-ext branch July 2, 2026 22:49
mtfishman added a commit to ITensor/ITensorNetworksNext.jl that referenced this pull request Jul 2, 2026
## Summary

Enables OMEinsumContractionOrders optimizers (`TreeSA`, `GreedyMethod`,
`KaHyParBipartite`, ...) to be used as the contraction-order algorithm
in `contract_network`. A package extension adds a `contraction_order`
method for OMEinsumContractionOrders' `CodeOptimizer`, reusing the same
flattened-product optimization path as the built-in `Greedy`/`Optimal`.
Builds on the extension added in
ITensor/ITensorBase.jl#209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant