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

Conversion of SageMath link to SnapPy link results in mirror image #41

Closed agreatnate closed 2 years ago

agreatnate commented 2 years ago

Using SageMath 9.4 and SnapPy 3.0.3, converting a SageMath link to a SnapPy link produces the mirror image of the original knot. This doesn't happen when converting the other way however. I tested this creating a variety of knots in both SageMath and in SnapPy in various ways. To demonstrate, running the code:

sage: L=snappy.Link('8_5') 
....: print("Snappy:",L.jones_polynomial(new_convention=False)) 
....: L2=L.sage_link() 
....: print("Sage:",L2.jones_polynomial()) 
....: L3=snappy.Link(L2) 
....: print("Snappy:",L3.jones_polynomial(new_convention=False)) 
....: L4=L3.sage_link() 
....: print("Sage:",L4.jones_polynomial()) 
....: L5=snappy.Link(L4) 
....: print("Snappy:",L5.jones_polynomial(new_convention=False)) 
....: print(L.signature(),L2.signature(),L3.signature(),L4.signature(),L5.signature())

Results in the output:

Snappy: 1 - q + 3*q^2 - 3*q^3 + 3*q^4 - 4*q^5 + 3*q^6 - 2*q^7 + q^8
Sage: t^8 - 2*t^7 + 3*t^6 - 4*t^5 + 3*t^4 - 3*t^3 + 3*t^2 - t + 1
Snappy: q^-8 - 2*q^-7 + 3*q^-6 - 4*q^-5 + 3*q^-4 - 3*q^-3 + 3*q^-2 - q^-1 + 1
Sage: -1/t + 3/t^2 - 3/t^3 + 3/t^4 - 4/t^5 + 3/t^6 - 2/t^7 + 1/t^8 + 1
Snappy: 1 - q + 3*q^2 - 3*q^3 + 3*q^4 - 4*q^5 + 3*q^6 - 2*q^7 + q^8
-4 -4 4 4 -4
NathanDunfield commented 2 years ago

Thanks for the very detailed report. SageMath does its PD codes clockwise but we do them counterclockwise, and we accounted for this difference only in the SnapPy-to-Sage conversion. I have fixed this in the spherogram component. You can update via:

sage -pip install https://github.com/3-manifolds/Spherogram/archive/master.zip

Could you test and see if this fixes it for you? If so, I will close this ticket.

agreatnate commented 2 years ago

Yes, that fixes it! Thanks!

NathanDunfield commented 2 years ago

Great, marking as closed by this commit. Thanks again for finding this.