X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fmatrix_vector.py;fp=mjo%2Fmatrix_vector.py;h=08743d5c5ecf000dbcc5ca6f4b475cd67af6a593;hb=8255c2c46d046aed82ce9935522ed1b1d8690b5d;hp=83bf313a82cde7c689d10337efff8054301acad7;hpb=ba04841bc8b5786c75b5e6fa9e767895c6af51d0;p=sage.d.git diff --git a/mjo/matrix_vector.py b/mjo/matrix_vector.py index 83bf313..08743d5 100644 --- a/mjo/matrix_vector.py +++ b/mjo/matrix_vector.py @@ -12,7 +12,7 @@ from sage.matrix.matrix_space import is_MatrixSpace def _mat2vec(m): return vector(m.base_ring(), m.list()) -def basis_representation(M): +def basis_repr(M): """ Return the forward (``MatrixSpace`` -> ``VectorSpace``) and inverse isometries, as a pair, that take elements of the given @@ -46,7 +46,7 @@ def basis_representation(M): SETUP:: - sage: from mjo.matrix_vector import basis_representation + sage: from mjo.matrix_vector import basis_repr EXAMPLES: @@ -61,7 +61,7 @@ def basis_representation(M): sage: E22 = matrix(QQbar,[ [0,0], ....: [0,1] ]) sage: basis = [E11, E12, E22] - sage: phi, phi_inv = basis_representation(basis) + sage: phi, phi_inv = basis_repr(basis) sage: phi(E11); phi(E12); phi(E22) (1, 0, 0) (0, 1, 0) @@ -76,7 +76,7 @@ def basis_representation(M): MatrixSpace arguments work too:: sage: M = MatrixSpace(QQ,2) - sage: phi, phi_inv = basis_representation(M) + sage: phi, phi_inv = basis_repr(M) sage: X = matrix(QQ, [ [1,2], ....: [3,4] ]) sage: phi(X) @@ -92,7 +92,7 @@ def basis_representation(M): sage: n = ZZ.random_element(10) sage: M = MatrixSpace(QQ,n) sage: X = M.random_element() - sage: (phi, phi_inv) = basis_representation(M) + sage: (phi, phi_inv) = basis_repr(M) sage: phi_inv(phi(X)) == X True @@ -153,7 +153,7 @@ def basis_repr_of_operator(M, L): SETUP:: - sage: from mjo.matrix_vector import (basis_representation, + sage: from mjo.matrix_vector import (basis_repr, ....: basis_repr_of_operator) EXAMPLES: @@ -200,7 +200,7 @@ def basis_repr_of_operator(M, L): [0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 1] - sage: phi, phi_inv = basis_representation(M) + sage: phi, phi_inv = basis_repr(M) sage: X = M([[1,2,3],[4,5,6],[7,8,9]]) sage: F*phi(X) == phi(f(X)) True @@ -213,7 +213,7 @@ def basis_repr_of_operator(M, L): basis_space = M[0].matrix_space() basis = M - (phi, phi_inv) = basis_representation(M) + (phi, phi_inv) = basis_repr(M) # Get a basis for the image space. Since phi is an isometry, # it takes one basis to another.