Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing determinant for the zero matrix over the p-adics #29249

Closed
edgarcosta opened this issue Feb 26, 2020 · 9 comments
Closed

Fixing determinant for the zero matrix over the p-adics #29249

edgarcosta opened this issue Feb 26, 2020 · 9 comments

Comments

@edgarcosta
Copy link
Member

This fixes the bug below:

sage: matrix(Qp(37),[0]).determinant()
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-323-f9ac4bb66315> in <module>()
----> 1 matrix(Zp(Integer(37)),[Integer(0)]).determinant()

/Applications/sage-dev/local/lib/python3.7/site-packages/sage/matrix/matrix2.pyx in sage.matrix.matrix2.Matrix.determinant (build/cythonized/sage/matrix/matrix2.c:14548)()
   1640         R = self._base_ring
   1641         if hasattr(R, '_matrix_determinant'):
-> 1642             d = R._matrix_determinant(self)
   1643             self.cache('det', d)
   1644             return d

/Applications/sage-dev/local/lib/python3.7/site-packages/sage/rings/padics/local_generic.py in _matrix_determinant(self, M)
   1587                 break
   1588             val = curval
-> 1589             if S[pivi,pivj] == 0:
   1590                 if track_precision:
   1591                     return R(0, valdet + (n-piv)*val - shift)

UnboundLocalError: local variable 'pivi' referenced before assignment

Component: padics

Author: Edgar Costa

Branch/Commit: d5d16fe

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/29249

@edgarcosta edgarcosta added this to the sage-9.1 milestone Feb 26, 2020
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

6befbbefixing determinant for the zero matrix

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2020

Changed commit from 268f41a to 6befbbe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

d5d16fefixing pivi, pivj

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2020

Changed commit from 6befbbe to d5d16fe

@edgarcosta
Copy link
Member Author

Author: Edgar Costa

@edgarcosta
Copy link
Member Author

New commits:

d5d16fefixing pivi, pivj

@tscrim
Copy link
Collaborator

tscrim commented Feb 27, 2020

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Feb 27, 2020

comment:4

LGTM.

@vbraun
Copy link
Member

vbraun commented Feb 29, 2020

Changed branch from u/edgarcosta/padicdet to d5d16fe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants