Let $f$ be an outermorphism on a geometric algebra Ga. The matrix of $f$ with respect to a basis $b_1, ..., b_n$ is defined by $f(b_j) = \sum\limits_{i=1}^n f_{ij} b_i$. The definition can be found in virtually any introductory linear algebra book, so call $[ f_{ij} ]$ the standard matrix of $f$ with respect to the indicated basis. The coefficients $f_{ij}$ in the expansion of $f(b_j)$ do not depend on the metric, although they can be computed using the inner product and the reciprocal basis vectors $b^1, ..., b^n$.
(Note in particular that the left index on $f_{ij}$ is the one summed over. GAlgebra's documentation, if it can be trusted, writes the defining equation as $L(b_i) = \sum\limits_{j=1}^n L_{ij} b_j$, with the summed-over index on the right. This would have the effect of defining a matrix $[ L_{ij} ]$ which is the transpose of $L$'s standard matrix.)
Problem #1: I have discovered that the method .matrix(), the code for which appears in the module lt.py, returns a matrix which iis metric dependent and so cannot be the standard matrix. The command f.matrix() returns the standard matrix only when
- the inner product is Euclidean, and
- the basis used is orthonormal.
I've also discovered that post-multiplication of f.matrix() by Ga.g_inv produces the standard matrix for f with respect to the basis used to generate Ga.
As evidence I am attaching a file Linear Transformations.zip. It contains six Jupyter notebooks, which parallel each other in format, that examine the situation using different signature inner products and different bases. It also contains gprinter.py, a new module from Alan Bromborsky, that aids the construction of formatted output and which was used by the notebooks mentioned. Lastly, the zip file contains a notebook g2.ipynb which is easier to examine than the other six notebooks.
Suggested Solution for Problem #1: The next-to-last line of the code for the .matrix() method reads
self.mat = Dictionary_to_Matrix(self.lt_dict, self.Ga) * self.Ga.g
While I have only rudimentary programming skills, it seems to me that simply replacing that line by
self.mat = Dictionary_to_Matrix(self.lt_dict, self.Ga)
will correct the problem with the transformation method .matrix(). The idea is that the multiplication of the incorrect matrix by Ga.g_inv effectively cancels out the multiplication by self.Ga.g.
Problem #2: If one applies the method .det() to an outermorphismf, strange things can happen. Look at the notebooks, other than g2.ipynb, in the attached zip file. Towards the end of each notebook one will see f.det() returning incorrect answers. Sometimes the correct answer is returned, sometimes a pseudoscalar is returned instead of the scalar which should be returned, and in one instance (hyperbolic plane, polar coordinates.ipynb) an answer is returned which multiplies the pseudoscalar by SymPy's unit imaginary i (geometric algebra doesn't use imaginary numbers, per se).
Solution for Problem #2: I have none. But I suspect the appearance of the unit imaginary arises with an incorrect computation of the unit pseudoscalar Ga.I(). That in turn may be linked to incorrect computation of a blade's norm. (I plan to post separately with regards to a multivector's norm-squared and norm.)
Greg Grunberg
Addendum: The Suggested Solution for Problem #1, described above, sort of worked. I made the change indicated in the suggestion. Afterwards f.matrix() would returned an answer in the form of a matrix with a transposition T as a superscript. Upon carrying out the indicated transposition, the desired standard matrix was obtained. I then restored the code for the method .matrix(), and then wrote a new method as follows:
def std_matrix(self) -> Matrix:
r"""
Returns the standard matrix representation :math:`\left[ {{f}^i}_{j} \right]` of
the linear transformation :math:`f`, with entries defined by the equations
:math:`{{f}\lp {{{\eb}}_{j}} \rp} = {{\eb}}_{i} {{f}^i}_{j}`.
"""
standard_matrix = self.matrix() * self.Ga.g_inv
return standard_matrix
Testing f.std_matrix() for all outermorphisms examined in then notebooks contained in the zip file, in each case the metric-independent standard matrix was returned.
Linear Transformations.zip
Let$f$ be an outermorphism on a geometric algebra $f$ with respect to a basis $b_1, ..., b_n$ is defined by $f(b_j) = \sum\limits_{i=1}^n f_{ij} b_i$ . The definition can be found in virtually any introductory linear algebra book, so call $[ f_{ij} ]$ the standard matrix of $f$ with respect to the indicated basis. The coefficients $f_{ij}$ in the expansion of $f(b_j)$ do not depend on the metric, although they can be computed using the inner product and the reciprocal basis vectors $b^1, ..., b^n$ .
Ga. The matrix of(Note in particular that the left index on$f_{ij}$ is the one summed over. GAlgebra's documentation, if it can be trusted, writes the defining equation as $L(b_i) = \sum\limits_{j=1}^n L_{ij} b_j$ , with the summed-over index on the right. This would have the effect of defining a matrix $[ L_{ij} ]$ which is the transpose of $L$ 's standard matrix.)
Problem #1: I have discovered that the method
.matrix(), the code for which appears in the module lt.py, returns a matrix which iis metric dependent and so cannot be the standard matrix. The commandf.matrix()returns the standard matrix only whenI've also discovered that post-multiplication of
f.matrix()byGa.g_invproduces the standard matrix forfwith respect to the basis used to generateGa.As evidence I am attaching a file Linear Transformations.zip. It contains six Jupyter notebooks, which parallel each other in format, that examine the situation using different signature inner products and different bases. It also contains gprinter.py, a new module from Alan Bromborsky, that aids the construction of formatted output and which was used by the notebooks mentioned. Lastly, the zip file contains a notebook g2.ipynb which is easier to examine than the other six notebooks.
Suggested Solution for Problem #1: The next-to-last line of the code for the
.matrix()method readsWhile I have only rudimentary programming skills, it seems to me that simply replacing that line by
will correct the problem with the transformation method
.matrix(). The idea is that the multiplication of the incorrect matrix byGa.g_inveffectively cancels out the multiplication byself.Ga.g.Problem #2: If one applies the method
.det()to an outermorphismf, strange things can happen. Look at the notebooks, other than g2.ipynb, in the attached zip file. Towards the end of each notebook one will seef.det()returning incorrect answers. Sometimes the correct answer is returned, sometimes a pseudoscalar is returned instead of the scalar which should be returned, and in one instance (hyperbolic plane, polar coordinates.ipynb) an answer is returned which multiplies the pseudoscalar by SymPy's unit imaginary i (geometric algebra doesn't use imaginary numbers, per se).Solution for Problem #2: I have none. But I suspect the appearance of the unit imaginary arises with an incorrect computation of the unit pseudoscalar
Ga.I(). That in turn may be linked to incorrect computation of a blade's norm. (I plan to post separately with regards to a multivector's norm-squared and norm.)Greg Grunberg
Addendum: The Suggested Solution for Problem #1, described above, sort of worked. I made the change indicated in the suggestion. Afterwards
f.matrix()would returned an answer in the form of a matrix with a transpositionTas a superscript. Upon carrying out the indicated transposition, the desired standard matrix was obtained. I then restored the code for the method.matrix(), and then wrote a new method as follows:Testing
f.std_matrix()for all outermorphisms examined in then notebooks contained in the zip file, in each case the metric-independent standard matrix was returned.Linear Transformations.zip