galgebra
galgebra copied to clipboard
Lt.matrix returns the transpose of the list of lists passed to its constructor
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]])
It looks like this behavior was introduced in 358ca20619b8b2756d75cde4f2df770701615673
Move it to 0.5.0 since it will break backwards-compatibility?
Bumping this again, I haven't used Lt
enough to understand it.
We should unify the behavior to the same as when a matrix is passed directly.
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.
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.
x-ref #208