Menu ▾ ▴

#5913 In itensor, idiff returns some unsimplified results, gets confused about derivative indices vs. independent variables

None
closed
None
5
5 days ago
5 days ago
Viktor Toth
No

The following examples demonstrate the problems:

(%i1) display2d:false$ derivabbrev: true$ load(itensor)$
(%i4) idiff(A([],[])*exp(i),i);
(%o4) %e^i*A([],[],i)+A([],[])*i*%e^i*(%e^-1*0)
(%i5) ev(%);
(%o5) %e^i*A([],[],i)
(%i6) idiff(A([],[])*exp(j),i);
(%o6) %e^j*A([],[],i)+A([],[])*j*%e^j*(%e^-1*0)
(%i7) ev(%);
(%o7) %e^j*A([],[],i)
(%i8) idiff(i,i);
(%o8) 1

Expected behavior: the null terms in %o4 and %o6 should be simplified, and %o8 should be zero since i as an independent variable is not related to the i-th coordinate index. (Thanks to R. Gobeli.)

Discussion

  • Viktor Toth

    Viktor Toth - 5 days ago

    Resolved by commit 0598abb6d:

    • idiff(i,i) now returns 0; the atom i is distinct from the coordinate index i
      (inherited code from comm.lisp brought undesired behavior)
    • eliminated idiffexpt1; results are now correctly simplified
    • idiff now correctly handles CRE expressions
    • new test cases including unsupported but working behavior
      (NB: Indexed expressions should not appear as function arguments or as
      arguments in exponential expressions)
     
  • Viktor Toth

    Viktor Toth - 5 days ago
    • status: open --> closed
     

Log in to post a comment.