Opened 9 years ago

Closed 9 years ago

#12000 closed defect (duplicate)

block_matrix over cyclotomics fails

Reported by: vbraun Owned by: jason, was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: linear algebra Keywords:
Cc: rbeezer Merged in:
Authors: Volker Braun Reviewers: Johan Bosman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

Block matrix with blocks of size >40 fails because the cyclotomic matrix constructor does not check for entries=None:

sage: F = CyclotomicField(5)
sage: block_matrix([[identity_matrix(F,41), identity_matrix(F,41)]])
TypeError                                 Traceback (most recent call last)

/home/vbraun/opt/sage-4.7.2.rc0/devel/sage-main/<ipython console> in <module>()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/matrix/constructor.pyc in block_matrix(*args, **kwds)
   2600                 row = M
   2601             else:
-> 2602                 row = row.augment(M)
   2604         # append row to final matrix

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/matrix/ in sage.matrix.matrix1.Matrix.augment (sage/matrix/matrix1.c:8300)()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/matrix/ in sage.matrix.matrix1.Matrix.new_matrix (sage/matrix/matrix1.c:10920)()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/matrix/matrix_space.pyc in __call__(self, entries, coerce, copy, rows)
    481                 return self.zero_matrix().__copy__()
    482             else:
--> 483                 return self.__matrix_class(self, None, coerce=coerce, copy=copy)
    485         if isinstance(entries, (list, tuple)) and len(entries) > 0 and \

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/matrix/ in sage.matrix.matrix_cyclo_dense.Matrix_cyclo_dense.__init__ (sage/matrix/matrix_cyclo_dense.cpp:5688)()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/structure/ in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7504)()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/structure/ in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3300)()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/structure/ in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3203)()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/rings/number_field/number_field.pyc in _element_constructor_(self, x)
   7035             return self._coerce_from_str(x)
   7036         else:
-> 7037             return self._coerce_non_number_field_element_in(x)
   7039     # TODO:

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/rings/number_field/number_field.pyc in _coerce_non_number_field_element_in(self, x)
   5162         except (TypeError, AttributeError), msg:
   5163             pass
-> 5164         raise TypeError, type(x)
   5166     def _coerce_from_str(self, x):

TypeError: <type 'NoneType'>

The patch here has been moved to #12020.

Attachments (1)

trac_12000_cyclotomic_matrix_None.patch (2.9 KB) - added by vbraun 9 years ago.
Initial patch

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by vbraun

Initial patch

comment:1 Changed 9 years ago by vbraun

  • Authors set to Volker Braun
  • Cc rbeezer added
  • Status changed from new to needs_review

Patch fixes the issue for me.

comment:2 Changed 9 years ago by johanbosman

  • Status changed from needs_review to positive_review

For me as well. ;).

comment:3 Changed 9 years ago by johanbosman

  • Reviewers set to Johan Bosman

comment:4 Changed 9 years ago by jdemeyer

  • Description modified (diff)
  • Milestone changed from sage-4.8 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.