On Wednesday, 30 July 2025 at 19:55:29 UTC+2 [email protected] wrote: It might be possible to work around this with the optimizations flag, but I'd say cse should just be updated to treat derivatives as separate symbols.
I agree that this would be preferable. In the mean time I typically find all Derivative and AppliedUndef instances, create dummies for them and substitute them before cse (substituting the derivatives first), and then do a final back-substitution. This is probably what we would do internally. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/sympy/0852394e-adb7-4190-9d1d-ed4f26f89306n%40googlegroups.com.
