fr., 12.11.2010 kl. 11.19 -0700, skrev Aaron Meurer:
> If I understand you correctly, you will implicitly sum over Symbol
> indices and loop over Idx indices, right? If so, that sounds like a
> good idea, except why do you want to use Symbol instead of creating a
> new class?
Well, maybe a new class is better, I'm not sure. The idea was to allow
implicit summation with repeated indices of class Idx as it is done
today, and use something else for indices that are not subject to
implicit summation.
>
> I'm also confused about creating one class vs. another. What would
> happen in your model if you mix both, like
>
> >>> i = Idx('i')
> >>> j = Symbol('j', dimension=N, integer=True) # Or whatever you end up doing
> >>> A[i, j]
> ???
That's a good question. Maybe there should only be one Indexed class
that can handle indices of various types. It may be the cleanest
approach. If I recall correctly this is the way covariant and
contravariant indices are implemented in GiNaC: In addition to an Idx
class, GiNaC has a VarIdx class for indices with given variance. We
should also be able to follow this approach for variance, and it may be
a good approach for elemental indices as well.
To follow that approach, I think we are going to need
1) some representation of elemental indices (Symbol? ElemIdx?
FixedIdx? ...)
2) improvements to sympy.tensor.indexed.Indexed
3) some changes in sympy.tensor.index_methods
4) printing of Sum in the code printers
Øyvind
>
> Aaron Meurer
--
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.