```python
# Make SymPy available to this program:
import sympy 
from sympy import *

# Make GAlgebra available to this program:
from galgebra.ga import *  
from galgebra.mv import *
from galgebra.printer import Fmt, GaPrinter, Format
    # Fmt:       sets the way that a multivector's basis expansion is output.
    # GaPrinter: makes GA output a little more readable.
    # Format:    turns on latex printer.
from galgebra.gprinter import gFormat, gprint
gFormat()
```


```python
# Set up standard G^3 geometric algebra
g3coords = (x,y,z) = symbols('x y z', real=True) # Without real=True, symbols are complex
g3 = Ga('\mathbf{e}', g=[1,1,1], coords=g3coords)
(ex, ey, ez) = g3.mv()     # Program names of basis vectors.
(exr, eyr, ezr) = g3.mvr() # Program names of reciprocal basis vectors.
```


```python
gprint(r'word word\ word \cdot ex<ey', r'\\ \text{word word\ word \cdot ex<ey)}')
    # \\ gives a new line. The second string encloses the first in \text{}.
```


```python
B = g3.mv('B', 'bivector')
Fmt(1)  # Set Fmt globally
gprint(r'\mathbf{B} =', B)         # B will be bold.
gprint(r'\mathbf{B} =', B.Fmt(3))  # Fmt(3) here only.
gprint(r'\mathbf{B} =', B)         # Global Fmt remembered.
```


```python
gprint(r'\mathbf{B}^2 =', B*B)
```


```python
M = g3.mv('M', 'mv')
gprint(r'\langle \mathbf{M} \rangle_2 =', M.grade(2)) 
   # grade(2) could be replaced by, e.g., odd(), or omitted altogether. 
```


```python
gprint(r'\alpha_1\mathbf{X}/\gamma_r^3')
```


```python
# Program name and output are different
theta = symbols('theta', real = True) 
th = symbols('theta', real = True)  # This will save typing if theta is used a lot.
gprint(theta, ', ', th)
```


```python
grad = g3.grad
```


```python
grad
```


```python
gprint(r'{\nabla}')
```


```python

```

99ace15d1fbbdf07263588dbb667a03986750bd8
ipynb
Jupyter Notebook
python/GeometryAG/gaprimer/GAlgebraOutput.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/GeometryAG/gaprimer/GAlgebraOutput.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/GeometryAG/gaprimer/GAlgebraOutput.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
Qwen/Qwen-72B
1. YES
2. YES