- #1
- 2,168
- 193
I was trying to calculate
$$R = g^{ij}R_{ij}$$ bu using einsum but I couldn't not work it out. Anyone can help me ? Here are some of the resources
https://stackoverflow.com/questions/26089893/understanding-numpys-einsum
https://www.gormanalysis.com/blog/python-numpy-for-your-grandma-6-2-einsum/
https://numpy.org/doc/stable/reference/generated/numpy.einsum.html
I have tried
but it did not work.
$$R = g^{ij}R_{ij}$$ bu using einsum but I couldn't not work it out. Anyone can help me ? Here are some of the resources
https://stackoverflow.com/questions/26089893/understanding-numpys-einsum
https://www.gormanalysis.com/blog/python-numpy-for-your-grandma-6-2-einsum/
https://numpy.org/doc/stable/reference/generated/numpy.einsum.html
I have tried
Code:
self.ricciscalar_obj = simplify(einsum('ij,ij->', ricci_tensor, metric_tensor, optimize='optimal'))
but it did not work.