pygae / galgebra

Symbolic Geometric Algebra/Calculus package for SymPy :crystal_ball:
https://galgebra.rtfd.io/
BSD 3-Clause "New" or "Revised" License
227 stars 62 forks source link

Notation for linear transformations/outermorphishms is inconsistent with that used elsewhere #475

Closed Greg1950 closed 4 months ago

Greg1950 commented 3 years ago

When GAlgebra displays the expansion of a multivector in terms of basis blades, it labels a basis blade with subscripted indexes but its expansion coefficient with superscripted indexes. To be consistent with such covariant/contravariant notation, the expansion of the image of a basis vector by a linear transformation should have the expansion coefficients written so that the left index appears as a superscript and the right index as a subscript. In LaTeX one would write

$$ \mathsf{L}(\mathbf{b}_j) = \sum_{i=1}^n \mathbf{b}_i {L^i}_j $$

where $\mathbf{b}_j$ is the $j$-th basis vector. The expansion coefficients form the matrix $[ {L^i}_j ]$ of the transformation $\mathsf{L}$ with respect to the basis ${\mathbf{b}_1, ..., \mathbf{b}_n}$ as that matrix is defined by virtually every linear algebra textbook. (A very few older books---an example is Herstein's Topics in Algebra---interchange the meanings of the left and right indexes, so that their matrix of a transformation is the transpose of the one defined above.)

Most introductory linear algebra textbooks do not use covariant/contravariant notation but instead write all indexes as subscripts. The matrix elements are then written $L_{ij}$ instead of ${L^i}_j$. This is what GAlgebra is doing. Such inconsistency in notation is jarring to people familiar with tensor analysis.

I suspect that the index placement may have something to do with GAlgebra building on the linear algebra capabilities of SymPy, but I do not know that as a fact. I wish that I could do more than just point out the notational inconsistency and instead offer a code fix, but such goes way beyond my elementary skills at programming.

eric-wieser commented 3 years ago

Are you referring to this latex printing?

https://github.com/pygae/galgebra/blob/94a5f65d6dbf8176637eaa9a1479713efa719313/galgebra/lt.py#L489-L497

Or to the documentation?

Greg1950 commented 3 years ago

The attached .zip file contains an .html version of a Jupyter notebook. The .html explains my concern better than did the original posting.

Sorry, but I'm only able to state that concern. My programming skills are not up to offering a code fix.

Component notation inconsistency.zip

Greg1950 commented 3 years ago

Closed inadvertently. Now reopened.

utensil commented 4 months ago

Thank you, @Greg1950 , I believe this is covered by your improvements merged by #510 . Feel free to reopen if there are remaining issues.