[sympy] Re: Determining Christoffel Symbols and Curvature Tensors for a Flat Sphere using SymPy.Diffgeom

2015-11-06 Thread Kalevi Suominen
On Thursday, November 5, 2015 at 3:56:09 PM UTC+2, Imran Ali wrote: > > If I simply hard code each metric, every thing works properly. For > example, take egg carton surface, > > from sympy.diffgeom import Manifold, Patch, CoordSystem, TensorProduct > from sympy import sin,cos > dim

Re: [sympy] Re: Determining Christoffel Symbols and Curvature Tensors for a Flat Sphere using SymPy.Diffgeom

2015-11-06 Thread Aaron Meurer
What you should do is post the complete code to stackoverflow, as you have done here. Aaron Meurer On Fri, Nov 6, 2015 at 10:51 AM, Kalevi Suominen wrote: > > > On Thursday, November 5, 2015 at 3:56:09 PM UTC+2, Imran Ali wrote: >> >> If I simply hard code each metric, every

Re: [sympy] Powers and complex numbers

2015-11-06 Thread Paul Royik
I decided to use "cleaner" solution: create a custom Pow subclass that evaluates. What method should I override? On Wednesday, November 4, 2015 at 9:25:17 PM UTC+2, Aaron Meurer wrote: > > You can generally do this sort of thing using replace(). > Unfortunately, the pattern matcher doesn't

Re: [sympy] Powers and complex numbers

2015-11-06 Thread Aaron Meurer
You want to override eval. Take a look at http://docs.sympy.org/latest/guide.html#functions for an example. Aaron Meurer On Fri, Nov 6, 2015 at 1:42 PM, Paul Royik wrote: > I decided to use "cleaner" solution: create a custom Pow subclass that > evaluates. What method

Re: [sympy] Powers and complex numbers

2015-11-06 Thread Paul Royik
Thank you. How to override behaviour, so that above expression, i.e.(-1)**(2/3).is_real outputs True? On Friday, November 6, 2015 at 9:51:39 PM UTC+2, Aaron Meurer wrote: > > You want to override eval. Take a look at > http://docs.sympy.org/latest/guide.html#functions for an example. > > Aaron