Alexander,
Brian expressed everything very well, and I am sure that your
contributions will be very much appreciated!
I worked on the tensor module[0] during the summer. At the moment, it
doesn't really deserve its name: We have implemented indexed objects
and implicit summation, but concepts like co- and contra-variance are
still missing. I don't have much hands on experience with index
gymnastics, so I decided it was better to delay those features.
However, I tried to make the implementation suitable for an extension to
such functionality. What I had in mind was that variance could be
implented in subclasses of the Idx class. Either like the GiNaCC VarIdx
class[1], or perhaps with separate classes ContraVarIdx and CoVarIdx.
If you implement your tensor objects based on IndexedBase, Indexed, Idx
and subclasses, an immediate benefit is that the code printers will be
able to produce low-level code for the contractions, e.g:
>>> n, m = symbols('n m', integer=True)
>>> A, x, y = map(IndexedBase, 'Axy')
>>> i = Idx('i', n)
>>> j = Idx('j', m)
>>> print ccode(A[i, j]*x[j], assign_to=y[i])
for (int i=0; i<n; i++){
y[i] = 0;
}
for (int i=0; i<n; i++){
for (int j=0; j<m; j++){
y[i] = A[j + i*m]*x[j] + y[i];
}
}
Do you think it will be possible to integrate your stuff easily? If
there are difficulties I am sure the people here at the Sympy list will
be willing to help.
Cheers,
Øyvind
[0] https://github.com/sympy/sympy/tree/master/sympy/tensor
[1] http://www.ginac.de/reference/classGiNaC_1_1varidx.html
--
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.