2
$\begingroup$

I'm using the symbolic package sympy to store a $10 \times 10$ antisymmetric matrix in terms of $10$ variables, and then at every iteration step, I substitute numerical values into the entries of the matrix. however, it's taking too long to substitute values because the symbolic expressions are very complicated. It takes around $100$ seconds for the every substitution and I need at least $10,000$ iterations to get a meaningful result.

So, I was wondering whether there is any speedy way to substitute the values. Right now, I'm just substituting values into the top diagonal half of the matrix, which halves the number of substitutions, but it's still taking too long.

Thanks!

  • 0
    It's perfectly okay to ask here. Another place you might ask is at ask.sagemath.org. Sage is built on Python and it has sympy built into it as well. Therefore, the percentage of users there that might use this same software would be much higher. If nothing else, maybe using Sage itself is better. I have no idea, but they could tell you there. Also, you'd probably want to provide a bit more detail... what formulas (at least one example).2012-07-13
  • 2
    This issue does not look like it has much to do with the matrix. You want to evaluate 45 complicated expressions 10000 times. It is natural to look at those 45 expressions to see if they have common parts, and if they do, eliminate the repetition.2012-07-13
  • 1
    If you provide more information about the matrix you're trying to generate and what it's entries are supposed to mean, perhaps people here could help with a more direct attack on speeding it up?2012-07-18
  • 0
    Can you do the computation numerically instead of symbolically?2012-12-31

1 Answers 1