Currently making sage_9.3 on machine so I can have open a new ticket and have a deeper look, but I'm quite convinced it is somehow a problem due to the complexity of the calculation in the symbolic ring.
Firstly note that the answer det(L)=0 is the correct one (you can either trust this from theory or read "A Lie Theoretic Galois Theory for Spectral Curves of an Integrable System I" by McDaniel, Smolinsky where this is considered, albeit in different notation). If we try M = Matrix([[-p1, Q1, 0, 0, -4*Q0/z, 0, 0], [Q1, p1-p2, Q2, 4*Q0/z, 0, 0, 0], [0, Q2, p2-p3, 0, 0, 0, 2*Q3], [0, Q0*z, 0, p1, -Q1, 0, 0], [-Q0*z, 0, 0, -Q1, -p1+p2, -Q2, 0], [0, 0, 0, 0, -Q2, -p2+2*p3, -Q3], [0, 0, Q3, 0, 0, -2*Q3, 0]]) bool(M.change_ring(SR).det()==M.det()) which is in some way the natural predecessor to this matrix L, we do not have a problem, both dets being equal. Alternatively, consider making substitutions for the parameters which shouldn't really the outcome e.g. print(f"Laurent: {L.subs({p2:0}).det()}") print(f"SR: {L.subs({p2:0}).change_ring(SR).det().factor()}") or print(f"Laurent: {L.subs({Q0:1,Q1:1}).det()}") print(f"SR: {L.subs({Q0:1,Q1:1}).change_ring(SR).det().factor()}") On Friday, December 18, 2020 at 7:48:18 AM UTC dmo...@deductivepress.ca wrote: > That does indeed seem simple. Here is an even shorter version that only > needs one matrix. > > R = LaurentPolynomialRing(QQ, "p1, p2, p3, p4, Q0, Q1, Q2, Q3, Q4, w, z") > p1, p2, p3, p4, Q0, Q1, Q2, Q3, Q4, w, z = R.gens() > > L = Matrix([[-p1, Q1, 0, 0, 0, -4*Q0/z, 0, 0, 0], > > [Q1, p1-p2, Q2, 0, 4*Q0/z, 0, 0, 0, 0], > [0, Q2, p2-p3, Q3, 0, 0, 0, 0, 0], > [0, 0, Q3, p3-2*p4, 0, 0, 0, 0, 2*Q4], > [0, Q0*z, 0, 0, p1, -Q1, 0, 0, 0], > [-Q0*z, 0, 0, 0, -Q1, -p1+p2, -Q2, 0, 0], > [0, 0, 0, 0, 0, -Q2, -p2+p3, -Q3, 0], > [0, 0, 0, 0, 0, 0, -Q3, -p3+2*p4, -Q4], > [0, 0, 0, Q4, 0, 0, 0, -2*Q4, 0]]) > > print(f"Laurent: {L.det()}") > print(f"SR: {L.change_ring(SR).det().factor()}") > > For me, the output is: > Laurent: 0 > SR: 4*Q0*Q1*Q2^2*Q3^2*Q4^2*p1*(z + 1)*(z - 1)/z > > I thought maybe the problem had something to do with L being singular, but > adding the identity matrix to L doesn't solve the problem: > > I = matrix.identity(9) > ((L.change_ring(SR) + 42*I).det() - SR((L + 42*I).det())).factor() > > Both individual determinants are a mess, but the difference I get is > > 4*Q0*Q1*Q2^2*Q3^2*Q4^2*(p1 - 42)*(z + 1)*(z - 1)/z > > It is surprising to me that this is the same as the above determinant in > SR, except for the 42. And I get a similar answer if I replace 42 with a > different constant, or even put in a variable by defining a polynomial ring > over R. > > I think a ticket should be opened. > > > > > > On Thursday, December 17, 2020 at 3:18:02 PM UTC-7 Michael Orlitzky wrote: > >> On 12/16/20 3:27 PM, Linden Disney wrote: >> > Ok I've modified the code to plain sage to make it more useful and I've >> > copied it below. Given that it's hard to compare the determinants of >> the >> > raw matrices, as they are defined in terms of different variables, I >> > have found the z^2 coefficient in each case and you can see they are >> > different. I've tested this in Sage 9.1 command line and this has >> worked. >> > >> >> Great, thanks. I was able to simplify this even further... the >> determinants still disagree at the L1/L2 stage, but look a lot nicer. >> Maybe now someone can figure out what's going wrong. With these >> definitions, you can even try (L1 == L2) and it returns True. >> >> p1, p2, p3, p4, Q0, Q1, Q2, Q3, Q4, w, z = SR.var("p1, p2, p3, p4, Q0, >> Q1, Q2, Q3, Q4, w, z") >> L1 = Matrix([[-p1, Q1, 0, 0, 0, -4*Q0/z, 0, 0, 0], >> [Q1, p1-p2, Q2, 0, 4*Q0/z, 0, 0, 0, 0], >> [0, Q2, p2-p3, Q3, 0, 0, 0, 0, 0], >> [0, 0, Q3, p3-2*p4, 0, 0, 0, 0, 2*Q4], >> [0, Q0*z, 0, 0, p1, -Q1, 0, 0, 0], >> [-Q0*z, 0, 0, 0, -Q1, -p1+p2, -Q2, 0, 0], >> [0, 0, 0, 0, 0, -Q2, -p2+p3, -Q3, 0], >> [0, 0, 0, 0, 0, 0, -Q3, -p3+2*p4, -Q4], >> [0, 0, 0, Q4, 0, 0, 0, -2*Q4, 0]]) >> >> L1.det() >> >> >> R = LaurentPolynomialRing(QQ, "p1, p2, p3, p4, Q0, Q1, Q2, Q3, Q4, w, z") >> p1, p2, p3, p4, Q0, Q1, Q2, Q3, Q4, w, z = R.gens() >> >> L2 = Matrix([[-p1, Q1, 0, 0, 0, -4*Q0/z, 0, 0, 0], >> [Q1, p1-p2, Q2, 0, 4*Q0/z, 0, 0, 0, 0], >> [0, Q2, p2-p3, Q3, 0, 0, 0, 0, 0], >> [0, 0, Q3, p3-2*p4, 0, 0, 0, 0, 2*Q4], >> [0, Q0*z, 0, 0, p1, -Q1, 0, 0, 0], >> [-Q0*z, 0, 0, 0, -Q1, -p1+p2, -Q2, 0, 0], >> [0, 0, 0, 0, 0, -Q2, -p2+p3, -Q3, 0], >> [0, 0, 0, 0, 0, 0, -Q3, -p3+2*p4, -Q4], >> [0, 0, 0, Q4, 0, 0, 0, -2*Q4, 0]]) >> >> L2.det() >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/79a22aea-87a8-4da7-afa0-48a6fa53d333n%40googlegroups.com.