according to Ginac-mini FAQ:
The indexed class (and most derived classes) is intended for tensor manipulation without >referring to a particular basis. Thus, the indexed class is well suited for calculations >involving (formally defined) tensor algebra of "non-integer-dimensional space". .... In that framework, unrolling ai*ai to a1^2+a2^2+a3^2+... is not possible, since the dimension >is not integer!
I am physicist (not a relativist one though).. but, is there something more useful than tensors representations (i.e tensor components) defined for integer indexes?!!!. Let us see... In two dimensions the tensor velocity vector V can be written in cartesian cordinates (x,y) with basis vectors (e.x,e.y) as: V.x e.x + V.y e.y but aren't we finally more interested in the values of the "components": V= [V.x ,V.y] ===> a matrix with 2 integer indices. But...let see in polar coordinates with basis vectors (e.r,e.theta) the same velocity vector can be written as V.r e.r + V.theta e.theta but aren't we finally more interested in the values of the "components": V= [V.r ,V.theta] ===> a matrix of 2 integer indices. but ....opps we always ended by looking at the multi-index arrays of integer indeces!!! It is because that I always want to get the components of tensors (which can be arranged as multidimensional arrays/matrices) is that I want to be able to unroll indexed objects. So I agree with the type of interest reported by another newbie to Ginac: (http://www.cebix.net/pipermail/ginac-list/2004-December/000576.html)
I'd like to know if is it possible to unroll indexed objects. As example, I would like to do something like this a_i a~i = (a_1)^2 + (a_2)^2 + (a_3)^2 + ... or just substituting a_i values in a_i * b~i a_i = =(1,0,0) a_i b~i -> b~1 Definitely I like to be able to do things like the above.
Chris mentioned to me two things that could be very useful in indexed expressions: 1) ex_to<numeric>(e.subs(lst(i==0,j==0))).to_double() This works in matrices but one should be abel to put numeric values inside indexed expressions and do matrix type operations... 2) expand_dummy_sum(const ex & e, bool subs_idx) there could be a similar function "expand_indexes" that expand summed and not summed indices. Example given ex e=indexed(A,i,j)*indexed(v,j) by applying the "expand_indices" function get: e=[[A.1.1*v1 A.1.2*v.2], [A.2.1*v1 A.2.2*v.2]] cheersss Alejandro
Dear Alejandro, On Tue, 1 Aug 2006, Alejandro Limache wrote:
I am physicist (not a relativist one though).. but, is there something more useful than tensors representations (i.e tensor components) defined for integer indexes?!!!.
With the weather as it has been lately, I would say that surely swimming is more useful than tensor representations defined for integer indices. Going back to the topic, my opinion is that GiNaC should definitly support this use of tensors and their indices. However, we should also not forget that we want to support as well the interpretation of indices as in dimensional regularization. I think that both uses can coexist peacefully.
1) ex_to<numeric>(e.subs(lst(i==0,j==0))).to_double() This works in matrices but one should be abel to put numeric values inside indexed expressions and do matrix type operations...
Well, there is no reason why you couldn't substitute a matrix in case that the number of indices is one or two. Say, you have ex e = A.1[2].0[3] (note: index dimensions indicated in square brackets.) and you have matrix Amat(2,3); Amat = 1, 2, 3, 4, 5, 6; e.subs(A == Amat); // -> evaluates to 4. Of course, this does not help in the case of tensors of rank higher than 2.
2) expand_dummy_sum(const ex & e, bool subs_idx) there could be a similar function "expand_indexes" that expand summed and not summed indices. Example given ex e=indexed(A,i,j)*indexed(v,j) by applying the "expand_indices" function get: e=[[A.1.1*v1 A.1.2*v.2], [A.2.1*v1 A.2.2*v.2]]
However, does a row or a column matrix need to be returned? Also, in the case of two free indices, which of the two lables rows and which columns? Why not write such a function for yourself, send it to us and if it looks like it could be generally useful, we will be happy to include it in GiNaC. Best wishes, Chris
On Tue, Aug 01, 2006 at 04:01:09PM -0400, Alejandro Limache wrote:
according to Ginac-mini FAQ:
The indexed class (and most derived classes) is intended for tensor manipulation without referring to a particular basis. Thus, the indexed class is well suited for calculations involving (formally defined) tensor algebra of "non-integer-dimensional space". .... In that framework, unrolling ai*ai to a1^2+a2^2+a3^2+... is not possible, since the dimension >is not integer!
I am physicist (not a relativist one though).. but, is there something more useful than tensors representations (i.e tensor components) defined for integer indexes?!!!.
That depends. For calculations in perturbative quantum field theory withing the dimensional regularisation tensor compontents are useless (and in fact, ill-defined).
It is because that I always want to get the components of tensors (which can be arranged as multidimensional arrays/matrices) is that I want to be able to unroll indexed objects. I don't think GiNaC is a proper tool for that. Something like blitz++[1], tvmet[2], ublas[3] might be more useful for you.
[1] http://www.oonumerics.org/blitz/ [2] http://tvmet.sourceforge.net [3] http://www.boost.org/libs/numeric/ublas/doc/index.htm Best regards, Alexei. -- All science is either physics or stamp collecting.
participants (3)
-
Alejandro Limache
-
Chris Dams
-
varg@theor.jinr.ru