einsteinpy icon indicating copy to clipboard operation
einsteinpy copied to clipboard

the terms of the Ricci Tensor are tangled

Open AfnanAlsaati opened this issue 3 years ago • 5 comments

Hi everyone, when i print the ricci tensor in pyhton (with sympy and einteinpy) the results are tangled how can I resolve this ? I really don't understand how I should read this If I can have some help please in this picture, this is for the Ricci scalar image

AfnanAlsaati avatar May 11 '21 16:05 AfnanAlsaati

Hey @AfnanAlsaati , can you share some code snippet which can help me understand the problem well?

shreyasbapat avatar May 14 '21 16:05 shreyasbapat

Hi @shreyasbapat, Yes of course, image

I finally do my work on Notebook. I dont know why but in Python I can't display well the tensor like I said before

AfnanAlsaati avatar May 17 '21 22:05 AfnanAlsaati

Thanks @AfnanAlsaati . I will get back to you in a day or two on this.

shreyasbapat avatar May 19 '21 18:05 shreyasbapat

Also, would be great if the code snippet can be placed in a Github Gist or something like that. Because it helps understand the problem better.

shreyasbapat avatar May 19 '21 18:05 shreyasbapat

Hi @shreyasbapat , Ok ! Tank you

This is my display of the tensor on Jupyter(notebook) work well. It is only in python my problem. I don't know why it don't work. Do you want that a copy and paste my python code ?

AfnanAlsaati avatar May 19 '21 18:05 AfnanAlsaati

Hey @AfnanAlsaati, thanks for opening this issue. Since the elements in the matrix are quite long, they are getting split into multiple lines. So, the terminal window is unable to fit the whole matrix, leading to symbols being tangled. Another issue is that Sympy usually cannot generate latex output in the terminal, because many terminals do not support the full Unicode character set (UTF-8) out-of-the-box. The most elegant solution is to use Jupyter notebook, either in a browser like you are doing, or in a code editor like Visual Studio Code.

That said, if you have to use python in the terminal, ensure that UTF-8 support is enabled and that you are using a terminal font that also supports UTF-8. The exact way to do this depends on your terminal.

I am closing this issue as resolved. Feel free to comment here, if you have any further questions.

JeS24 avatar Oct 28 '22 10:10 JeS24