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

tensor product does not transform correctly with the metric #14131

Open
danielmaitre opened this issue Feb 9, 2018 · 0 comments
Open

tensor product does not transform correctly with the metric #14131

danielmaitre opened this issue Feb 9, 2018 · 0 comments
Labels

Comments

@danielmaitre
Copy link

a tensor product of two vectors does not behave in the same way as a tensor defined with the same indices. I would expect the two lines printed by this snippet to be the same, but there is a sign difference.

from sympy.tensor.tensor import TensorIndexType, tensorhead, tensor_indices

undotted = TensorIndexType('undotted', dummy_fmt='a',metric=True)
undotted.data=[[0,1],[-1,0]]
dotted = TensorIndexType('dotted', dummy_fmt='ad',metric=True)
dotted.data=[[0,1],[-1,0]]

a0 = tensor_indices('a0', undotted)
ad0 = tensor_indices('ad0', dotted)

S = tensorhead('S', [dotted, undotted], [[1],[1]])
l= tensorhead('l', [ undotted],[[1]],comm=2)
lt= tensorhead('lt', [ dotted],[[1]],comm=2)

l(a0).data=[1,10]
lt(ad0).data=[2,3]

ltl=lt(ad0)*l(a0)

S(ad0,a0).data = ltl(ad0,a0).data

S(ad0,a0).data

print S(-ad0,-a0).data

print ltl(-ad0,-a0).data

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

No branches or pull requests

2 participants