Skip to content

Commit

Permalink
Ignore outer products in Exhaustive breadth-first search
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jan 18, 2024
1 parent a29e672 commit cf6f2af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Optimizers/Exhaustive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function exhaustive_breadthfirst(
outer::Bool = false,
hashyperinds = !isempty(hyperinds(expr)),
) where {L,Metric}
outer && error("Outer products not supported yet")
hashyperinds && error("Hyperindices not supported yet")

cost_fac = maximum(values(expr.size))
Expand Down Expand Up @@ -119,7 +118,8 @@ function exhaustive_breadthfirst(
# if not disjoint, then ta and tb contain at least one common tensor
isdisjoint(ta, tb) || continue

get(costs, ta tb, cost_cur) > cost_prev || continue
# outer products do not generally improve contraction path
!outer && isdisjoint(indices[ta], indices[tb]) && continue

# new candidate contraction
tc = ta tb # aka Q in the paper
Expand Down

0 comments on commit cf6f2af

Please sign in to comment.