The inverse mapping ``phi_inverse`` will go
the other way.
- EXAMPLES:
+ SETUP::
+
+ sage: from mjo.matrix_vector import isomorphism
+
+ EXAMPLES::
sage: M = MatrixSpace(QQ,4,4)
sage: (p, p_inv) = isomorphism(M)
- sage: m = M(range(0,16))
+ sage: m = M(xrange(16))
sage: p_inv(p(m)) == m
True
matrix that represents ``T`` with respect to the standard basis of
``V``.
+ SETUP::
+
+ sage: from mjo.matrix_vector import isomorphism, matrix_of_transformation
+
EXAMPLES:
The matrix of a transformation on a simple vector space should be
"""
n = V.dimension()
- B = V.basis()
+ B = list(V.basis())
def inner_product(v, w):
# An inner product function that works for both matrices and
return L(x)
entries = []
- for j in range(0,n):
- for i in range(0,n):
+ for j in xrange(n):
+ for i in xrange(n):
entry = inner_product(apply(T,B[i]), B[j])
entries.append(entry)