sympy__sympy-24152
Bug in expand of TensorProduct + Workaround + Fix
Verdict: the fix is stated in the issue (Tier A).
c_part, nc_part = tp.args_cnc() #added if len(nc_part)==1 and isinstance(nc_part[0], TensorProduct): #modified nc_part = (nc_part[0]._eval_expand_tensorproduct(), ) #modified add_args.append(Mul(*c_part)*Mul(*nc_part)) #modified
The text states the fix: “c_part, nc_part = tp.args_cnc() #added if len(nc_part)==1 and isinstance(nc_part[0], TensorProduct): #modified nc_part = (nc_part[0]._eval_expand_tensorproduct(), ) #mod…”
All SWE-bench Lite tasks · more sympy/sympy tasks · How the check works