Ask Your Question

zenAmp's profile - activity

2022-12-29 18:23:30 +0200 received badge  Notable Question (source)
2022-01-09 17:47:18 +0200 received badge  Popular Question (source)
2021-08-13 13:35:20 +0200 marked best answer Contraction of Levi-Civita Symbols

I would like to calculate various contractions of the Levi-Civita symbol using SageMath. As far as i know, there is no direct implementation of the ordinary symbol, so I followed another post and just used the Euclidean space:

E = EuclideanSpace(2, start_index=0)
g = E.metric()
eps = g.volume_form()
eps_dual = g.volume_form(2)

I tested some generic contractions which all seemed to work fine, however, once I started to change the contraction order, things became odd. While

res = eps['_ij']*eps_dual['^ij']
res.disp()

correctly returns E^2 --> R \n (x, y) |--> 2, for

res = eps['_ij']*eps_dual['^ji']
res.disp()

(2nd ij swapped ) I would expect to get E^2 --> R \n (x, y) |--> -2, but sage tells me its +2 again. The same happens if I use res = eps.contract(0, 1, eps_dual, 1, 0) instead of the explicit index notation. I don't know if this is some kind of convention I'm not aware of, however

res = (eps['_ij']*eps_dual['^jk']).trace()

or

res = (eps['_ij']*eps_dual['^jk'])['^n_n']

works just fine. Why does it seem like Sage does not care about the order if I contract all indices at once but does if I do it one after another?

2021-08-13 13:35:20 +0200 received badge  Scholar (source)
2021-08-10 11:37:26 +0200 commented answer Contraction of Levi-Civita Symbols

Thanks for opening the ticket. Indeed, for tensor fields it does seem to work which explains why taking the trace return

2021-08-10 10:40:57 +0200 received badge  Nice Question (source)
2021-08-09 18:00:01 +0200 received badge  Supporter (source)
2021-08-09 17:35:37 +0200 received badge  Student (source)
2021-08-09 17:32:14 +0200 asked a question Contraction of Levi-Civita Symbols

Contraction of Levi-Civita Symbols I would like to calculate various contractions of the Levi-Civita symbol using SageMa