einsteinpy
einsteinpy copied to clipboard
0.5 appears in Ricci tensor
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
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.
Do you want to make a PR?
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.