Skip to content
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

replace_with_arrays is too picky about up/down indices #2

Open
rjrosati opened this issue Jul 14, 2020 · 1 comment
Open

replace_with_arrays is too picky about up/down indices #2

rjrosati opened this issue Jul 14, 2020 · 1 comment

Comments

@rjrosati
Copy link
Owner

replace_with_arrays has sufficient information to work in cases like:

replace_with_arrays(A(i)*A(j)*field.metric(-i,-j), Dict(A(-i) => [0, 1], field.metric(i,j) => [1 0; 0 1]) )

This function should internally know that field.metric(-i,-j) is just inv([1 0; 0 1]), and that A(i) is just A(-j)*field.metric(i,j) == [0,1]' * [1 0; 0 1], but it gives an unspecified metric error.

This error is upstream and also exists in sympy.tensor.tensor. Should we rewrite replace_with_arrays?

@rjrosati
Copy link
Owner Author

This is a syntax issue, this seems to work just fine:

replace_with_arrays(A(i)*A(j)*field.metric(-i,-j), Dict(A(-i) => [0, 1], field => [1 0; 0 1]) )

Still, should we modify replace_with_arrays to be more friendly at all?

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

No branches or pull requests

1 participant