8000 Support Eq, tensor_cross, nabla symbol and component() method · Issue #587 · einsteinpy/einsteinpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support Eq, tensor_cross, nabla symbol and component() method #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WenyinWei opened this issue May 11, 2021 · 2 comments
Open

Support Eq, tensor_cross, nabla symbol and component() method #587

WenyinWei opened this issue May 11, 2021 · 2 comments

Comments

@WenyinWei
Copy link
WenyinWei commented May 11, 2021

Let’s support Eq, tensor_cross, $\nabla$ symbol in Eq and component() method. Furthermore, allow the user to express the equation in compact (tensor symbol) form or component form, e.g.

Compact form: $\mathrm{A} \cdot \mathrm{B}$

Component form: $A^i_j B^j_k \hat{e}_i \hat{e}^j\hat{e}_j \hat{e}^k = A^i_j B^j_k \hat{e}_i \hat{e}^k$

🎯 Goal

Let Einsteinpy be a standard package in the domain of CAS-tensor. I found einsteinpy even more powerful and elegant than the sympy.tensor module and anything else. Let’s build it into a perfect package.

  1. Introducing the Eq class in einsteinpy would magnificently enhance the expression capability of einsteinpy and allow we express the equality relation of tensor concisely and easy-to-understand.

  2. The users may choose to express their tensor relation in compact and symbolic form. Let tensor_cross to be like $\nabla\times$ in the compact equation form, while $\epsilon_{ijk}$ in the component equation form. Similar is the tensor_prod.

Users of einsteinpy would benefit a lot from these features because they don’t even need to write formulas by hand in .ipynb Markdown blocks.

💡 Possible solutions

  1. Inherit a class TEq from sympy.Eq, therefore in einsteinpy we can flexibily reuse and override the pre-existing methods of sympy and utilize its functionality.

  2. It’s easy to deduce the component form from the compact one, however, not vice versa. So I suggest to preserve the compact form info in the Eq class instead of the info of the components.

  3. Let the tensor_prod allow multiple indexes contraction. It turns out to be cumbersome and easy to make mistakes if the user have to calculate the indexes by hand for multiple contraction. They know the indexes exactly but they would make mistakes if they have to compute indexes one contraction by one contraction, because the indexes shift; the same as tensor_cross.

  4. The $\nabla$ symbol in TEq can be a lazy symbol, which doesn’t transform to the components automatically but exists as a pure symbol. To make it smart enough to be able to derive the component form, the combination with Christoffel tensors are necessary to implement the $\nabla$, $\nabla \times$ and $\nabla \cdot$. I do not suggest doit() method to compute the lazy symbol. component() or components() might be better for tensors.

  5. The $\nabla$’s laziness might be helpful to make the vector and tensor identities possible. It would spend a lot of work on pattern matching to make $\nabla$ intelligent.

Wish someday it knows: $\nabla \times (\nabla \times \vec{A}) = \nabla (\nabla \cdot \vec{A}) - \nabla^2 \vec{A}$

📋 Steps to solve the problem

2021.5.11 Submitted the request and communicate with the community.

@shreyasbapat
Copy link
Member

Hey @WenyinWei , let's discuss more about this.

@WenyinWei
Copy link
Author

I would collect more info and record it here, about how other symbol engines handle such stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0