I wrote upgraded versions of both the 'dp' (i.e. optimal), greedy and random-greedy pathfinders for cotengra: https://github.com/jcmgray/cotengra/blob/main/cotengra/pathfinders/path_basic.py.
They have some main advantages:
- they perform various simplifications first, namely:
- ignore any indices that appear in all terms
- combine any repeated indices within a single term
- reduce any non-output indices that only appear on a single term
- combine any scalar terms
- combine any tensors with matching indices (hadamard products)
- they are faster thanks to a tweak of how the indices are counted .
- they have drop-in rust versions in https://github.com/jcmgray/cotengrust that are even faster
- the random greedy algorithm produces better paths by sampling an 'alpha' parameter.
Some disadvantages:
- no
memory_limit support
- probably some other minor options dropped for
random-greedy.
Including dropping the current optimal (non-dp) implementation these should fix #99, #112, #114, #167, #189, #243, #248, #233, #94.
Raising this issue to:
- gauge interest in porting these over to
opt_einsum to replace greedy, dp, optimal and possibly random-greedy,
- see whether e.g. changes like dropping the
memory_limit kwarg would be acceptable.
- see if anyone would like to take on this task!
I wrote upgraded versions of both the 'dp' (i.e. optimal), greedy and random-greedy pathfinders for
cotengra: https://github.com/jcmgray/cotengra/blob/main/cotengra/pathfinders/path_basic.py.They have some main advantages:
Some disadvantages:
memory_limitsupportrandom-greedy.Including dropping the current
optimal(non-dp) implementation these should fix #99, #112, #114, #167, #189, #243, #248, #233, #94.Raising this issue to:
opt_einsumto replacegreedy,dp,optimaland possiblyrandom-greedy,memory_limitkwarg would be acceptable.