3-manifolds / SnapPy

SnapPy is a package for studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures. It is based on the SnapPea kernel written by Jeff Weeks.
https://snappy.computop.org/
84 stars 39 forks source link

SageMath 9.2 doctest issues #19

Closed NathanDunfield closed 3 years ago

NathanDunfield commented 3 years ago

Should investigate these and fix if needed.

**********************************************************************
File "/ext/sage/sage-9.2/local/lib/python3.8/site-packages/spherogram/links/invariants.py", line 179, in spherogram.links.invariants.Link.alexander_matrix
Failed example:
    L.alexander_matrix()
Expected:
    ([   -1 1 - t     t]
    [    t    -1 1 - t]
    [1 - t     t    -1], [t, t, t])
Got:
    ([   -1     t 1 - t]
    [1 - t    -1     t]
    [    t 1 - t    -1], [t, t, t])
**********************************************************************
File "/ext/sage/sage-9.2/local/lib/python3.8/site-packages/spherogram/links/invariants.py", line 240, in spherogram.links.invariants.Link.alexander_polynomial
Failed example:
    K.alexander_polynomial(norm=False)
Expected:
    t2^-1 + t1^-1*t2^-4
Got:
    t1^-1*t2^-1 + t1^-2*t2^-4
**********************************************************************
File "/ext/sage/sage-9.2/local/lib/python3.8/site-packages/spherogram/links/invariants.py", line 599, in spherogram.links.invariants.Link.braid_word
Failed example:
    Link('K6a2').braid_word(as_sage_braid=True)
Expected:
    (s0^-1*s1)^2*s0^-2
Got:
    s0^-1*(s0^-1*s1)^2*s0^-1
**********************************************************************
culler commented 3 years ago

Why are the monomials written in that strange way, instead of combining powers of the same variable and using a fixed ordering of the variables?

(s0^-1s1)^2s0^-2 -> s0^-4s1^2 s0^-1(s0^-1s1)^2s0^-1 -> s0^-4*s1^2

NathanDunfield commented 3 years ago

Those aren't monomials but rather words in the standard Artin generators for the braid group.

culler commented 3 years ago

No, github, I did not want to itialicize parts of my formulas

(s0^-1*s1)^2*s0^-2 -> s0^-4*s1^2

s0^-1*(s0^-1*s1)^2*s0^-1 -> s0^-4*s1^2

culler commented 3 years ago

Oh. I thought that was supposed to be an Alexander polynomial. I needed to scroll further to the right to see the rest of that long line. Sorry. Should have realized that you can't use s as a variable in an Alexander polynomial. Also should have realized that I was marking down. Maybe this is not the best medium for a discussion of this topic?

NathanDunfield commented 3 years ago

The old and new words are conjugate, so they have the same braid closure and hence both are correct answers. My first guess is that the deterministic order of dictionary keys in Python 3.6 onwards is the cause for this and the same for the alexander_matrix one.

The K.alexander_polynomial(norm=False) is more confusing, I'd guess some change in Sage means the code no longer correctly removes any "excess monomial" from the final answer.

NathanDunfield commented 3 years ago

Fixed in https://github.com/3-manifolds/Spherogram/commit/d7acde1fee96b2283229fd5de38cb99db9a67b31 .