Support Eq, tensor_cross, nabla symbol and component() method · Issue #587 · einsteinpy/einsteinpy · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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
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.
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.
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.
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.
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.
Let’s support$\nabla$ symbol in
Eq
,tensor_cross
,Eq
andcomponent()
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.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.The users may choose to express their tensor relation in compact and symbolic form. Let$\nabla\times$ in the compact equation form, while $\epsilon_{ijk}$ in the component equation form. Similar is the
tensor_cross
to be liketensor_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
Inherit a class
TEq
fromsympy.Eq
, therefore in einsteinpy we can flexibily reuse and override the pre-existing methods of sympy and utilize its functionality.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.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 astensor_cross
.The$\nabla$ symbol in $\nabla$ , $\nabla \times$ and $\nabla \cdot$ . I do not suggest
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 withChristoffel tensors
are necessary to implement thedoit()
method to compute the lazy symbol.component()
orcomponents()
might be better for tensors.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.
The text was updated successfully, but these errors were encountered: