I don't know about autowrap but there can be improvements to the handling of symbolic matrices in SymPy. It sounds like you are referring to expression blowup. There has been some work to improve that in matrix multiplication and matrix powers: https://github.com/sympy/sympy/pull/17247
What kind of operation are you doing and what does a typical matrix look like? If you are talking about expression blowup then the asymptotic performance of that is so bad that switching to another language might not help at all. -- Oscar On Fri, 6 Dec 2019 at 01:53, Matt Braunstein <[email protected]> wrote: > > I'm trying to write some symbolic matrices that include complex numbers. But > the variables are all real numbers.There are several linear algebra > operations performed on these matrices. With just a few of these operations, > the size of the matrix explodes beyond being useful to maintain within > Python. I'm trying to port these computations to C. However, it seems that > the autowrap function creates code that requires numeric values for all > variable. I need to maintain the symbolic representation through these > computations, because they are then generating optimization goals for model > fitting. > > I found symengine, which seems to do this and is compatible with Sympy. But > their variables are only represented as complex numbers. All my variable are > real numbers. Formulating the equations with complex variables results in > dramatically more complex computations. > > Is there a way to keep symbolic representation, but compute in C with Sympy > and autowrap? I thought that creating a custom printer might be a solution, > but I'm not sure how to go about writing something to do this. I would > appreciate any advice/help on this. Thanks. > > -- > 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/f939319f-474e-4a90-a6d9-3ea11b13fbdd%40googlegroups.com. -- 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/CAHVvXxS4MKVDWnjpnmoJn_qx61c2doA7mvZF3KAJXH3j%2BSEJEA%40mail.gmail.com.
