-1. Finish CartesianProductEJA: add to_matrix(), random_instance(),
- one()... methods. This will require rethinking what a "matrix
- representation" and "matrix space" means for a cartesian product
- algebra. Do we want our matrix basis to consist of ordered pairs
- (or triples, or...)? Should the matrix_space() of the algebra be
- the cartesian product of the factors' matrix spaces? Can we just
+1. Finish CartesianProductEJA: add to_matrix(),
+ random_instance(),... methods. This will require rethinking what a
+ "matrix representation" and "matrix space" means for a cartesian
+ product algebra. Do we want our matrix basis to consist of ordered
+ pairs (or triples, or...)? Should the matrix_space() of the algebra
+ be the cartesian product of the factors' matrix spaces? Can we just
fix the matrix basis/space after we call the FDEJA initializer?
2. Add references and start citing them.
True
sage: x.inner_product(y) == J.cartesian_inner_product(x,y)
True
+
+ The cached unit element is the same one that would be computed::
+
+ sage: set_random_seed() # long time
+ sage: J1 = random_eja() # long time
+ sage: J2 = random_eja() # long time
+ sage: J = cartesian_product([J1,J2]) # long time
+ sage: actual = J.one() # long time
+ sage: J.one.clear_cache() # long time
+ sage: expected = J.one() # long time
+ sage: actual == expected # long time
+ True
+
"""
def __init__(self, modules, **kwargs):
CombinatorialFreeModule_CartesianProduct.__init__(self,
check_axioms=False,
category=self.category())
+ ones = tuple(J.one() for J in modules)
+ self.one.set_cache(self._cartesian_product_of_elements(ones))
self.rank.set_cache(sum(J.rank() for J in modules))
@cached_method