Skip to content

Commit 9c35d01

Browse files
eric-wieserutensil
authored andcommitted
Remove Ga.iobj, Ga.e_obj, and Ga.psuedoI (#76)
Rationale: * `Ga.iobj` was confusingly `Ga.e.obj` and not `Ga.i.obj`. * `Ga.e_obj` was just an alias of `Ga.e.obj`, which bizarrely only existed if the GA had a coords argument. * `Ga.psuedoI` was only set if the `Ga` was not orthonormal. Crucially though, it was set to the geometric product of the basis vectors, which is _not_ the psuedoscalar at all! There are still plenty of ways to spell the pseudo-scalar, leaving unification for a future task: * Normalized: * `ga.I()` * `ga.i` * Unnormalized: * `ga.E()` * `ga.e` * `ga.mv_I` (!) * Not-the-pseudo-scalar-at-all: * `ga.bases_lst[-1]`
1 parent 89c8536 commit 9c35d01

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

galgebra/ga.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ class Ga(metric.Metric):
226226
227227
Map index tuples to basis bases (dictionary).
228228
229-
.. attribute:: pseudoI
230-
231-
Symbol for pseudo scalar (non-commutative sympy symbol).
232-
233229
.. rubric:: Multiplication tables data structures
234230
235231
Keys in all multiplication tables (``*``, ``^``, ``|``, ``<``, ``>``) are always ``symbol1*symbol2``.
@@ -430,7 +426,7 @@ def __init__(self, bases, **kwargs):
430426
if self.coords is not None:
431427
self.coords = list(self.coords)
432428

433-
self.e = mv.Mv(self.iobj, ga=self) # Pseudo-scalar for geometric algebra
429+
self.e = mv.Mv(self.blades_lst[-1], ga=self) # Pseudo-scalar for geometric algebra
434430
self.e_sq = simplify(expand((self.e*self.e).scalar()))
435431

436432
if self.coords is not None:
@@ -761,8 +757,6 @@ def _build_bases(self):
761757

762758
self.blades_lst0 = [S(1)] + self.blades_lst
763759

764-
self.iobj = self.blades_lst[-1]
765-
766760
self.blades_to_indexes = []
767761
self.indexes_to_blades = []
768762
for (index, blade) in zip(self.indexes_lst, self.blades_lst):
@@ -788,8 +782,6 @@ def _build_bases(self):
788782
self.bases_lst.append(base_symbol)
789783
self.bases.append(bases)
790784

791-
self.pseudoI = self.bases_lst[-1]
792-
793785
self.bases_to_indexes = []
794786
self.indexes_to_bases = []
795787
for (index, base) in zip(self.indexes_lst, self.bases_lst):
@@ -1588,7 +1580,6 @@ def _build_reciprocal_basis(self,gsym):
15881580
if self.is_ortho:
15891581
self.r_basis = [self.basis[i] / self.g[i, i] for i in self.n_range]
15901582
else:
1591-
self.e_obj = self.e.obj
15921583
if gsym is not None:
15931584
# Define name of metric tensor determinant as sympy symbol
15941585
if printer.GaLatexPrinter.latex_flg:
@@ -1620,16 +1611,16 @@ def _build_reciprocal_basis(self,gsym):
16201611
# r_basis_j = sgn * duals[j] * E_n so it's not normalized, missing a factor of {E_n}^{-2}
16211612
"""
16221613
print('blades list =',self.blades_lst)
1623-
print('debug =',expand(self.base_to_blade_rep(self.mul(sgn * dual_base_rep, self.e_obj))))
1624-
print('collect arg =',expand(self.base_to_blade_rep(self.mul(sgn * dual_base_rep, self.e_obj))))
1614+
print('debug =',expand(self.base_to_blade_rep(self.mul(sgn * dual_base_rep, self.e.obj))))
1615+
print('collect arg =',expand(self.base_to_blade_rep(self.mul(sgn * dual_base_rep, self.e.obj))))
16251616
"""
1626-
r_basis_j = metric.collect(expand(self.base_to_blade_rep(self.mul(sgn * dual_base_rep, self.e_obj))), self.blades_lst)
1617+
r_basis_j = metric.collect(expand(self.base_to_blade_rep(self.mul(sgn * dual_base_rep, self.e.obj))), self.blades_lst)
16271618
self.r_basis.append(r_basis_j)
16281619
# sgn = (-1)**{j-1}
16291620
sgn = -sgn
16301621

16311622
if self.debug:
1632-
printer.oprint('E', self.iobj, 'E**2', self.e_sq, 'unnormalized reciprocal basis =\n', self.r_basis)
1623+
printer.oprint('E', self.e, 'E**2', self.e_sq, 'unnormalized reciprocal basis =\n', self.r_basis)
16331624
print('reciprocal basis test =')
16341625
for ei in self.basis:
16351626
for ej in self.r_basis:
@@ -1639,8 +1630,6 @@ def _build_reciprocal_basis(self,gsym):
16391630
else:
16401631
print('e_{i}|e_{j} = ' + str(expand(ei_dot_ej / self.e_sq)))
16411632

1642-
self.e_obj = self.blades_lst[-1]
1643-
16441633
# Dictionary to represent reciprocal basis vectors as expansions
16451634
# in terms of basis vectors.
16461635

0 commit comments

Comments
 (0)