pep8speaks: Hello @OVSofia! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



* In the file [`src/einsteinpy/symbolic/stress_energy_momentum.py`](https://github.com/einsteinpy/einsteinpy/blob/0f0bffc36e5b7dbbe462d9d1e24d78aee74f4613/src/einsteinpy/symbolic/stress_energy_momentum.py):

> [Line 25:121](https://github.com/einsteinpy/einsteinpy/blob/0f0bffc36e5b7dbbe462d9d1e24d78aee74f4613/src/einsteinpy/symbolic/stress_energy_momentum.py#L25): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (134 > 120 characters)
> [Line 54:13](https://github.com/einsteinpy/einsteinpy/blob/0f0bffc36e5b7dbbe462d9d1e24d78aee74f4613/src/einsteinpy/symbolic/stress_energy_momentum.py#L54): [W503](https://duckduckgo.com/?q=pep8%20W503) line break before binary operator
> [Line 55:13](https://github.com/einsteinpy/einsteinpy/blob/0f0bffc36e5b7dbbe462d9d1e24d78aee74f4613/src/einsteinpy/symbolic/stress_energy_momentum.py#L55): [W503](https://duckduckgo.com/?q=pep8%20W503) line break before binary operator








OVSofia: @ritzvik Can I change the Cognitive Complexity? 
ritzvik: > @ritzvik Can I change the Cognitive Complexity?

Don't worry about that!
codecov[bot]: # [Codecov](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=h1) Report
> Merging [#325](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=desc) into [master](https://codecov.io/gh/einsteinpy/einsteinpy/commit/befc0879c65a53b811e7d6a9ec47675ae28a08c5?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325/graphs/tree.svg?width=650&token=H3oDVYA11f&height=150&src=pr)](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
+ Coverage   94.12%   94.15%   +0.03%     
==========================================
  Files          40       40              
  Lines        1531     1540       +9     
==========================================
+ Hits         1441     1450       +9     
  Misses         90       90
```


| [Impacted Files](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/einsteinpy/symbolic/tensor.py](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325/diff?src=pr&el=tree#diff-c3JjL2VpbnN0ZWlucHkvc3ltYm9saWMvdGVuc29yLnB5) | `97.91% <100%> (+1.1%)` | :arrow_up: |
| [src/einsteinpy/symbolic/constants.py](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325/diff?src=pr&el=tree#diff-c3JjL2VpbnN0ZWlucHkvc3ltYm9saWMvY29uc3RhbnRzLnB5) | `100% <100%> (ø)` | :arrow_up: |
| [src/einsteinpy/symbolic/ricci.py](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325/diff?src=pr&el=tree#diff-c3JjL2VpbnN0ZWlucHkvc3ltYm9saWMvcmljY2kucHk=) | `96.96% <0%> (-1.37%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=footer). Last update [befc087...a68d993](https://codecov.io/gh/einsteinpy/einsteinpy/pull/325?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

OVSofia: > > @ritzvik Can I change the Cognitive Complexity?
> 
> Don't worry about that!

So, should I change something or it's ok?
ritzvik: > > > @ritzvik Can I change the Cognitive Complexity?
> > 
> > 
> > Don't worry about that!
> 
> So, should I change something or it's ok?

Enough procrastination on my side! I am reviewing it 😄 
ritzvik: Meanwhile, @OVSofia , why don't you write a blog. It's been a long time since you wrote one, right?
OVSofia: > Meanwhile, @OVSofia , why don't you write a blog. It's been a long time since you wrote one, right?

Yes. Sure! ^.^
ritzvik: > Got it! Should I make the test?

Yups
ritzvik: Also, start working on the tests! @OVSofia 
ritzvik: Ok, leave it here, I will take care of the rest.
ritzvik: I've done the required changes. Have a look at them.
Squash n rebase!

And one more thing, you can learn how to make somebody co-author in a commit. Not that I want the credits xD, but it's something you should learn when working in a collaborative environment.
https://github.blog/2018-01-29-commit-together-with-co-authors/

cc @OVSofia 
diff --git a/src/einsteinpy/symbolic/tensor.py b/src/einsteinpy/symbolic/tensor.py
index fbd55ff..80dfcc9 100644
--- a/src/einsteinpy/symbolic/tensor.py
+++ b/src/einsteinpy/symbolic/tensor.py
@@ -272,6 +272,7 @@ class BaseRelativityTensor(Tensor):
                 self.variables = [
                     v for v in self.arr.free_symbols if v not in self.syms
                 ]
+                self.variables.sort(key=(lambda var: var.name))
             else:
                 self.variables = list(variables)
             if not functions:
@@ -307,3 +308,33 @@ class BaseRelativityTensor(Tensor):
         
         """
         return self.syms
+
+    def tensor_lambdify(self, *args):
+        """
+        Returns lambdified function of symbolic tensors.
+        This means that the returned functions can accept numerical values and return numerical quantities.
+
+        Parameters
+        ----------
+            *args
+                The variable number of arguments accept sympy symbols.
+                The returned function accepts arguments in same order as initially defined in ``*args``.
+                Uses sympy symbols from class attributes ``syms`` and ``variables``(in the same order) if no ``*args`` is passed
+                Leaving ``*args`` empty is recommended.
+
+        Returns
+        -------
+            tuple
+                arguments to be passed in the returned function in exact order.
+            function
+                Lambdified function which accepts and returns numerical quantities.
+
+        """
+
+        if len(args) == 0:
+            numeric_arr = sympy.lambdify([*self.syms, *self.variables], self.arr, np)
+            arg_list = (*self.syms, *self.variables)
+        else:
+            numeric_arr = sympy.lambdify(args, self.arr, np)
+            arg_list = tuple(args)
+        return arg_list, numeric_arr

Integrate Sympy's Lambdify in EinsteinPy
 Our tensors should have the ability to represent arrays of numpy-like functions rather than sympy expressions
diff --git a/src/einsteinpy/tests/test_symbolic/test_tensor.py b/src/einsteinpy/tests/test_symbolic/test_tensor.py
index 7d85b44..82f705e 100644
--- a/src/einsteinpy/tests/test_symbolic/test_tensor.py
+++ b/src/einsteinpy/tests/test_symbolic/test_tensor.py
@@ -1,9 +1,10 @@
 import numpy as np
 import pytest
+from numpy.testing import assert_allclose
 from sympy import Array, Function, cos, simplify, sin, symbols
 from sympy.abc import y, z
 
-from einsteinpy.symbolic.tensor import BaseRelativityTensor, Tensor
+from einsteinpy.symbolic import BaseRelativityTensor, MetricTensor, Tensor
 
 
 def schwarzschild_tensor():
@@ -21,6 +22,21 @@ def schwarzschild_tensor():
     return sch
 
 
+def schwarzschild_metric():
+    symbolstr = "t r theta phi"
+    syms = symbols(symbolstr)
+    G, M, c, a = symbols("G M c a")
+    # using metric values of schwarschild space-time
+    # a is schwarzschild radius
+    list2d = np.zeros((4, 4), dtype=int).tolist()
+    list2d[0][0] = 1 - (a / syms[1])
+    list2d[1][1] = -1 / ((1 - (a / syms[1])) * (c ** 2))
+    list2d[2][2] = -1 * (syms[1] ** 2) / (c ** 2)
+    list2d[3][3] = -1 * (syms[1] ** 2) * (sin(syms[2]) ** 2) / (c ** 2)
+    sch = MetricTensor(list2d, syms)
+    return sch
+
+
 def arbitrary_tensor1():
     symbolstr = "x0 x1 x2 x3"
     syms = symbols(symbolstr)
@@ -149,3 +165,34 @@ def test_BaseRelativityTensor_automatic_calculation_of_free_variables():
 def test_tensor_scalar(scalar):
     scalar_tensor = Tensor(scalar)
     assert scalar_tensor.tensor().rank() == 0
+
+
+# tests for lambdify
+
+
+def test_lambdify_on_schwarzschild_metric_without_args():
+    sch = schwarzschild_metric()
+    # values of t, r, theta, phi, a, c
+    vals = (0.0, 3.0, np.pi / 2, np.pi / 3, 2, 1)
+    f = sch.tensor_lambdify()[1]
+    # print(sch.variables)
+    result_arr = np.array(f(*vals))
+    cmp_arr = np.zeros((4, 4), dtype=float)
+    cmp_arr[0, 0], cmp_arr[1, 1], cmp_arr[2, 2], cmp_arr[3, 3] = (
+        1 - (vals[4] / vals[1]),
+        -1 / ((1 - (vals[4] / vals[1])) * (vals[5] ** 2)),
+        -1 * (vals[1] ** 2) / (vals[5] ** 2),
+        -1 * (vals[1] ** 2) * (np.sin(vals[2]) ** 2) / (vals[5] ** 2),
+    )
+    assert_allclose(cmp_arr, result_arr, atol=1e-7, rtol=0.0)
+
+
+def test_lambdify_with_args():
+    x, y = symbols("x y")
+    T = BaseRelativityTensor([x + y, x], (x, y), config="l")
+    args, f = T.tensor_lambdify(y, x)
+    arr = np.array(f(2, 1))
+    cmp_arr = np.array([3, 1])
+    assert_allclose(arr, cmp_arr, rtol=0.0, atol=1e-7)
+    for e1, e2 in zip(args, (y, x)):
+        assert simplify(e1 - e2) == 0

pip install -e .[dev]
parse_log_pytest
numpy>=1.16.0 astropy matplotlib plotly scipy sympy
pytest pytest-cov ipywidgets
apt-get update apt-get install -y gcc
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
astropy==4.0.2
async-generator==1.10
attrs==22.2.0
Babel==2.11.0
backcall==0.2.0
black==22.8.0
bleach==4.1.0
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
click==8.0.4
comm==0.1.4
coverage==6.2
cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work
dataclasses==0.8
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.9
docutils==0.18.1
-e git+https://github.com/einsteinpy/einsteinpy.git@f64c25fd58564bf43e071a4e77b790779457b5ea#egg=einsteinpy
entrypoints==0.4
execnet==1.9.0
filelock==3.4.1
gmpy2==2.0.8
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
ipykernel==5.5.6
ipython==7.16.3
ipython-genutils==0.2.0
ipywidgets==7.8.5
isort==5.10.1
jedi==0.17.2
Jinja2==3.0.3
jsonschema==3.2.0
jupyter-client==7.1.2
jupyter-core==4.9.2
jupyter-sphinx==0.4.0
jupyterlab-pygments==0.1.2
jupyterlab_widgets==1.1.11
kiwisolver @ file:///tmp/build/80754af9/kiwisolver_1612282412546/work
llvmlite==0.36.0
MarkupSafe==2.0.1
matplotlib @ file:///tmp/build/80754af9/matplotlib-suite_1613407855456/work
mistune==0.8.4
mpmath==1.2.1
mypy-extensions==1.0.0
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nbsphinx==0.8.8
nest-asyncio==1.6.0
notebook==6.4.10
numba==0.53.1
numpy @ file:///tmp/build/80754af9/numpy_and_numpy_base_1603483703303/work
olefile @ file:///Users/ktietz/demo/mc3/conda-bld/olefile_1629805411829/work
packaging==21.3
pandocfilters==1.5.1
parso==0.7.1
pathspec==0.9.0
pexpect==4.9.0
pickleshare==0.7.5
Pillow @ file:///tmp/build/80754af9/pillow_1625670622947/work
platformdirs==2.4.0
plotly @ file:///opt/conda/conda-bld/plotly_1646671701182/work
pluggy==1.0.0
prometheus-client==0.17.1
prompt-toolkit==3.0.36
ptyprocess==0.7.0
py==1.11.0
pycodestyle==2.10.0
pycparser==2.21
Pygments==2.14.0
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pyrsistent==0.18.0
pytest==7.0.1
pytest-cov==2.5.1
pytest-xdist==3.0.2
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
pytz==2025.2
pyzmq==25.1.2
requests==2.27.1
scipy @ file:///tmp/build/80754af9/scipy_1597686635649/work
Send2Trash==1.8.3
six @ file:///tmp/build/80754af9/six_1644875935023/work
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sympy @ file:///tmp/build/80754af9/sympy_1618255319796/work
tenacity @ file:///tmp/build/80754af9/tenacity_1632756926792/work
terminado==0.12.1
testpath==0.6.0
toml==0.10.2
tomli==1.2.3
tornado @ file:///tmp/build/80754af9/tornado_1606942266872/work
tox==3.28.0
traitlets==4.3.3
typed-ast==1.5.5
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.17.1
wcwidth==0.2.13
webencodings==0.5.1
widgetsnbextension==3.6.10
zipp==3.6.0

name: einsteinpy
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - astropy=4.0.2=py36h7b6447c_0
  - blas=1.0=openblas
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - cycler=0.11.0=pyhd3eb1b0_0
  - dbus=1.13.18=hb2f20db_0
  - expat=2.6.4=h6a678d5_0
  - fontconfig=2.14.1=h52c9d5c_1
  - freetype=2.12.1=h4a9f257_0
  - giflib=5.2.2=h5eee18b_0
  - glib=2.69.1=h4ff587b_1
  - gmp=6.3.0=h6a678d5_0
  - gmpy2=2.0.8=py36h10f8cd9_2
  - gst-plugins-base=1.14.1=h6a678d5_1
  - gstreamer=1.14.1=h5eee18b_1
  - icu=58.2=he6710b0_3
  - jpeg=9e=h5eee18b_3
  - kiwisolver=1.3.1=py36h2531618_0
  - lcms2=2.16=hb9589c4_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - lerc=4.0.0=h6a678d5_0
  - libdeflate=1.22=h5eee18b_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgfortran-ng=7.5.0=ha8ba4b0_17
  - libgfortran4=7.5.0=ha8ba4b0_17
  - libgomp=11.2.0=h1234567_1
  - libopenblas=0.3.18=hf726d26_0
  - libpng=1.6.39=h5eee18b_0
  - libstdcxx-ng=11.2.0=h1234567_1
  - libtiff=4.5.1=hffd6297_1
  - libuuid=1.41.5=h5eee18b_0
  - libwebp=1.2.4=h11a3e52_1
  - libwebp-base=1.2.4=h5eee18b_1
  - libxcb=1.15=h7f8727e_0
  - libxml2=2.9.14=h74e7548_0
  - lz4-c=1.9.4=h6a678d5_1
  - matplotlib=3.3.4=py36h06a4308_0
  - matplotlib-base=3.3.4=py36h62a2d02_0
  - mpc=1.3.1=h5eee18b_0
  - mpfr=4.2.1=h5eee18b_0
  - mpmath=1.2.1=py36h06a4308_0
  - ncurses=6.4=h6a678d5_0
  - numpy=1.19.2=py36h6163131_0
  - numpy-base=1.19.2=py36h75fe3a5_0
  - olefile=0.46=pyhd3eb1b0_0
  - openssl=1.1.1w=h7f8727e_0
  - pcre=8.45=h295c915_0
  - pillow=8.3.1=py36h5aabda8_0
  - pip=21.2.2=py36h06a4308_0
  - plotly=5.6.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pyqt=5.9.2=py36h05f1152_2
  - python=3.6.13=h12debd9_1
  - python-dateutil=2.8.2=pyhd3eb1b0_0
  - qt=5.9.7=h5867ecd_1
  - readline=8.2=h5eee18b_0
  - scipy=1.5.2=py36habc2bb6_0
  - setuptools=58.0.4=py36h06a4308_0
  - sip=4.19.8=py36hf484d3e_0
  - six=1.16.0=pyhd3eb1b0_1
  - sqlite=3.45.3=h5eee18b_0
  - sympy=1.8=py36h06a4308_0
  - tenacity=8.0.1=py36h06a4308_0
  - tk=8.6.14=h39e8969_0
  - tornado=6.1=py36h27cfd23_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - zstd=1.5.6=hc292b87_0
  - pip:
      - alabaster==0.7.13
      - argon2-cffi==21.3.0
      - argon2-cffi-bindings==21.2.0
      - async-generator==1.10
      - attrs==22.2.0
      - babel==2.11.0
      - backcall==0.2.0
      - black==22.8.0
      - bleach==4.1.0
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - click==8.0.4
      - comm==0.1.4
      - coverage==6.2
      - dataclasses==0.8
      - decorator==5.1.1
      - defusedxml==0.7.1
      - distlib==0.3.9
      - docutils==0.18.1
      - entrypoints==0.4
      - execnet==1.9.0
      - filelock==3.4.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - ipykernel==5.5.6
      - ipython==7.16.3
      - ipython-genutils==0.2.0
      - ipywidgets==7.8.5
      - isort==5.10.1
      - jedi==0.17.2
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - jupyter-client==7.1.2
      - jupyter-core==4.9.2
      - jupyter-sphinx==0.4.0
      - jupyterlab-pygments==0.1.2
      - jupyterlab-widgets==1.1.11
      - llvmlite==0.36.0
      - markupsafe==2.0.1
      - mistune==0.8.4
      - mypy-extensions==1.0.0
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nbsphinx==0.8.8
      - nest-asyncio==1.6.0
      - notebook==6.4.10
      - numba==0.53.1
      - packaging==21.3
      - pandocfilters==1.5.1
      - parso==0.7.1
      - pathspec==0.9.0
      - pexpect==4.9.0
      - pickleshare==0.7.5
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - prometheus-client==0.17.1
      - prompt-toolkit==3.0.36
      - ptyprocess==0.7.0
      - py==1.11.0
      - pycodestyle==2.10.0
      - pycparser==2.21
      - pygments==2.14.0
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-cov==2.5.1
      - pytest-xdist==3.0.2
      - pytz==2025.2
      - pyzmq==25.1.2
      - requests==2.27.1
      - send2trash==1.8.3
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - terminado==0.12.1
      - testpath==0.6.0
      - toml==0.10.2
      - tomli==1.2.3
      - tox==3.28.0
      - traitlets==4.3.3
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.17.1
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - widgetsnbextension==3.6.10
      - zipp==3.6.0
prefix: /opt/conda/envs/einsteinpy

src/einsteinpy/tests/test_symbolic/test_tensor.py::test_lambdify_on_schwarzschild_metric_without_args src/einsteinpy/tests/test_symbolic/test_tensor.py::test_lambdify_with_args
src/einsteinpy/tests/test_symbolic/test_tensor.py::test_Tensor src/einsteinpy/tests/test_symbolic/test_tensor.py::test_Tensor_getitem src/einsteinpy/tests/test_symbolic/test_tensor.py::test_Tensor_str src/einsteinpy/tests/test_symbolic/test_tensor.py::test_Tensor_repr src/einsteinpy/tests/test_symbolic/test_tensor.py::test_TypeError2 src/einsteinpy/tests/test_symbolic/test_tensor.py::test_TypeError3 src/einsteinpy/tests/test_symbolic/test_tensor.py::test_subs_single src/einsteinpy/tests/test_symbolic/test_tensor.py::test_subs_multiple src/einsteinpy/tests/test_symbolic/test_tensor.py::test_check_properties src/einsteinpy/tests/test_symbolic/test_tensor.py::test_BaseRelativityTensor_automatic_calculation_of_free_variables src/einsteinpy/tests/test_symbolic/test_tensor.py::test_tensor_scalar[11.89] src/einsteinpy/tests/test_symbolic/test_tensor.py::test_tensor_scalar[scalar1]
src/einsteinpy/symbolic/tensor.py
src/einsteinpy/symbolic/tensor.py