From c834ba0726721dbaa4d5db729619f0abfd3066a7 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Fri, 28 Nov 2014 13:40:34 -0600
Subject: [PATCH] Preserve variable class in GA's dimensionalizer

---
 pymbolic/geometric_algebra/mapper.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pymbolic/geometric_algebra/mapper.py b/pymbolic/geometric_algebra/mapper.py
index d37909b..0da2cf9 100644
--- a/pymbolic/geometric_algebra/mapper.py
+++ b/pymbolic/geometric_algebra/mapper.py
@@ -129,7 +129,9 @@ class Dimensionalizer(EvaluationMapper):
 
     def map_multivector_variable(self, expr):
         from pymbolic.primitives import make_sym_vector
-        return MultiVector(make_sym_vector(expr.name, self.ambient_dim))
+        return MultiVector(
+                make_sym_vector(expr.name, self.ambient_dim,
+                    var_class=type(expr)))
 
     def map_nabla(self, expr):
         from pytools.obj_array import make_obj_array
-- 
GitLab