Something went wrong. Try again.
Julia interface to GAlgebra via PyCall 🔮 Mirror of https://github.com/pygae/GAlgebra.jl
Something went wrong. Try again.
Files
- Jupyter Notebook 74%
- Julia 26%
README.md
# GAlgebra.jl
Julia interface to [GAlgebra](https://github.com/pygae/galgebra), a symbolic Geometric Algebra/Calculus package for SymPy.
## Development Status
Very early. But it already works and has many tests.
| **Build Status** |
|:-----------------------------------------------------------------------------------------------:|
|  [](https://codecov.io/gh/pygae/GAlgebra.jl) |
## Getting Started
GAlgebra.jl itself doesn't depend on [SymPy.jl](https://github.com/JuliaPy/SymPy.jl), but is designed to work with it.
After installing SymPy.jl and GAlgebra.jl (see below for instructions), you may experiment with GAlgebra.jl just like in the Python version of GAlgebra (though [there're some syntax differences between Python and Julia](https://docs.julialang.org/en/v1/manual/noteworthy-differences/#Noteworthy-differences-from-Python-1) like `True`/`true`, `'`/`"` etc.).
For example, you may start with:
```julia
import SymPy: symbols, sympy, Sym
using GAlgebra
# In console, uncomment to enable colored printing with ANSI escape sequences
# galgebra.printer.Eprint()
# In Jupyter, uncomment to enable LaTeX printing with MathJax
# galgebra.printer.Format()
(x, y, z) = xyz = symbols("x,y,z",real=true)
o3d = galgebra.ga.Ga("e", g=[1, 1, 1], coords=xyz)
u = o3d.mv("u", "vector")
v = o3d.mv("v", "vector")
A = o3d.mv("A", "mv")
R = o3d.mv("R", "spinor")
# Volume element
I = o3d.I()
# Wedge product: ∧ \wedge
v ∧ A
# Hestenes' inner product: ⋅ \cdot
v ⋅ A
# Left contraction: ⨼ \intprod
v ⨼ A
# Right contraction: ⨽ \intprodr
v ⨽ A
# Scalar product: ⊛ \circledast
# A ⊛ B = <A B†>
v ⊛ A
# Commutator product: ⊠ \boxtimes
# A⊠B = (AB-BA)/2
v ⊠ A
# Anti-commutator product: ⊙ \odot
# A⊙B = (AB+BA)/2
v ⊙ A
# Norm: norm(A) = A.norm() := ||A||
norm(v)
# Inverse: postfix ⁻¹ \^-\^1
# (A)⁻¹ = A^-1 = inv(A) = A.inv()
(R)⁻…