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

Getting coords of multivector #483

Open ingodahn opened 1 year ago

ingodahn commented 1 year ago

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])?

Greg1950 commented 1 year ago

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.

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: @.***>

ingodahn commented 1 year ago

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