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

Matrix_to_dictionary and Dictionary_to_Matrix are not inverses #456

Closed
eric-wieser opened this issue Sep 14, 2020 · 1 comment
Closed

Matrix_to_dictionary and Dictionary_to_Matrix are not inverses #456

eric-wieser opened this issue Sep 14, 2020 · 1 comment

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Sep 14, 2020

This bug was introduced by a3b4651

>>> from sympy import Matrix
>>> from galgebra.lt import Matrix_to_dictionary, Dictionary_to_Matrix
>>> from galgebra.ga import Ga

>>> g2 = Ga('e_x e_y', g=[1,1])
>>> m = Matrix([
... [1, 2],
... [3, 4]])

>>> d = Matrix_to_dictionary(m, g2.basis)
>>> d
{e_x: e_x + 3*e_y, e_y: 2*e_x + 4*e_y}

# this is the transpose of `m`! So one of these functions is wrong
>>> Dictionary_to_Matrix(d, g2)
Matrix([
[1, 3],
[2, 4]]).T
@eric-wieser
Copy link
Member Author

Nevermind, I misread the .T - this is fine

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

1 participant