Skip to content

Commit

Permalink
fixes to motor decompose
Browse files Browse the repository at this point in the history
  • Loading branch information
Eelco Hoogendoorn committed Nov 19, 2023
1 parent 0077392 commit 7d6a06c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions numga/multivector/extension/test/test_decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ def test_invariant_decomposition(descr):
npt.assert_allclose((L * R).values, (R * L).values)


def test_motor_decompose_euclidean():
@pytest.mark.parametrize('descr', [
(1, 0, 1), (2, 0, 1), (3, 0, 1), (4, 0, 1),
])
def test_motor_decompose_euclidean(descr):

ga = NumpyContext('x+y+z+w0')
ga = NumpyContext(descr)
m = random_motor(ga, (10,))
t = m.motor_translator()
print(t)
r = m.motor_rotor()

assert np.allclose((t * r - m).values, 0, atol=1e-9)
Expand Down
4 changes: 2 additions & 2 deletions numga/operator/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ def euclidian_factorization(self, m: "SubSpace"):
alternatively:
t = (m * ~m.select.rotor()).select.translator()
"""
op = self.bivector_product(m, self.dual(m)).symmetry((0, 1))
return self.dual(op)
op = self.product(m, self.dual(m))
return self.dual(op).select_grade(2).symmetry((0, 1))

# # projections according to erik lengyel
# @cache
Expand Down

0 comments on commit 7d6a06c

Please sign in to comment.