Hey Aaron! Thanks for the tip, I posted the code on SO. But, I think that Kalevi solved the problem. I found the issue.
On Friday, November 6, 2015 at 5:54:36 PM UTC+1, Aaron Meurer wrote: > > 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 <[email protected] > <javascript:>> wrote: > > > > > > 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 = 2 > >> m = Manifold("M",dim) > >> patch = Patch("P",m) > >> system = CoordSystem('egg_carton', patch, ["u", "v"]) > >> u,v = system.coord_functions() > >> du,dv = system.base_oneforms() > >> metric = (sin(v)**2*sin(u)**2 + 1)*TensorProduct(dv, dv) +\ > >> (cos(v)**2*cos(u)**2 + 1)*TensorProduct(du, du) +\ > >> (-cos(2*v - 2*u)/8 + cos(2*v + 2*u)/8)*TensorProduct(du, > dv) > >> +\ > >> (-cos(2*v - 2*u)/8 + cos(2*v + 2*u)/8)*TensorProduct(dv, > du) > >> I can use any of the metric_to_* functions without getting the > ValueError. > >> > >> By the way, that metric expression, is from my code. My code produces > the > >> correct metric two form expression. But when I use it as argument for > any of > >> the metric_to_* functions, I get the ValueError. What gives ? > >> > >> I posted the question on SO : > >> > >> > >> > http://stackoverflow.com/questions/33545982/valueerror-using-sympy-diffgeom-when-using-metric-to-functions > > >> > > > > > > It is not clear how u, v, du, dv are constructed in your SO question. If > you > > could post srepr(u) and srepr(du), it might be possible to say more. > > > > -- > > 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] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at http://groups.google.com/group/sympy. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/sympy/35eb06db-64de-41d2-9b6d-292074724df3%40googlegroups.com. > > > > > > For more options, visit https://groups.google.com/d/optout. > -- 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 post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/445f6c36-76f5-495e-8f38-97e0f2a25812%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
