galgebra icon indicating copy to clipboard operation
galgebra copied to clipboard

Getting coords of multivector

Open ingodahn opened this issue 2 years ago • 2 comments

How can I extract the coordinates of a multivector for further processing (e.g. as reals)?

Example: Given a multivector v=e_1+2*e_2+3*e_3 how can I calculate from it the list v1=(1,2,3) for further calculations, like getting math.sin(v1[1])?

ingodahn avatar Mar 09 '23 08:03 ingodahn

Suppose one has a multivector *M *. The command *M.blade_coefs() * will return a list of the coefficients in the basis blade expansion of M.

Example. E3 is a GAlgebra model of Euclidean 3-space.

  • M = E3.mv('M','mv') # instantiate a generic multivector M*
  • gprint(M) # output M *
  • gprint(M.blade_coefs()) # output the coefficients in the basis blade expansion of M*

The function gprint may be unfamiliar to you as it is not included with GAlgebra even though it was written by that program's original author (Alan Bromborsky). gprint produces typeset quality output, which I find very beneficial when dealing with mathematics.

To the best of my knowledge, GAlgebra (website https://github.com/pygae/galgebra) has not been maintained for the last three years, for GAlgebra has been stuck at version 0.5.0 throughout that period.

I found a good number of bugs in a couple of GAlgebra 0.5.0 's modules, and believe I have managed to eliminate them. Those corrected modules are not available from the GAlgebra website, but they may be acquired from the website of Alan Macdonald (author of Linear and Geometric Algebra and its sequel Vector and Geometric Algebra). To get gprint and those corrected modules:

  1. Go to http://www.faculty.luther.edu/~macdonal/laga/index.html .
  2. Click on the GAlgebraPrimer link to download the GAlgebraPrimer.pdf file (link takes you to http://www.faculty.luther.edu/~macdonal/GAlgebraPrimer.pdf ).
  3. On page 3 of that PDF file, click on the GAfiles.zip link to download that zip file (link is to http://www.faculty.luther.edu/~macdonal/GAfiles.zip ).
  4. GAlgebra Primer has instructions as to which files in GAfiles.zip need to be placed in your /site-packages/galgebra folder.

I hope you find the above information of use.

On Thu, Mar 9, 2023 at 2:44 AM Ingo Dahn @.***> wrote:

How can I extract the coordinates of a multivector for further processing (e.g. as reals)?

Example: Given a multivector v=e_1+2e_2+3e_3 how can I calculate from it the list v1=(1,2,3) for further calculations, like getting math.sin(v1[1])?

— Reply to this email directly, view it on GitHub https://github.com/pygae/galgebra/issues/483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2OCIEODOD66YY6NZGERTLW3GKAJANCNFSM6AAAAAAVUZKI7Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Greg1950 avatar Mar 09 '23 18:03 Greg1950

Thanks, this is indeed very useful. I'd suggest adding this example to Introduction to using GAlgebra — galgebra documentation https://galgebra.readthedocs.io/en/latest/tutorials/algebra.html

ingodahn avatar Mar 09 '23 20:03 ingodahn