[GiNaC-list] multi index storage of expressions

Charlls Quarra charlls_quarra at yahoo.com.ar
Sun Feb 18 04:02:25 CET 2007


I wanted to define a simple matrix of derivatives
(i.e: a Jacobian) first as an indexed object:

 ex f = a*x + b*y + c*x*y + ...
 ex g = u*pow(x,2) + v*pow(y,2) + w*x,y + ....

 idx i(symbol("is") , 2) , j(symbol("js") , 2); 
 ex Jacobian = diff( f*delta_tensor(i , 0) +
g*delta_tensor(i,1) , x )*delta_tensor( 0 , j ) +
diff( f*delta_tensor(i , 0) + g*delta_tensor(i,1) , y
)*delta_tensor( 1 , j );

but then this failed on me (because 0 and 1 are not
acceptable arguments where an idx should be expected)

Why am i trying to do this as an indexed object and
not with a matrix?

well, because later, i would also want to make
computations with an object like

 D( f_{i} ) / dx_{j} dx_{k}

 but afaik there isnt a "three indexed" matrix object
in ginac, or how they are usually called, cubic
arrays. correct?


Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 

More information about the GiNaC-list mailing list