# [GiNaC-list] How to differentiate from a Tensor?

esarcush esarcush esarcush at gmail.com
Fri Jul 14 11:34:56 CEST 2017

I think it is not a suitable way. Happening other situations, this
method will lack. For example, consider a case that $$A_{ij}$$ is a
understand it well):

{
symbol x("x");
symbol i_sym("i"), j_sym("j");
idx i(i_sym, 3), j(j_sym, 3);
ex e = indexed(step(x), i, j);
ex de_dx = e.diff(x);
cout << de_dx << "\n";
}

returning 0.

All the best,

On 7/14/17, Vladimir V. Kisil <kisilv at maths.leeds.ac.uk> wrote:
>>>>>> On Fri, 14 Jul 2017 13:29:37 +0430, esarcush esarcush
>>>>>> <esarcush at gmail.com> said:
>
>     EE> E needs to depend on x. So, symbol A("A"), x("x"); symbol
>     EE> i_sym("i"), j_sym("j"); idx i(i_sym, 3), j(j_sym, 3); ex e =
>     EE> indexed(A, i, j); ex de_dx = e.diff(x); cout << de_dx << "\n";
>
>     EE> returns 0. Thus, what is the way to depend "e" on "x" like
>     EE> undefined functions?
>
>     If a dependence of A on x is not defined, try to use the step
>   function (as one without defined derivative):
>
>     ex e = indexed(step(x), i, j);
>
>     This keeps track on derivatives.
>
>     To maintainer: I have run into similar situation working with
>   differential operators. Shall we add "generic" functions to GiNaC with
>   1, 2, 3, 4 variables?
> --
>   Book:     Geometry of Mobius Transformations     http://goo.gl/EaG2Vu
>   Software: Geometry of cycles          http://moebinv.sourceforge.net/
>
>     EE> All the bests,
>
>     EE> On 7/14/17, Vladimir V. Kisil <kisilv at maths.leeds.ac.uk> wrote:
>     >>>>>>> On Fri, 14 Jul 2017 12:15:49 +0430, esarcush esarcush
>     >>>>>>> <esarcush at gmail.com> said:
>     >>
>     EE> Dear all, What is right way to have something like $$> EE> \frac{\partial A^{i}_{jk}}{\partial x}$$? Indeed, I defined a
>     EE> tensor "A~i.j.k" and want to differentiate from it with respect
>     EE> to "x" e.g.
>     >>
>     >> For a GiNaC object E its derivative with respect to x is obtained
>     >> by E.diff(x)
>     >> --
>     >> Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book:
>     >> Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software:
>     >> Geometry of cycles http://moebinv.sourceforge.net/
>     >>
>
>