If you convert the scalar into a sympy matrix, like sympy.Matrix([scalar]) subtraction will work. I believe it worked for me once.
On Fri 21. Oct 2022 at 20:59, Peter Bleackley < [email protected]> wrote: > I have an expression that involves a dot product, and I want to generate > aesara code from it. Unfortunately, aesara_function does not seem to > recognise DotProduct objects (I get a KeyError expection from the mapping > dictionary). I have tried using MatMul instead, but elsewhere in the > expression I need to subtract a scalar from the dot product, and sympy will > not subract a scalar from a matrix expression. > > Can anybody suggest what I should do about this? > > -- > 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 on the web visit > https://groups.google.com/d/msgid/sympy/12f74a20-d8ed-47c8-9d68-38339ff36922n%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/12f74a20-d8ed-47c8-9d68-38339ff36922n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Best regards, Peter Stahlecker -- 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 on the web visit https://groups.google.com/d/msgid/sympy/CABKqA0bKrG6-QbbyyNNGMGioHdf8zC%3DdCDyqkhrf4cc0yM6p_w%40mail.gmail.com.
