That's not a bug, your matrix is simply not invertible. You can see it by switching the ring to SR
to perform exact computations:
test_S_SR = matrix(SR, 5)
for ix in range(0, 5):
for iy in range(0, 5):
test_S_SR[ix, iy] = sin(ix+iy)*sin(iy+1)
sage: test_S_SR.determinant().trig_reduce() # can take a few seconds
0
The float version looks invertible but that's only due to machine precision. Since the internal mechanism are probably different for RR
and CC
, it's normal that you get different answers.
![]() | 2 | No.2 Revision |
That's not a bug, your matrix is simply not invertible. You can see it by switching the ring to SR
to perform exact computations:
test_S_SR = matrix(SR, 5)
for ix in range(0, 5):
for iy in range(0, 5):
test_S_SR[ix, iy] = sin(ix+iy)*sin(iy+1)
(0sin(2)sin(1)sin(3)sin(2)sin(4)sin(3)sin(5)sin(4) sin(1)2sin(2)2sin(3)2sin(4)2sin(5)2 sin(2)sin(1)sin(3)sin(2)sin(4)sin(3)sin(5)sin(4)sin(6)sin(5) sin(3)sin(1)sin(4)sin(2)sin(5)sin(3)sin(6)sin(4)sin(7)sin(5) sin(4)sin(1)sin(5)sin(2)sin(6)sin(3)sin(7)sin(4)sin(8)sin(5))
sage: test_S_SR.determinant().trig_reduce() # can take a few seconds
0
The float version looks invertible but that's only due to machine precision. Since the internal mechanism are probably different for RR
and CC
, it's normal that you get different answers.
![]() | 3 | No.3 Revision |
That's not a bug, your matrix is simply not invertible. You can see it by switching the ring to SR
to perform exact computations:
test_S_SR = matrix(SR, 5)
for ix in range(0, 5):
for iy in range(0, 5):
test_S_SR[ix, iy] = sin(ix+iy)*sin(iy+1)
sage: test_S_SR
$$
[ 0 sin(2)*sin(1) sin(3)*sin(2) sin(4)*sin(3) sin(5)*sin(4)]
[ sin(1)^2 sin(2)^2 sin(3)^2 sin(4)^2 sin(5)^2]
[sin(2)*sin(1) sin(3)*sin(2) sin(4)*sin(3) sin(5)*sin(4) sin(6)*sin(5)]
[sin(3)*sin(1) sin(4)*sin(2) sin(5)*sin(3) sin(6)*sin(4) sin(7)*sin(5)]
[sin(4)*sin(1) sin(5)*sin(2) sin(6)*sin(3) sin(7)*sin(4) sin(8)*sin(5)]
\left(0sin(2)sin(1)sin(3)sin(2)sin(4)sin(3)sin(5)sin(4) sin(1)2sin(2)2sin(3)2sin(4)2sin(5)2 sin(2)sin(1)sin(3)sin(2)sin(4)sin(3)sin(5)sin(4)sin(6)sin(5) sin(3)sin(1)sin(4)sin(2)sin(5)sin(3)sin(6)sin(4)sin(7)sin(5) sin(4)sin(1)sin(5)sin(2)sin(6)sin(3)sin(7)sin(4)sin(8)sin(5)\right)
$$
sage: test_S_SR.determinant().trig_reduce() # can take a few seconds
0
The float version looks invertible but that's only due to machine precision. Since the internal mechanism are probably different for RR
and CC
, it's normal that you get different answers.