On Saturday, January 11, 2014 1:09:05 PM UTC-5, F. B. wrote: > > > > On Saturday, January 11, 2014 6:56:06 PM UTC+1, Comer wrote: >> >> >> In [*3*]: run RiemRicREinstein.py >> >> File "/Users/comerduncan/sympytensor/RiemRicREinstein.py", line 52 >> >> G(a,b) = Ric(a,b) -gR >> >> SyntaxError: can't assign to function call >> >> So, what's the problem? I should be able to dynamically define various >> new tensors from ones already defined, right? I've attached the version I >> am using now. >> > > This code is wrong python code. You cannot do assignments to function > calls in python, and this will never be possible as python is not a > functional language. Just do: > > G = Ric(a, b) - gR >
Oops! Thanks. I have checked that (G(a,b)*g(-a,-b)).contract_metric(g) gives -Ric(L_0, -L_0) as it should. I will continue to define some much loved tensors and see whether I run into any problems. I do have another question or two... I see the .data method. What is really needed is the ability to create data arrays constructed from symbols, indeed functions of various local coordinates. So far I have only seen numerical entries in the data... Can one put instead something like what symarray provides in place of the Minkowski metric? Comer -- 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 sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.