galgebra icon indicating copy to clipboard operation
galgebra copied to clipboard

Lt.matrix returns the transpose of the list of lists passed to its constructor

Open eric-wieser opened this issue 5 years ago • 7 comments

Split from gh-108:

>>> import sympy
>>> from galgebra.ga import Ga
>>> base=Ga('b*1|2|3',g=[1]*3,coords=sympy.symbols('x1:4',real=True))
>>> base.lt([
...     [1, -2,  3],
...     [4,  0,  3],
...     [7,  8, -9]
... ]).matrix()
Matrix([
[ 1, 4,  7],
[-2, 0,  8],
[ 3, 3, -9]])

Seems counter-intuitive that the constructor transposes the matrix. Cc @chaowenGUO, since this is very related to gh-104.

Note that this doesn't happen if a matrix is passed directly:

>>> base.lt(sympy.Matrix([
...     [1, -2,  3],
...     [4,  0,  3],
...     [7,  8, -9]
... ])).matrix()
Matrix([
[1, -2,  3],
[4,  0,  3],
[7,  8, -9]])

eric-wieser avatar Dec 16 '19 21:12 eric-wieser

It looks like this behavior was introduced in 358ca20619b8b2756d75cde4f2df770701615673

eric-wieser avatar Dec 16 '19 21:12 eric-wieser

Move it to 0.5.0 since it will break backwards-compatibility?

utensil avatar Dec 28 '19 13:12 utensil

Bumping this again, I haven't used Lt enough to understand it.

eric-wieser avatar May 29 '20 12:05 eric-wieser

We should unify the behavior to the same as when a matrix is passed directly.

utensil avatar Jun 02 '20 05:06 utensil

Some memories are coming back. The behaviors here have always confused me. Dictionary_to_Matrix() has a call to Transpose() in it. It seems weird to me.

utensil avatar Jun 02 '20 05:06 utensil

To clearly understand the expected behavior and possibly clean up the implementation, the dependency of this is to add more tests/examples of Lt and lt.py in general, I'll work on that in the next release.

utensil avatar Jun 02 '20 06:06 utensil

x-ref #208

utensil avatar Jun 02 '20 13:06 utensil