Ondrej,
I have taken the tensor.py script and have stripped out most of it,
wanting to see just how far it gets before crashing. Here is what I
have:
from sympy import exp, Symbol, sin, Rational, Derivative, dsolve
from sympy.core import Basic, Function
from sympy.matrices import Matrix
class Indexed(Basic):
def __init__(self, A, idxlist):
self._args = [A, idxlist]
def __str__(self):
r = str(self[0])
for idx in self[1]:
r+=str(idx)
return r
class Idx(Symbol):
def __init__(self, name, dim = 4, up = True):
Symbol.__init__(self, name)
#self._args.extend([dim,up])
self._name = name
self._dim = dim
self._up = up
def __str__(self):
if self._up:
r = "^"
else:
r = "_"
return r+self._name
@property
def up(self):
return Idx(self._name, self._dim, True)
@property
def dn(self):
return Idx(self._name, self._dim, False)
def values(self):
return range(self._dim)
mu = Idx("mu")
nu = Idx("nu") <<====== by the way this was "mu" in the orginal,so I
changed it.
i = Idx("i")
m = Idx("m")
k = Idx("k")
l = Idx("l")
g = Indexed(Symbol("A"), [mu,nu])
print g[i.up,m.up]
#print g
As you can see I deleted the schwarzschild metric stuff as I am only
interested in the indicial performance. This did not illuminate
anything really. Here is what I get when I run it:
debian:~/sympy-0.6.3> python examples/indexed.py
Traceback (most recent call last):
File "examples/indexed.py", line 62, in ?
print g[i.up,m.up]
TypeError: unsubscriptable object
I am hoping to see
im
g
although I did not use pprint..,
In any event, can you please explain a bit more about what you would
expect this example to produce?
Thanks.
Comer
On Mar 20, 4:47 pm, Ondrej Certik <[email protected]> wrote:
> >>http://code.google.com/p/sympy/issues/detail?id=16
>
> > I see. I am afraid that I am too new to this business to do much in
> > the way of developing the indicial stuff. I would be very appreciative
> > if you or the other developers in the know can get it done !!
>
> Sure, it will definitely happen sooner or later. But if you help with
> this, it will happen sooner. :)
>
>
>
> >> as you can see, it is a very old issue. :) So it just needs to be finished.
>
> >> I am very interested in sympy being useful for your research and maybe
> >> you'll find other ways that we can collaborate on this, see above.
>
> > Maybe we can. Let's just see how things go in the coming weeks with my
> > feeble attempts.
>
> Yes, if you can find ways to collaborate, then I can easily justify my
> time spent on this and get this done sooner.
>
> Currently my nearest plan with sympy is to get the new assumptions
> done and then integrating our fast cython core.
>
> Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---