This is simple python script to calculate several tensors appears in differential geometry.
class Ricci
include modules to evaluate Christoffel Symbol,
Riemann Tensor, Ricci Tensor, and Ricci Scalar for given metric.
When create the instance of Ricci
, metric and the index of local coordinate should be given as arguments.
The metric should be NxN Matrix
of Sympy and index of local coordinate should be a list of Symbol
of Sympy.
Christoffel Symbol, Ricci Tensor and Ricci Scalar has the form of Array
in Sympy.
Here I comment on the order of index of Array
and mathematical form.
A instance of Ricci
is constructed under some metric g and coordinate.
Ric = Ricci(coordinate, g)
When Christoffel Symbol is defined by
CF=Ric.ChristoffelSymbol()
CF[i,j,k]
When Riemann Tensor is defined by
Rie=Ric.RiemannTensor()
Rie[i,j,k,l]
When Ricci Tensor is defined by
RT=Ric.RicciTensor()
RT[i,j]
The __main__
is an example for Schwarzschild metric.