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()