#12000: block_matrix over cyclotomics fails
-------------------------------+--------------------------------------------
    Reporter:  vbraun          |         Owner:  jason, was                    
        Type:  defect          |        Status:  closed                        
    Priority:  major           |     Milestone:  sage-duplicate/invalid/wontfix
   Component:  linear algebra  |    Resolution:  duplicate                     
    Keywords:                  |   Work_issues:                                
    Upstream:  N/A             |      Reviewer:  Johan Bosman                  
      Author:  Volker Braun    |        Merged:                                
Dependencies:                  |  
-------------------------------+--------------------------------------------
Changes (by jdemeyer):

  * status:  positive_review => closed
  * resolution:  => duplicate
  * milestone:  sage-4.8 => sage-duplicate/invalid/wontfix


Old description:

> 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)
>    2603
>    2604         # append row to final matrix
>
> /home/vbraun/Sage/sage/local/lib/python2.6/site-
> packages/sage/matrix/matrix1.so in sage.matrix.matrix1.Matrix.augment
> (sage/matrix/matrix1.c:8300)()
>
> /home/vbraun/Sage/sage/local/lib/python2.6/site-
> packages/sage/matrix/matrix1.so 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)
>     484
>     485         if isinstance(entries, (list, tuple)) and len(entries) >
> 0 and \
>
> /home/vbraun/Sage/sage/local/lib/python2.6/site-
> packages/sage/matrix/matrix_cyclo_dense.so 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/parent.so in
> sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7504)()
>
> /home/vbraun/Sage/sage/local/lib/python2.6/site-
> packages/sage/structure/coerce_maps.so 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/coerce_maps.so 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)
>    7038
>    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)
>    5165
>    5166     def _coerce_from_str(self, x):
>
> TypeError: <type 'NoneType'>
> }}}

New description:

 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)
    2603
    2604         # append row to final matrix

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

 /home/vbraun/Sage/sage/local/lib/python2.6/site-
 packages/sage/matrix/matrix1.so 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)
     484
     485         if isinstance(entries, (list, tuple)) and len(entries) > 0
 and \

 /home/vbraun/Sage/sage/local/lib/python2.6/site-
 packages/sage/matrix/matrix_cyclo_dense.so 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/parent.so in sage.structure.parent.Parent.__call__
 (sage/structure/parent.c:7504)()

 /home/vbraun/Sage/sage/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so 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/coerce_maps.so 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)
    7038
    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)
    5165
    5166     def _coerce_from_str(self, x):

 TypeError: <type 'NoneType'>
 }}}

 The patch here has been moved to #12020.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12000#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to