Ask Your Question

Revision history [back]

I fully agree with @tmonteil's answer, in particular

  • avoiding Sage's SymbolicRing should be a huge gain

  • using RDF should be much faster than RR too.

Two small additional comments:

  • for pi, I would suggest using RDF.pi()

  • instead of the norm, using the square of the norm saves extracting square roots, eg instead of testing whether sqrt(x^2+y^2) < 2, test whether x^2 + y^2 < 4. (You should test whether this really saves you time... it could be that the norm method calls faster code than code you might write yourself for norm_squared)