rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

ishow tensor indices in correct order. #1706

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:12 Created by richardgobeli on 2019-11-24 01:37:09 Original: https://sourceforge.net/p/maxima/bugs/3597


Can ishow in the shared tensor folder be updated to handle the index order when having all covariant and contravariant in the convariant list where contravariant indices are indicated with minus sign?

Attached is an example.

This would mean that contravaiant indices can't be made to look like exponents and the covariant indices can't be made to look like array indices, because then they get compressed together and no position relation between covariant and contravariant indices can be made.

Attachments:

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:13 Created by richardgobeli on 2019-11-24 13:42:07 Original: https://sourceforge.net/p/maxima/bugs/3597/#187c


This could still be done with exponents and array indices, if they were separated by a narrow none printable character( base object) before each indice after the first indice.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:16 Created by vttoth on 2019-11-25 06:58:34 Original: https://sourceforge.net/p/maxima/bugs/3597/#18a0


rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:20 Created by vttoth on 2019-11-25 06:58:35 Original: https://sourceforge.net/p/maxima/bugs/3597/#b0cf


This is a known limitation of itensor. I do not currently have a useful idea to address this issue in a manner that is robust and not unduly cumbersome. Nonetheless, I am going to keep this bug open, as a reminder that this shortcoming exists.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:23 Created by richardgobeli on 2019-12-14 03:36:04 Original: https://sourceforge.net/p/maxima/bugs/3597/#094e


If Wxmaxima had a subscript and superscript similar to windows where a control character that switches the text to subscript. All characters that follow are subscripted until a repeat of the same control character to stop subscripted characters. The superscript could also be done with a different control character.
A safer way would be to send the control character for only the following character to be printed in sub or superscript. This way the writting prorgram could not get out of sync with the script mode it is in. Itensor would just build a text string to send to WxMaxima that would show the tensor in the correct form.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:27 Created by vttoth on 2019-12-16 05:39:21 Original: https://sourceforge.net/p/maxima/bugs/3597/#094e/01bb


Itensor doesn't know anything about wxMaxima. It simply creates an object with an exponent and a subscript, and then hands this over to Maxima to display it.

The original itensor package knew nothing about index ordering between covariant and contravariant indices: X_i^j and X^j_i were stored as identical objects. I implemented the signed index notation as a patch on top of the existing itensor system, to deal with index ordering, but it was always understood that this approach has limitations. The real solution would be a complete revamp of itensor, but that would need to be done from scratch, because the current implementation is pretty much saturated with code that just takes the list of covariant and the list of contravariant indices without regard as to their relative positions.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 23:21:30 Created by richardgobeli on 2019-12-17 07:35:53 Original: https://sourceforge.net/p/maxima/bugs/3597/#b85a


I understand that the functions in itensor need to be reworked to handle the option of ordering and option of no ordering. But I think the biggest problem is getting it to print correctly. The underscore index is not mathemtically correct, if it comes after the exponent. That is why currently the covarient indexes are lumped together and all the exponents are mathematically lumped together in a product. Maxima would need to have some extra string functions added to be able to print subscripts and superscipts in any order. Even what you typed as X^j_i would not print corrrectly in Maxima, because the underscore i needs to be bound to a symbol.