On Jun 30, 2:26 am, Rob Beezer <[email protected]> wrote:
> sage: V = GF(3)^3 > sage: W = QQ^2 > sage: H = Hom(V, W) > sage: m = matrix(3, 2, range(6)) > sage: f = H(m) This makes no sense at all; the function is not a homomorphism: sage: v = [V.random_element() for i in range(2)] sage: l = [GF(3).random_element() for i in range(2)] sage: f(sum(l[i]*v[i] for i in range(2))) == sum(l[i]*f(v[i]) for i in range(2)) --------------------------------------------------------------------------- Traceback (most recent call last) ... TypeError: unsupported operand parent(s) for '*': 'Finite Field of size 3' and 'Vector space of dimension 2 over Rational Field' On the other hand, sage: V = QQ^2 sage: K = QuadraticField(7) sage: W = K^2 sage: H = Hom(V, W) sage: f = H([[1, 3], [4, 0]]) sage: v = [V.random_element() for i in range(2)] sage: l = [QQ.random_element() for i in range(2)] sage: f(sum(l[i]*v[i] for i in range(2))) == sum(l[i]*f(v[i]) for i in range(2)) True The point being that sage: K.has_coerce_map_from(QQ) True so that K^2 can be canonically made into a rational vector space. -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
