def testVecMatVec(self): """ Superoperator: Conversion vector to matrix to vector """ V = scipy.rand(100) # a row vector M = vec2mat(V) V2 = mat2vec(M).T # mat2vec returns a column vector assert_(la.norm(V - V2) == 0.0)
def testVecMatVec(self): """ Superoperator: Conversion vector to matrix to vector """ V = scipy.rand(100) # a row vector M = vec2mat(V) V2 = mat2vec(M).T # mat2vec returns a column vector assert_(norm(V - V2) == 0.0)
def testMatrixVecMat(self): """ Superoperator: Conversion matrix to vector to matrix """ M = scipy.rand(10, 10) V = mat2vec(M) M2 = vec2mat(V) assert_(la.norm(M - M2) == 0.0)
def testMatrixVecMat(self): """ Superoperator: Conversion matrix to vector to matrix """ M = scipy.rand(10, 10) V = mat2vec(M) M2 = vec2mat(V) assert_(norm(M - M2) == 0.0)