SETUP::
- sage: from mjo.eja.eja_algebra import random_eja()
+ sage: from mjo.eja.eja_algebra import random_eja
TESTS::
....: ==
....: J.gens()[J._monomial_to_generator(m)]
....: for m in J.basis().keys() )
+ True
"""
# The superclass method indexes into a matrix, so we have to
sage: list(K2.basis())
[e(0, (0, 0)), e(0, (0, 1)), e(0, (1, 0)), e(0, (1, 1)),
e(0, (1, 2)), e(1, 0)]
- sage: sage: g = K2.gens()
+ sage: g = K2.gens()
sage: (g[0] + 2*g[3]) * (g[1] - 4*g[2])
e(0, (0, 1)) - 4*e(0, (1, 1))
RationalBasisEJA.CartesianProduct = RationalBasisCartesianProductEJA
random_eja = ConcreteEJA.random_instance
+
+# def random_eja(*args, **kwargs):
+# J1 = ConcreteEJA.random_instance(*args, **kwargs)
+
+# # This might make Cartesian products appear roughly as often as
+# # any other ConcreteEJA.
+# if ZZ.random_element(len(ConcreteEJA.__subclasses__()) + 1) == 0:
+# # Use random_eja() again so we can get more than two factors.
+# J2 = random_eja(*args, **kwargs)
+# J = cartesian_product([J1,J2])
+# return J
+# else:
+# return J1