You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm curious if opt_einsum can be generalized to let the user specify which inputs are the same, and use this info to produce a more optimal contraction?
Example:
importnumpyasnpA=np.random.normal(size=(3, 2))
B=np.random.normal(size=(2, 2))
deff(A, B):
AB=A @ BreturnAB @ AB.Tdeff_einsum(A, B):
returnnp.einsum('ij,jk,lk,zl->iz', A, B, B, A, optimize='optimal')
importopt_einsumopt_einsum.contract_path('ij,jk,lk,zl->iz', A, B, B, A, optimize='optimal')
i.e. doing 3 contractions instead of two (where in this case evaluating f in two contractions is indeed faster than evaluating f_einsum). I wonder if it's feasible to accept a list of input identifiers (in this case [0, 1, 1, 0]) and leverage it to compute the contraction faster? Thank you for consideration!
The text was updated successfully, but these errors were encountered:
Hello and thank you for the great library!
I'm curious if
opt_einsum
can be generalized to let the user specify which inputs are the same, and use this info to produce a more optimal contraction?Example:
gives
i.e. doing 3 contractions instead of two (where in this case evaluating
f
in two contractions is indeed faster than evaluatingf_einsum
). I wonder if it's feasible to accept a list of input identifiers (in this case[0, 1, 1, 0]
) and leverage it to compute the contraction faster? Thank you for consideration!The text was updated successfully, but these errors were encountered: