rtoy / maxima

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

frame_bracket function in ctensor is not antisymmetric #2874

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:12:43 Created by richardgobeli on 2021-09-15 22:23:15 Original: https://sourceforge.net/p/maxima/bugs/3854


This is the original function:

frame_bracket(fr,fri,diagframe):=block
(
  for a thru dim do for b thru dim do for c thru dim do
    fb[a,b,c]:sum(sum(fr[a,e%]*(diff(fri[e%,c],ct_coords[f%])-
              diff(fri[f%,c],ct_coords[e%]))*fr[b,c],e%,1,dim),f%,1,dim)
);

The last fr term needs to be summed with f% in the last index c. This is the corrected function:

frame_bracket(fr,fri,diagframe):=block
(
  for a thru dim do for b thru dim do for c thru dim do
    fb[a,b,c]:sum(sum(fr[a,e%]*(diff(fri[e%,c],ct_coords[f%])-
              diff(fri[f%,c],ct_coords[e%]))*fr[b,f%],e%,1,dim),f%,1,dim)
);

That attached picture is from the maxima manual section 26.2.4 Frame fields.

This should make it equivalent to the attached formula except for the index c. Where the summing index e% is like e in attached picture and summing index f% is like d in attached picture.

Also the above formula calculates a covariant tensor where a, b and c are all lower indices and the itensor package has the frame bracket defined with c as an upper index. I don't know if this will have an issue with the ic_convert function. Is the manual correct in the position of the c index?

Attachments:

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:12:44 Created by robert_dodier on 2021-09-15 22:40:30 Original: https://sourceforge.net/p/maxima/bugs/3854/#37e6


Diff:


--- old
+++ new
@@ -1,22 +1,22 @@
 This is the original function:
-
+```
 frame_bracket(fr,fri,diagframe):=block
 (
   for a thru dim do for b thru dim do for c thru dim do
     fb[a,b,c]:sum(sum(fr[a,e%]*(diff(fri[e%,c],ct_coords[f%])-
               diff(fri[f%,c],ct_coords[e%]))*fr[b,c],e%,1,dim),f%,1,dim)
 );
-
+```
 The last fr term needs to be summed with f% in the last index c.
 This is the corrected function:
-
+```
 frame_bracket(fr,fri,diagframe):=block
 (
   for a thru dim do for b thru dim do for c thru dim do
     fb[a,b,c]:sum(sum(fr[a,e%]*(diff(fri[e%,c],ct_coords[f%])-
               diff(fri[f%,c],ct_coords[e%]))*fr[b,f%],e%,1,dim),f%,1,dim)
 );
-
+```
 That attached picture is from the maxima manual section 26.2.4 Frame fields.

 This should make it equivalent to the attached formula except for the index c.
rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:12:48 Created by richardgobeli on 2021-09-15 23:08:15 Original: https://sourceforge.net/p/maxima/bugs/3854/#7330


I see from the Frames, torsion, nonmetricity demo that the manual is correct for the ifc2 term, which has c index raised with the frame metric. The frame bracket that is calculated is the ifc1 term

Attachments:

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:12:51 Created by vttoth on 2021-09-16 14:15:22 Original: https://sourceforge.net/p/maxima/bugs/3854/#0ec2


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:12:55 Created by vttoth on 2021-09-16 15:59:56 Original: https://sourceforge.net/p/maxima/bugs/3854/#2093


Spot on. Thanks for catching this. The manual is correct.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:12:59 Created by vttoth on 2021-09-16 16:00:34 Original: https://sourceforge.net/p/maxima/bugs/3854/#be70


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:13:02 Created by richardgobeli on 2021-11-24 23:21:46 Original: https://sourceforge.net/p/maxima/bugs/3854/#84b3


I notice a question on the coframe indices used in the frame bracket. Shouldn't the local index c be in the first position to be compatible with the Maxima standard for the co-frame and frame to have the local index first. The current position as second index would not work for a non symmetrical co-frame where the transpose is not the same. It looks like the frame does have the local index first in this case.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:13:06 Created by richardgobeli on 2021-12-17 02:47:46 Original: https://sourceforge.net/p/maxima/bugs/3854/#1312


I see the frame bracket like this works. When you call it like this frame_bracket(fr,fri,true);

The indices for both fri tensors were swapped position so the global coordinate is the second index.

frame_bracket(fr,fri,diagframe):=block ( for a thru dim do for b thru dim do for c thru dim do ( fb[a,b,c]:sum(sum(fr[b,e%](diff(fri[a,e%],ct_coords[f%])- diff(fri[a,f%],ct_coords[e%]))fr[c,f%],e%,1,dim),f%,1,dim), if ctrgsimp then fb[a,b,c]:trigsimp(fb[a,b,c]) )
);

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:13:09 Created by richardgobeli on 2022-08-01 01:22:40 Original: https://sourceforge.net/p/maxima/bugs/3854/#a55b


I ran a compare on ctensor.mac to check for any changes and I noticed the following: I think you did a typo when changing the f% in the frame_bracket. It got typed as %f instead, which is incorrect.

Can you also check index ordering?
Should it be the same as the ifb using the torsion tensor set to zero?

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:13:13 Created by vttoth on 2022-08-02 05:10:40 Original: https://sourceforge.net/p/maxima/bugs/3854/#7d23


Oh my. Thanks for catching that. The index ordering is I think correct, but the f% vs. %f business was indeed an evil typo.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 00:13:17 Created by richardgobeli on 2022-08-08 15:49:55 Original: https://sourceforge.net/p/maxima/bugs/3854/#7e07


I tested the different versions of the frame bracket from Itensor. They both give the Ricci rotation coefficients, but the frame_bracket function does not. Some of the indices of the diff function are wrong. The correction uses the ifb version with tr set to zero. Below is the correction with trigsimp added to convert each term. I did not see an easy way to add the ctrgsimp test flag. Maybe ratsimp would be better.

frame_bracket(fr,fri,diagframe):=block ( for a thru dim do for b thru dim do for c thru dim do fb[a,b,c]:trigsimp(sum(sum(fr[b,e%](diff(fri[a,e%],ct_coords[f%])- diff(fri[a,f%],ct_coords[e%]))fr[c,f%],e%,1,dim),f%,1,dim)) ); corrected the f% in last term.