From 8255c2c46d046aed82ce9935522ed1b1d8690b5d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 13 Sep 2020 16:40:54 -0400 Subject: [PATCH] mjo/matrix_vector: rename basis_representation() to basis_repr(). --- mjo/cone/doubly_nonnegative.py | 4 ++-- mjo/matrix_vector.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mjo/cone/doubly_nonnegative.py b/mjo/cone/doubly_nonnegative.py index 373557c..3970c32 100644 --- a/mjo/cone/doubly_nonnegative.py +++ b/mjo/cone/doubly_nonnegative.py @@ -16,7 +16,7 @@ from sage.all import * from mjo.cone.symmetric_psd import (factor_psd, is_symmetric_psd, random_symmetric_psd) -from mjo.matrix_vector import basis_representation +from mjo.matrix_vector import basis_repr def is_doubly_nonnegative(A): @@ -383,7 +383,7 @@ def is_extreme_doubly_nonnegative(A): # can't compute the dimension of a set of matrices anyway, so we # convert them all to vectors and just ask for the dimension of the # resulting vector space. - (phi, phi_inverse) = basis_representation(A.matrix_space()) + (phi, phi_inverse) = basis_repr(A.matrix_space()) vectors = map(phi,spanning_set) V = span(vectors, A.base_ring()) 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. -- 2.43.2