In [18]:
from printer import  Format
from ga import Ga
from sympy import symbols

In [19]:
Format(ipy=True)

In [20]:
coords = (x,y,z) = symbols('x,y,z',real=True)
(o3d,ex,ey,ez) = Ga.build('e_x e_y e_z',g=[1,1,1],coords=coords)


---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-20-c8e26a0d73fc> in <module>()
      1 coords = (x,y,z) = symbols('x,y,z',real=True)
----> 2 (o3d,ex,ey,ez) = Ga.build('e_x e_y e_z',g=[1,1,1],coords=coords)

/home/brombo/MathPhysics/ga/ga.pyc in build(*kargs, **kwargs)
    167         algebra, basis vectors, and grad operator as a tuple.
    168         """
--> 169         GA = Ga(*kargs, **kwargs)
    170         basis = list(GA.mv())
    171         return tuple([GA] + basis)

/home/brombo/MathPhysics/ga/ga.pyc in __init__(self, bases, **kwargs)
    217         if self.coords is not None:
    218             self.coord_vec = sum([coord * base for (coord, base) in zip(self.coords, self.basis)])
--> 219             self.build_reciprocal_basis(kwargs['gsym'])
    220             self.pd0 = self.n * [0]
    221             # Partial derivative indices for no differentiation

/home/brombo/MathPhysics/ga/ga.pyc in build_reciprocal_basis(self, gsym)
   1196                 rx_j = self.r_symbols[j]
   1197                 if j >= i:
-> 1198                     g_inv[i, j] = self.dot(self.r_basis_dict[rx_i], self.r_basis_dict[rx_j])
   1199                     if not self.is_ortho:
   1200                         g_inv[i, j] /= self.inorm

/home/brombo/MathPhysics/ga/ga.pyc in dot(self, A, B)
    955             A = self.remove_scalar_part(A)
    956             B = self.remove_scalar_part(B)
--> 957             return update_and_substitute(A, B, dot_product_basis_blades, self.dot_table_dict)
    958         else:
    959             if self.dot_mode == '<':  # Left contraction

/home/brombo/MathPhysics/ga/ga.pyc in update_and_substitute(expr1, expr2, func, mul_dict)
     88                 #Update mul dictionary for future
     89                 if key not in mul_dict:
---> 90                     mul_dict[key] = func(key)
     91                 expr += coef1 * coef2 * mul_dict[key]
     92     return expr

/home/brombo/MathPhysics/ga/ga.pyc in dot_product_basis_blades(self, blade12)
    718         # dot product for orthogonal basis
    719         (blade1, blade2) = blade12
--> 720         index1 = self.blades_to_indexes_dict[blade1]
    721         index2 = self.blades_to_indexes_dict[blade2]
    722         index = list(index1 + index2)

KeyError: e_x

In [ ]:
v = o3d.mv('v','vector')

In [ ]:
v

In [ ]:
V = o3d.mv('V','vector',f=True)

In [ ]:
V

In [ ]:
gradV = o3d.grad*V

In [21]:
gradV


Out[21]:
\begin{equation*} \left ( \partial_{x} V^{x} + \partial_{y} V^{y} + \partial_{z} V^{z} \right ) + \left ( - \partial_{y} V^{x} + \partial_{x} V^{y} \right ) \boldsymbol{e_{x}\wedge e_{y}} + \left ( - \partial_{z} V^{x} + \partial_{x} V^{z} \right ) \boldsymbol{e_{x}\wedge e_{z}} + \left ( - \partial_{z} V^{y} + \partial_{y} V^{z} \right ) \boldsymbol{e_{y}\wedge e_{z}} \end{equation*}

In [21]:


In [22]:
lap = o3d.grad|o3d.grad

In [23]:
lap


Out[23]:
<mv.Dop at 0x7f5a659c6a90>

In [24]:
A = o3d.lt('A')

In [25]:
A


Out[25]:
<lt.Lt at 0x7f5a659c6bd0>

In [25]: