Opened 7 years ago

Closed 7 years ago

#19165 closed defect (fixed)

Error in augmentation for mod 2 matrices

Reported by: jhpalmieri Owned by:
Priority: major Milestone: sage-6.9
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Vincent Delecroix Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: 44a3aae (Commits, GitHub, GitLab) Commit: 44a3aaea83187bbf4d244133580848c96a8b16b8
Dependencies: Stopgaps:

Status badges

Description (last modified by jhpalmieri)

sage: Matrix(GF(2), 1, 0).augment(identity_matrix(GF(2), 1).sparse_matrix())
TypeError                                 Traceback (most recent call last)
<ipython-input-13-8cb0b5f8c7ad> in <module>()
----> 1 Matrix(GF(Integer(2)), Integer(1), Integer(0)).augment(identity_matrix(GF(Integer(2)), Integer(1)).sparse_matrix())

/Users/palmieri/Desktop/Sage_stuff/git/sage/src/sage/matrix/matrix_mod2_dense.pyx in sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.augment (build/cythonized/sage/matrix/matrix_mod2_dense.c:11113)()
   1576             right = right.column()
-> 1578         cdef Matrix_mod2_dense other = right
   1580         if self._nrows != other._nrows:

TypeError: Cannot convert sage.matrix.matrix_modn_sparse.Matrix_modn_sparse to sage.matrix.matrix_mod2_dense.Matrix_mod2_dense

This arises if you construct a FiniteDimensionalAlgebra over GF(2) using a list of sparse matrices, and then run .is_unitary() on it:

sage: A = FiniteDimensionalAlgebra(GF(2), [identity_matrix(GF(2), 1).sparse_matrix()])
sage: A.is_unitary()
  (same error)

Change History (4)

comment:1 Changed 7 years ago by jhpalmieri

  • Description modified (diff)

comment:2 Changed 7 years ago by vdelecroix

  • Authors set to Vincent Delecroix
  • Branch set to public/19165
  • Commit set to 44a3aaea83187bbf4d244133580848c96a8b16b8
  • Status changed from new to needs_review

New commits:

44a3aaeTrac 19165: fix argument conversion in augment

comment:3 Changed 7 years ago by jhpalmieri

  • Reviewers set to John Palmieri
  • Status changed from needs_review to positive_review

That fixes the problem for me, thanks!

comment:4 Changed 7 years ago by vbraun

  • Branch changed from public/19165 to 44a3aaea83187bbf4d244133580848c96a8b16b8
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.