You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sage: V = GF(3)^0
sage: W = GF(3)^1
sage: H = V.Hom(W)
sage: H.zero_element()
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (398, 0))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[snip]
/Users/Starx/sage/local/lib/python2.6/site-packages/sage/categories/modules.pyc in zero(self)
205 True
206 """
--> 207 return self(lambda x: self.codomain().zero())
208
209 class EndCategory(HomCategory):
/Users/Starx/sage/local/lib/python2.6/site-packages/sage/modules/vector_space_homspace.pyc in __call__(self, A, check)
383 msg = 'vector space homspace can only coerce matrices, vector space morphisms, functions or lists, not {0}'
384 raise TypeError(msg.format(A))
--> 385 return vector_space_morphism.VectorSpaceMorphism(self, A)
386
387 def _repr_(self):
/Users/Starx/sage/local/lib/python2.6/site-packages/sage/modules/vector_space_morphism.pyc in __init__(self, homspace, A)
861 raise TypeError('domain dimension is incompatible with matrix size')
862 if homspace.codomain().dimension() != A.ncols():
--> 863 raise TypeError('codomain dimension is incompatible with matrix size')
864
865 A = homspace._matrix_space()(A)
TypeError: codomain dimension is incompatible with matrix size
The problem here is that sage creates a list of lists from that lambda function and then a matrix from those lists, so the list of lists results in a 0x0 matrix instead of a 0x1 matrix. The fix is to just add the dimensions to the matrix constructor in vector_space_homspace.py, I will post a patch shortly.
[snip]
The problem here is that sage creates a list of lists from that lambda function and then a matrix from those lists, so the list of lists results in a 0x0 matrix instead of a 0x1 matrix. The fix is to just add the dimensions to the matrix constructor in vector_space_homspace.py, I will post a patch shortly.
Component: algebra
Author: Jim Stark
Reviewer: Aly Deines
Merged: sage-5.0.beta3
Issue created by migration from https://trac.sagemath.org/ticket/12412
The text was updated successfully, but these errors were encountered: