associative=False,
check_field=True,
check_axioms=True,
- prefix='e'):
+ prefix='e',
+ category=None):
if check_field:
if not field.is_subring(RR):
raise ValueError("inner-product is not commutative")
- category = MagmaticAlgebras(field).FiniteDimensional()
- category = category.WithBasis().Unital()
- if associative:
- # Element subalgebras can take advantage of this.
- category = category.Associative()
+ if category is None:
+ category = MagmaticAlgebras(field).FiniteDimensional()
+ category = category.WithBasis().Unital()
+ if associative:
+ # Element subalgebras can take advantage of this.
+ category = category.Associative()
# Call the superclass constructor so that we can use its from_vector()
# method to build our multiplication table.
"""
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