@@ -3980,6 +3980,13 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense):
3980
3980
sage: Matrix( pR, 3, 2, [[x,0 ],[1,0 ],[x+1,0 ]]) . minimal_kernel_basis( )
3981
3981
[6 x 0 ]
3982
3982
[6 6 1 ]
3983
+
3984
+ TESTS:
3985
+
3986
+ We check that PR #37208 is fixed::
3987
+
3988
+ sage: Matrix( pR, 2, 0) . minimal_kernel_basis( ) . is_sparse( )
3989
+ False
3983
3990
"""
3984
3991
from sage.matrix.constructor import matrix
3985
3992
@@ -4001,11 +4008,11 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense):
4001
4008
return matrix(self .base_ring(), 0 , m)
4002
4009
4003
4010
if n == 0 : # early exit: kernel is identity
4004
- return matrix.identity(self .base_ring(), m, m )
4011
+ return matrix.identity(self .base_ring(), m)
4005
4012
4006
4013
d = self .degree() # well defined since m > 0 and n > 0
4007
4014
if d == - 1 : # matrix is zero: kernel is identity
4008
- return matrix.identity(self .base_ring(), m, m )
4015
+ return matrix.identity(self .base_ring(), m)
4009
4016
4010
4017
# degree bounds on the kernel basis
4011
4018
degree_bound = min (m,n)* d+ max (shifts)
@@ -4040,11 +4047,11 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense):
4040
4047
return matrix(self .base_ring(), n, 0 )
4041
4048
4042
4049
if m == 0 : # early exit: kernel is identity
4043
- return matrix.identity(self .base_ring(), n, n )
4050
+ return matrix.identity(self .base_ring(), n)
4044
4051
4045
4052
d = self .degree() # well defined since m > 0 and n > 0
4046
4053
if d == - 1 : # matrix is zero
4047
- return matrix.identity(self .base_ring(), n, n )
4054
+ return matrix.identity(self .base_ring(), n)
4048
4055
4049
4056
# degree bounds on the kernel basis
4050
4057
degree_bound = min (m,n)* d+ max (shifts)
0 commit comments