"""
def __init__(self, modules, **kwargs):
- CombinatorialFreeModule_CartesianProduct.__init__(self, modules, **kwargs)
+ CombinatorialFreeModule_CartesianProduct.__init__(self,
+ modules,
+ **kwargs)
field = modules[0].base_ring()
if not all( J.base_ring() == field for J in modules ):
raise ValueError("all factors must share the same base field")
- M = cartesian_product( [J.matrix_space() for J in modules] )
-
- m = len(modules)
- W = VectorSpace(field,m)
- self._matrix_basis = []
- for k in range(m):
- for a in modules[k].matrix_basis():
- v = W.zero().list()
- v[k] = a
- self._matrix_basis.append(M(v))
-
- self._matrix_basis = tuple(self._matrix_basis)
-
- n = len(self._matrix_basis)
+ basis = tuple( b.to_vector().column() for b in self.basis() )
+
+ # Define jordan/inner products that operate on the basis.
+ def jordan_product(x_mat,y_mat):
+ x = self.from_vector(_mat2vec(x_mat))
+ y = self.from_vector(_mat2vec(y_mat))
+ return self.cartesian_jordan_product(x,y).to_vector().column()
+
+ def inner_product(x_mat, y_mat):
+ x = self.from_vector(_mat2vec(x_mat))
+ y = self.from_vector(_mat2vec(y_mat))
+ return self.cartesian_inner_product(x,y)
+
+ FiniteDimensionalEJA.__init__(self,
+ basis,
+ jordan_product,
+ inner_product,
+ field=field,
+ orthonormalize=False,
+ check_field=False,
+ check_axioms=False,
+ category=self.category())
# TODO:
#
# Initialize the FDEJA class, too. Does this override the