ianhinder / Kranc

A Mathematica package for generating code for solving time dependent partial differential equations
http://kranccode.org
GNU General Public License v2.0
28 stars 10 forks source link

Cannot calculate matrix inverse of mixed tensors #71

Open eschnett opened 12 years ago

eschnett commented 12 years ago

It is not possible to calculate the inverse of J[ua,lb]; Kranc expects all indices to be lower when calling MatrixInverse.

A work-around is to define a shorthand with all lower indices and to contract with KD to "lower" the index.

ianhinder commented 12 years ago

Yes. The fix would be to extend MatrixInverse to handle the cases that it does not currently handle. I've never been happy with MatrixInverse, as it is a bit confusing. We should think of a better way of computing the inverse of a matrix in a way which maintains the index positions and doesn't look "wrong".