All Projects â†’ pygae â†’ Galgebra

pygae / Galgebra

Licence: bsd-3-clause
Symbolic Geometric Algebra/Calculus package for SymPy 🔮

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Galgebra

Calogan
Generative Adversarial Networks for High Energy Physics extended to a multi-layer calorimeter simulation
Stars: ✭ 87 (-23.01%)
Mutual labels:  physics
Computer Science Resources
A list of resources in different fields of Computer Science (multiple languages)
Stars: ✭ 1,316 (+1064.6%)
Mutual labels:  physics
Ode4j
Java 3D Physics Engine & Library
Stars: ✭ 105 (-7.08%)
Mutual labels:  physics
Bout Dev
BOUT++: Plasma fluid finite-difference simulation code in curvilinear coordinate systems
Stars: ✭ 87 (-23.01%)
Mutual labels:  physics
Pyautolens
PyAutoLens: Open Source Strong Gravitational Lensing
Stars: ✭ 90 (-20.35%)
Mutual labels:  physics
Specs Physics
nphysics integration for the Specs entity component system
Stars: ✭ 94 (-16.81%)
Mutual labels:  physics
Verlyrangeslider
Range sliders with some verlet physics magic.
Stars: ✭ 84 (-25.66%)
Mutual labels:  physics
Cadabra2
A field-theory motivated approach to computer algebra.
Stars: ✭ 112 (-0.88%)
Mutual labels:  physics
Psrealvehicle
Plugin for Unreal Engine 4 with simple force-driven vehicle simulation
Stars: ✭ 92 (-18.58%)
Mutual labels:  physics
Rhusics
A cgmath physics library that can be used with Specs
Stars: ✭ 105 (-7.08%)
Mutual labels:  physics
Thephysicshub
The Physics Hub is an open source physics simulations project that is being developed by physics students worldwide and aims to deliver clear and easy to understand physics simulations free for everyone!
Stars: ✭ 88 (-22.12%)
Mutual labels:  physics
Tbtk
A C++ library for solving second-quantized Hamiltonians
Stars: ✭ 89 (-21.24%)
Mutual labels:  physics
Physics3d
A 3D physics engine
Stars: ✭ 101 (-10.62%)
Mutual labels:  physics
Buoyancysystem
A system for buoyancy and boat physics in Unreal Engine 4.
Stars: ✭ 87 (-23.01%)
Mutual labels:  physics
Interact
Brand New SwiftUI Library For Adding Dynamic Interaction To Views With Just A Single Modifier!
Stars: ✭ 107 (-5.31%)
Mutual labels:  physics
Helixjs
A Javascript 3D game engine.
Stars: ✭ 84 (-25.66%)
Mutual labels:  physics
Matter Attractors
an attractors plugin for matter.js
Stars: ✭ 93 (-17.7%)
Mutual labels:  physics
Nphysics
2 and 3-dimensional rigid body physics engine for Rust.
Stars: ✭ 1,530 (+1253.98%)
Mutual labels:  physics
Bulletsharppinvoke
.NET wrapper for the Bullet physics library using Platform Invoke
Stars: ✭ 108 (-4.42%)
Mutual labels:  physics
Root
The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
Stars: ✭ 1,377 (+1118.58%)
Mutual labels:  physics

GAlgebra

Symbolic Geometric Algebra/Calculus package for SymPy.

PyPI PyPI - Python Version Build Status on CircleCI Documentation Status DOI

Development Status

PyPI - Status GitHub contributors Codecov Language grade: Python Maintainability

brombo/galgebra was originally written by Alan Bromborsky, but was no longer actively maintained, and as of 2019-11-25 no longer exists.

pygae/galgebra is a community fork, maintained by Pythonic Geometric Algebra Enthusiasts.

The fork supports Python 3, increases test coverage, set up CI and linters, maintains releases to PyPI, improves docs and has many bug fixes, see Changelog.

Features

Geometric Algebra

  • Arbitrary Vector Basis and Metric
  • Scalar, Vector, Bivector, Multivector, Pseudoscalar, Spinor, Blade
  • Basic Geometic Algebra Operations
    • Sum Difference
    • Geometric Product
    • Outer and Inner Products
    • Left and Right Contractions
    • Reverse, Dual, Exponential
    • Commutator
    • Projection, Reflection, Rotation
    • Reciprocal Frames
  • Inspecting Base/Blade Representation
  • Symbolic Manipulations
    • expand, factor, simplify, subs, trigsimp etc.

Overloaded Python operators for basic GA operations:

Geometric Calculus

  • Geometric Derivative
  • Submanifolds
  • Linear Transformations
  • Differential Operators

The various derivatives of a multivector function is accomplished by multiplying the gradient operator vector with the function:

Tip: an example for getting grad and rgrad of a 3-d Euclidean geometric algebra in rectangular coordinates:

from sympy import symbols
from galgebra.ga import Ga

o3d = Ga('e', g=[1,1,1], coords=symbols('x,y,z',real=True))
(grad,rgrad) = o3d.grads()

Printing

  • Enhanced Console Printing
  • Latex Printing
    • out-of-the-box support for Jupyter Notebook
    • PDF generation and croping support if you have pdflatex/pdfcrop installed

Getting Started

After installing GAlgebra (see section Installing GAlgebra below), in a Jupyter Notebook:

from sympy import symbols
from galgebra.ga import Ga

from galgebra.printer import Format
Format(Fmode = False, Dmode = True)

st4coords = (t,x,y,z) = symbols('t x y z', real=True)
st4 = Ga('e',
         g=[1,-1,-1,-1],
         coords=st4coords)

M = st4.mv('M','mv',f = True)

M.grade(3).Fmt(3,r'\langle \mathbf{M} \rangle _3')

You will see:

You may also check out more examples here.

For detailed documentation, please visit https://galgebra.readthedocs.io/ .

NOTE: If you are coming from sympy.galgebra or brombo/galgebra, please check out section Migration Guide below.

Installing GAlgebra

Prerequisites

  • Works on Linux, Windows, Mac OSX
  • Python >= 3.5 (0.4.x was the last supported release series for Python 2.7)
  • SymPy >= 1.3

Installing GAlgebra From PyPI (Recommended for users)

pip install galgebra

Then you are all set!

Installing GAlgebra From Source (Recommended for developers)

To install from the latest source code of GAlgebra:

git clone https://github.com/pygae/galgebra.git
cd galgebra
pip install -e .

Note that the optional -e argument is used here for a developer install so modifying the source will take effect immediately without the need of reinstallation.

Now you may run tests to verify the installation, run from the root of the repository:

pip install pytest
pytest test

Further, to run the complete test suite including the ones using nbval, just run:

pip install nbval
pytest --nbval examples/ipython/ test --current-env --sanitize-with test/.nbval_sanitize.cfg

This could take more than 10 minutes, please be patient.

Migration Guide

Note: The APIs have changed since the era of sympy.galgebra and brombo/galgebra, some properties and methods are deprecated, the supported versions of Python and SymPy have also changed, please check Changelog and further update your scripts accordingly besides the following. If you encounter any problems, feel free to open an issue!

Migrating from sympy.galgebra

GAlgebra is no longer part of SymPy since 1.0.0, if you have an import like this in your source:

from sympy.galgebra.ga import *

Simply remove the sympy. prefix before galgebra then you are good to go:

from galgebra.ga import *

Migrating from brombo/galgebra

The setgapth.py way to install is now deprecated by pip install galgebra and all modules in GAlgebra should be imported from galgebra, for example:

from galgebra.printer import Format, Eprint, latex, GaPrinter
from galgebra.ga import Ga
from galgebra.mv import Mv, Nga

Bundled Resources

Note that in the doc/books directory there are:

  • BookGA.pdf which is a collection of notes on Geometric Algebra and Calculus based of "Geometric Algebra for Physicists" by Doran and Lasenby and on some papers by Lasenby and Hestenes.
  • galgebra.pdf which is the original main doc of GAlgebra in PDF format, while the math part is still valid, the part describing the installation and usage of GAlgebra is outdated, please read with cautious or visit https://galgebra.readthedocs.io/ instead.
  • Macdonald which constains bundled supplementary materials for Linear and Geometric Algebra and Vector and Geometric Calculus by Alan Macdonald, see here and here for more information.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].