Ricci Module¶
This module contains the basic classes for obtaining Ricci Tensor and Ricci Scalar related to a Metric belonging to any arbitrary space-time symbolically:
- class einsteinpy.symbolic.ricci.RicciTensor(arr, syms, config='ll', parent_metric=None, name='RicciTensor')[source]¶
Bases:
BaseRelativityTensor
Class for defining Ricci Tensor
Constructor and Initializer
- Parameters:
arr (ImmutableDenseNDimArray or list) – Sympy Array or multi-dimensional list containing Sympy Expressions
syms (tuple or list) – Tuple of crucial symbols denoting time-axis, 1st, 2nd, and 3rd axis (t,x1,x2,x3)
config (str) – Configuration of contravariant and covariant indices in tensor. ‘u’ for upper and ‘l’ for lower indices. Defaults to ‘ll’.
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Tensor. Defaults to None.
name (str) – Name of the Tensor. Defaults to “RicciTensor”.
- Raises:
TypeError – Raised when arr is not a list or sympy Array
TypeError – syms is not a list or tuple
ValueError – config has more or less than 2 indices
- classmethod from_riemann(riemann, parent_metric=None)[source]¶
Get Ricci Tensor calculated from Riemann Tensor
- Parameters:
riemann (RiemannCurvatureTensor) – Riemann Tensor
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Tensor. None if it should inherit the Parent Metric of Riemann Tensor. Defaults to None.
- classmethod from_christoffels(chris, parent_metric=None)[source]¶
Get Ricci Tensor calculated from Christoffel Tensor
- Parameters:
chris (ChristoffelSymbols) – Christoffel Tensor
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Tensor. None if it should inherit the Parent Metric of Christoffel Symbols. Defaults to None.
- classmethod from_metric(metric)[source]¶
Get Ricci Tensor calculated from Metric Tensor
- Parameters:
metric (MetricTensor) – Metric Tensor
- change_config(newconfig='ul', metric=None)[source]¶
Changes the index configuration(contravariant/covariant)
- Parameters:
newconfig (str) – Specify the new configuration. Defaults to ‘ul’
metric (MetricTensor or None) – Parent metric tensor for changing indices. Already assumes the value of the metric tensor from which it was initialized if passed with None. Compulsory if somehow does not have a parent metric. Defaults to None.
- Returns:
New tensor with new configuration. Defaults to ‘ul’
- Return type:
- Raises:
Exception – Raised when a parent metric could not be found.
- lorentz_transform(transformation_matrix)[source]¶
Performs a Lorentz transform on the tensor.
- Parameters:
transformation_matrix (ImmutableDenseNDimArray or list) – Sympy Array or multi-dimensional list containing Sympy Expressions
- Returns:
lorentz transformed tensor
- Return type:
- class einsteinpy.symbolic.ricci.RicciScalar(arr, syms, parent_metric=None)[source]¶
Bases:
BaseRelativityTensor
Class for defining Ricci Scalar
Constructor and Initializer
- Parameters:
arr (ImmutableDenseNDimArray or list) – Sympy Array, multi-dimensional list containing Sympy Expressions, or Sympy Expressions or int or float scalar
syms (tuple or list) – Tuple of crucial symbols denoting time-axis, 1st, 2nd, and 3rd axis (t,x1,x2,x3)
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Scalar. Defaults to None.
- Raises:
TypeError – Raised when syms is not a list or tuple
- property expr¶
Retuns the symbolic expression of the Ricci Scalar
- classmethod from_riccitensor(riccitensor, parent_metric=None)[source]¶
Get Ricci Scalar calculated from Ricci Tensor
- Parameters:
riccitensor (RicciTensor) – Ricci Tensor
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Scalar. Defaults to None.
- classmethod from_riemann(riemann, parent_metric=None)[source]¶
Get Ricci Scalar calculated from Riemann Tensor
- Parameters:
riemann (RiemannCurvatureTensor) – Riemann Tensor
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Scalar. Defaults to None.
- classmethod from_christoffels(chris, parent_metric=None)[source]¶
Get Ricci Scalar calculated from Christoffel Tensor
- Parameters:
chris (ChristoffelSymbols) – Christoffel Tensor
parent_metric (MetricTensor or None) – Corresponding Metric for the Ricci Scalar. Defaults to None.
- classmethod from_metric(metric)[source]¶
Get Ricci Scalar calculated from Metric Tensor
- Parameters:
metric (MetricTensor) – Metric Tensor