## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jan 31 20:43

JeS24 on main

Updated README.rst to fix build… (compare)

• Jan 31 20:18
JeS24 edited #630
• Jan 31 20:16
JeS24 commented #614
• Jan 31 20:16
JeS24 edited #614
• Jan 31 20:15
JeS24 edited #614
• Jan 31 20:15
JeS24 milestoned #630
• Jan 31 20:15
JeS24 labeled #630
• Jan 31 20:15
JeS24 labeled #630
• Jan 31 20:15
JeS24 opened #630
• Jan 31 19:28
JeS24 commented #624
• Jan 31 16:23
sagar-ksahoo commented #614
• Jan 26 07:20
mshumayl commented #624
• Jan 26 07:16
mshumayl commented #624
• Jan 24 09:57
JeS24 commented #627
• Jan 24 09:53
olebole commented #627
• Jan 23 18:00
JeS24 commented #627
• Jan 23 16:29
olebole commented #627
• Jan 23 15:19
JeS24 commented #627
• Jan 23 15:11
JeS24 commented #629
• Jan 23 15:11
JeS24 labeled #629
jezza1251
@jezza1251:matrix.org
[m]
Hi everyone! Currently using the latest version of einsteinpy (0.4dev0), and I'm trying to do this project - https://docs.einsteinpy.org/en/latest/examples/Using%20Geodesics%20%28Back-ends%20%26%20Plotting%29.html, however my plot seems very wrong compared to what's expected! Attached is my code and the plot, if anyone could help that'll be so great!
shreyasbapat
@shreyasbapat:matrix.org
[m]
Okay, finally I am back
The release should happen this weekend
And all these issues will get sprtef
Sorted*
smondal
@smondal:matrix.org
[m]
Hello guys, I have a naive question. It is fine to write the metric as for desitter or schwarzschild. I want to write a metric where the metric components are diag(F(t,r),G(t,r),E(t,r),D(t,r)). Where F,G,D,E are arbitrary function and not sin, cos or any other predefined function. How do I write that. Please help....
shreyasbapat
@shreyasbapat:matrix.org
[m]
EinsteinPy 0.4.0 is out 😁
I am really sorry for not staying up to date here
This covid wave has hurt all of us here pretty badly
2 replies
Sourodip Ghoshdastidar
@geekyboy:matrix.org
[m]
how can i use the cartesian to spherical coordinates conversion module?
i am new to python sorry
rh99
@rh99:matrix.org
[m]
Hi, can I contribute to this project without knowledge of general relativity? I will be taking a class on it next year...
Thomas Andersen
@tomandersen:matrix.org
[m]
m1 Mac install - I have tried quite a bit, and pip methods all fail, usually on llvmlite. When I use conda it 'works' but in Jupyter I can't import or use it. Also trying to use it in python3 in a small python file or interactive fails, it can't see the installed by conda version. All the other python modules i need install. It's installing or trying to using native arm64 code. Thanks for any tips! Was trying out EinsteinPy and it was great getting the Einstein tensor from a metric. I tried on a different computer from mine.
shreyasbapat
@shreyasbapat:matrix.org
[m]
Yeah. I don't know what to do about it. I am sorry for that. Will have to get a M1 to try it out.
I am sure it is because either Numba does not support M1
Thomas Andersen
@tomandersen:matrix.org
[m]
I figured it out. Install everything with conda. (which all worked for me). Then only problem is macs use zsh shell, needed to cd into the conda bin directory and type ./conda init zsh

tandersen@tomm1 bin % ./conda init zsh
modified /Users/tandersen/.zshrc

==> For changes to take effect, close and re-open your current shell. <==

tandersen@tomm1 bin % pwd

Then it worked. I needed to get conda to set up my zsh shell so typing jupyter-lab would run the correct one.
@penuss:matrix.org
@pimmlel:matrix.org
[m]
Hi guys, I was reading through the docs to see if I could improve some things. One thing that I noticed is that you write "space-time" instead of "spacetime". Is this a stylistic choice of yours? Usually, it's written as "spacetime" in books and papers. The rationale behind that is that space and time are intrinsically linked. This isn't reflected when using a dash to separate both.
Disclaimer: I am coming more from a physics background rather than coding background.
Bernhard Umlauf
@bernie67:matrix.org
[m]
Hi all, first try to use einsteinpy. Can someone tell, how to declare user defined metrics? I want to use modified Schwarzschild metric, i.e. multiply g_rr with 1/r.
I get also an error message, if i use "from einsteinpy.symbolic import SchwarzschildMetric"
DottMichela Lai
@michelalai:matrix.org
[m]
Hi everyone! I am Michela, Post-Doc at University of Cagliari, Italy. I am just starting with einsteinpy. Thank you for what have you done so far, and hope I will be able to contribute to this project soon!
DottMichela Lai
@michelalai:matrix.org
[m]

Hi! Sorry for bothering for the very first day, but I noticed that the pip installing is complaining that
einsteinpy requires Python '>=3.7' but the running Python is 2.7.17

while I just installed python 3.8, and also the alias "python" points to that one, so why does it search for the oldest python? How can I force it to choose the 3.8 version I installed?

DottMichela Lai
@michelalai:matrix.org
[m]
Hi! hope This time will be easier

Processing /project/6004969/mlai92/einsteinpy
Installing collected packages: UNKNOWN
Running setup.py install for UNKNOWN ... error
Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-Ycu7Ai-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-oH81vU-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'setup_cfg'
warnings.warn(msg)
running install
running build
running install_egg_info
running egg_info
creating UNKNOWN.egg-info
writing UNKNOWN.egg-info/PKG-INFO
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'

reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
warning: no files found matching '*.py' under directory 'src/einsteinpy/tests'
warning: no files found matching '*.html' under directory 'src/einsteinpy/tests'
no previously-included directories found matching 'docs/source/examples/.ipynb_checkpoints'
warning: no previously-included files matching '*.py[cod]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
Copying UNKNOWN.egg-info to /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg-info
error: /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg-info: Permission denied

----------------------------------------

Command "/usr/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-Ycu7Ai-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-oH81vU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-Ycu7Ai-build/

This is the output when I try to install it from the git repository. The python version is 3.7.7
Any idea of how can I solve this?
DottMichela Lai
@michelalai:matrix.org
[m]
oky, I solved the issue. Let me know if anyone want to work together
@yasphy:matrix.org
[m]
Hello everyone. I am an undergrad student from India and I wish to contribute in this community and I wish to know if some project we can make for GSOC 22 on behalf of sympy library. Kindly guide me in my path
James Chryssanthacopoulos
@jamesc112186:matrix.org
[m]
Hi, I am new to einsteinpy. Does anyone know if it's able to compute an Einstein tensor for a metric that has unknown functions of the coordinates in it? For example, if you're interested in a particular metric ansatz, and want to reduce the Einstein equation to a corresponding equation for the ansatz. Thanks!
lgraham20
@lgraham20
Hi, I'm a bit confused by the indices of the Riemann tensors calculated by EinsteinPy. I have a 3D metric, so the Riemann tensor is a 3x3 matrix (I'll call it the outer matrix) where each element is another 3x3 matrix (the inner matrices). I assumed the indexing would be $R^{a}_{bcd}$ with a being the row of the outer matrix, b being columns, and then c&d being the respective indices for the inner matrices. This doesn't appear to be the case when I compare my Riemann tensor generated by EinsteinPy to hand calculations.
What I'm noticing is a & d are the indices for the outer matrix, and then cb the row/column for the inner matrix. Is this correct?
JeS24
@jes0:matrix.org
[m]

I believe, it is better to use the term "array" instead of "matrix" (rank-2 tensor).

RbcdaR^{a}_{bcd}Rbcda

Could you clarify this term? This does not look right (wrt indices repeating more than twice & their ordering).

a being the row of the outer matrix, b being columns, and then c&d being the respective indices for the inner matrices.

Right. This is how it should work in EinsteinPy, as long as the index labels are ordered first-to-last for a Riemann (or a general rank-4) tensor denoted as R_{abcd}. Two things to note here:

• R (here) should not be understood to be covariant. abcd could just as well denote upper / lower indices - this does not affect array-indexing.
• a, b, c, d are just labels, that might change their ordering based on tensor operations (such as transpose), when mathematically represented in the Einstein notation. But these operations do not change the order in which the array elements are accessed / indexed, which remains first-to-last. The elements within the array are obviously altered.

For example, if you have a rank-4 tensor, T_{abcd}, here a & b would denote the rows & columns of the outer array respectively, and c & d would denote the rows & columns for the inner arrays. However, if you transpose the last two indices to get T_{abdc} in Einstein notation, this would swap elements along those axes, but the array-indexing order remains the same afterwards, which in turn means, c no longer denotes the rows of the inner arrays & d no longer denotes the columns of the inner arrays. Their roles are now reversed with c denoting the columns and d denoting the rows. Meanings of a & b of course do not change in this case.

What I'm noticing is a & d are the indices for the outer matrix, and then cb the row/column for the inner matrix. Is this correct?

If the order of indices in your array-indexing is a, b, c, d, then this doesn't seem right. Could you please share the metric you used to generate the Riemann tensor and also how you are accessing the elements of the Riemann tensor in code? As stated above, tensor operations (transposition, contractions etc) change the meaning of the indices, but not the order in which the array elements are accessed / indexed. The symmetries of the Riemann tensor might also be playing in role in your confusion.

14 replies
[m]
I have a change that allows the user to provide arbitrary metrics to the Geodesic derived classes. Would this be of interest? Should I submit my PR?
Emanuil Hristov
@moni42077

I am new to einsteinpy and have been reading a lot of documentation but there seems to be a lot of outdated stuff. I wanted to ask how to make use of the body module to get geodesics equivalent to the old geodesic = Geodesic(body = Particle,.... For example, I have the following system :

cord = CartesianDifferential(t=0*u.s,x=20*u.km,y=100*u.km,z=0*u.km,v_x=10*u.km/u.s,v_y=0*u.km/u.s,v_z=0*u.km/u.s)
b1 = Body(name='Attractor',mass = 1e10*u.kg,R = 1e06*u.km)
part = Body(name='Particle',mass=16e-28*u.kg,R = 8e-18*u.km,parent=b1,differential=cord)

How do I calculate the geodesic here? And what if I have more bodies?

jes0
@jes0:matrix.org
[m]

How do I calculate the geodesic here?

This API is from v0.3.1 and lower. Ensure that you are using 0.3.1 (pip install einsteinpy==0.3.1 should work), and try this code:

import astropy.units as u
from einsteinpy.coordinates import CartesianDifferential
from einsteinpy.geodesic import Geodesic
from einsteinpy.bodies import Body
from einsteinpy.plotting import GeodesicPlotter, StaticGeodesicPlotter
from einsteinpy.metric import Schwarzschild

# In EPy v0.3.1 and lower, CartesianDifferential does not take a t argument.
cord = CartesianDifferential(x=20*u.km,y=100*u.km,z=0*u.km,v_x=10*u.km/u.s,v_y=0*u.km/u.s,v_z=0*u.km/u.s)
b1 = Body(name='Attractor', mass=1e10*u.kg, R = 1e06*u.km)
part = Body(name='Particle', mass=16e-28*u.kg, R = 8e-18*u.km, parent=b1, differential=cord)

# Given the large distance between the test particle and the black hole, you will need a large step size to get results
# in a reasonable amount of time. Note that this means that the results will be less accurate, especially near the black hole.
geod = Geodesic(body=part, end_lambda=3000, step_size=5, metric=Schwarzschild) # metric=Schwarzschild by default

plotter = StaticGeodesicPlotter()
plotter.plot(geod)
plotter.show()

And what if I have more bodies?

If you want to have more test particles (vis-à-vis Particle in your code), the only thing you need to ensure is that particle masses << the mass of the black hole (Attractor in your code). So, the code should look something like this:

# imports and definitions as above
cord1 = CartesianDifferential(x=..., y=..., z=..., v_x=..., v_y=..., v_z=...)
cord2 = CartesianDifferential(x=..., y=..., z=..., v_x=..., v_y=..., v_z=...)

part1 = Body(name='Particle',mass=...,R = ...,parent=b1, differential=cord1)
part2 = Body(name='Particle',mass=...,R = ...,parent=b1, differential=cord2)
# and so on

geod1 = Geodesic(body=part1, end_lambda=..., step_size=...)
geod2 = Geodesic(body=part2, end_lambda=..., step_size=...)
# and so on

# plotting code as above

Multiple "attractors" with comparable masses will alter the background metric (Schwarzschild in this case) and it will require solving the full Einstein field equations (or a perturbed / linearized form of them) to get the form of the metric that can define this new spacetime geometry with multiple gravitating masses.

Some other things to add here:
1. To avoid the issue of large step_size and inaccurate results, we generally make use of Geometrized units in numerical relativity, which rescale SI quantities such that large distances and steps are not needed to explore interesting phenomena. This is also why we pivoted away from this API in later versions of EPy (which use M-units, G = c = M = 1).
2. Be careful while changing the metric in Geodesic above, since not all metrics enjoy the generalizability given to Schwarzschild-like metrics by the Birkhoff theorem.
jes0
@jes0:matrix.org
[m]
Koustubh Bhattacharjee
@kbohuastt:matrix.org
[m]
hello there, sorry if this is rather abrupt. How do i contribute to this project?
Rachitt Shah
@rachittshah

Hi folks, been a part of this community since 2020, but haven't contributed much. I'm looking to work with interesting open-source projects, hence I'm here.

GSoC'2021 at Stingray, GSoD'21/22. Ex: Sequoia Cap, Blume Ventures, Venture Highway.

I was looking at issues, and wished to pickup: einsteinpy/einsteinpy#626 to understand the codebase better

JeS24
@jes0:matrix.org
[m]
Hi rachitt_shah: Long time. Sure, you can work on that issue. Feel free to ask here, if you need help with anything. The updated dev guide at https://docs.einsteinpy.org/en/latest/dev_guide.html should cover most generic issues with setup.
Also, I am working on changes and updates to EinsteinPy symbolic. So, for now, you can start with other modules for the example notebooks.
Rachitt Shah
@rachittshah
Hi @jes0:matrix.org ! Finished local setup. Was reading more about the docs and then would read some code, would ask my doubts soon
Rachitt Shah
@rachittshah
3 replies
Rachitt Shah
@rachittshah
Agreed streamlit is overkill, but I believe it would vastly improve the docs given we can make it interactive
I would check the issues with RTD as well
rashmikamath
@rashmikamath:matrix.org
[m]
Hi all, I'm interested to contribute to open source projects, and I am new to the community. I familiarized myself with the contributing guidelines and I'd like to start by contributing to the Documentation overhaul #630.
2 replies
Github
@_neb_github:matrix.org
[m]
einsteinpy/einsteinpy#630 : Documentation overhaul