einsteinpy icon indicating copy to clipboard operation
einsteinpy copied to clipboard

0.5 appears in Ricci tensor

Open imakn634 opened this issue 3 years ago • 2 comments

How about this?

diff einstein.py.orig einstein.py
55c55
<             t_ricci.tensor() - (1 / 2) * metric.lower_config().tensor() * r_scalar.expr
---
>             t_ricci.tensor() - metric.lower_config().tensor() * r_scalar.expr / 2

imakn634 avatar Jun 05 '21 01:06 imakn634

Again. 0.5, instead of 1/2, appears in Einstein tensor. 1/2 * R returns 0.5 * R, not R/2, at least in my environment. My proposal is written in the above.

imakn634 avatar Jun 05 '21 08:06 imakn634

Do you want to make a PR?

shreyasbapat avatar Jun 10 '21 05:06 shreyasbapat

1/2 * R does return $0.5R$, instead of $R/2$, but is this resulting in some incorrect computation? Or are you referring to how the output looks? If it's the latter, I think it's fine to leave it as is, because $0.5R$ takes up 1 line while displaying, while $R/2$ takes up 2. In interactive sessions with init_printing(), this is not a problem, but on command-line, this might, in some cases, lead to extra space being taken up, causing the output to look weird.

In any case, this is a non-issue, as long as the calculation itself is correct. I am closing this as wontfix for now. Please comment, if there's some other problem that I missed.

JeS24 avatar Oct 28 '22 10:10 JeS24