Vector module¶
This module contains the class GenericVector to represent a vector in arbitrary space-time symbolically
-
class
einsteinpy.symbolic.vector.
GenericVector
(arr, syms, config='u', parent_metric=None, name='GenericVector')[source]¶ Bases:
einsteinpy.symbolic.tensor.BaseRelativityTensor
Class to represent a vector in arbitrary space-time symbolically
Constructor and Initializer
- Parameters
arr (ImmutableDenseNDimArray) – Sympy Array 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 ‘u’.
parent_metric (MetricTensor or None) – Corresponding Metric for the Generic Vector. Defaults to None.
name (str) – Name of the Vector. Defaults to “GenericVector”.
- Raises
ValueError – config has more than 1 index
ValueError – Dimension should be equal to 1
-
change_config
(newconfig='u', metric=None)[source]¶ Changes the index configuration(contravariant/covariant)
- Parameters
newconfig (str) – Specify the new configuration. Defaults to ‘u’
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. Defaults to None.
- Returns
New tensor with new configuration.
- Return type
- Raises
Exception – Raised when a parent metric could not be found.