Opened 22 months ago
Closed 21 months ago
#31001 closed defect (fixed)
Some bugs concerning the trivial knot diagram
Reported by:  Sebastian Oehms  Owned by:  

Priority:  major  Milestone:  sage9.3 
Component:  algebraic topology  Keywords:  knot, link, jones polynomial, alternating, khovanov homology 
Cc:  Miguel Marco  Merged in:  
Authors:  Travis Scrimshaw  Reviewers:  Sebastian Oehms 
Report Upstream:  N/A  Work issues:  
Branch:  f86f3ec (Commits, GitHub, GitLab)  Commit:  f86f3ec186f513d424d39895705197cf97f25a24 
Dependencies:  Stopgaps: 
Description
This ticket is related to #30346 which fixed a segmentation fault in the method homfly_polynomial
applied to the trivial knot diagram. Here we treat similar cases for the methods is_alternating
, khovanov_homology
and jones_polynomial
.
While the first two cases produce errors you get a wrong result in the third case (which is the result for two unknots that do not cross each other):
sage: Ua = Link([]); Ua Link with 1 component represented by 0 crossings sage: Ua.khovanov_homology() Traceback (most recent call last): ... ValueError: max() arg is an empty sequence sage: Ua.is_alternating() Traceback (most recent call last): ... IndexError: list index out of range sage: Ua.jones_polynomial() sqrt(t)  1/sqrt(t) sage: Ub = Link(BraidGroup(2).gen(0)) sage: Ub.jones_polynomial() 1
Change History (10)
comment:1 followup: 2 Changed 22 months ago by
comment:2 Changed 22 months ago by
Replying to tscrim:
The bug for the Jones polynomial originates in the braid group code with trying to deal with the fact that it wants to remove unbraided strands.
Indeed, algorithm='statesum'
returns the correct result:
sage: U=Link([]) sage: U.jones_polynomial(algorithm='statesum') 1
Explicitly the bug is in the method braid
. I think the problem is a kind of dilemma: The correct result of the method braid
for the trivial diagram would be one
of the braid group on one strand. But since the braid group construction doesn't allow to define it the one
of the braid group on two strands is returned the closure of which are two isolated unknots.
The clearest way to fix this would be to implement the trivial group as the braid group on one strand, but probably annoying to work this through all methods of the class.
Another possibility is to let the generator of the two strand braid group be the braid of the trivial diagram. But this disturbs the recursive structure of the method. So, I don't know what to do here!
comment:3 followup: 4 Changed 22 months ago by
Authors:  → Travis Scrimshaw 

Branch:  → public/knots/fix_trivial_issues31001 
Commit:  → a49c33d5a7e286fc9e755469c8d8017002d1374d 
Status:  new → needs_review 
I think it is just best to special case stuff in the Link
code. That is the best way to ensure consistency of assumptions.
New commits:
a49c33d  Fix some corner cases for the trivial knot without crossings.

comment:4 Changed 22 months ago by
Replying to tscrim:
I think it is just best to special case stuff in the
Link
code. That is the best way to ensure consistency of assumptions.
You are right! But, shouldn't we add a note in the braid
method pointing out that  on the one hand  the closure of the trivial diagram's braid is the union of two unknots (mathematically) which  on the other hand  is consistent with the braid closure construction according to the note in the docstring of the class. Maybe the phrasing of the latter should take the unknot into account, as well.
Furthermore, in the note you add to is_alternating
I think we should say that the result may return False
even though isotopic alternating diagrams exist (to make clear that the term is used differently as in the HosteThistlethwaite table). I mean for example this:
sage: K5_2 = Link([[1, 4, 2, 5], [3, 8, 4, 9], [5, 10, 6, 1], [7, 2, 8, 3], [9, 6, 10, 7]]) sage: K5_2.is_alternating() True sage: K5_2b = Link(K5_2.braid()) sage: K5_2b.is_alternating() False
Once this is done, you may switch to positive review.
comment:5 Changed 22 months ago by
Commit:  a49c33d5a7e286fc9e755469c8d8017002d1374d → f86f3ec186f513d424d39895705197cf97f25a24 

Branch pushed to git repo; I updated commit sha1. New commits:
f86f3ec  Updating some of the documentation to clarify alternating definition.

comment:6 Changed 22 months ago by
All good suggestions. I have done them. Please check that they are satisfactory.
comment:7 Changed 22 months ago by
Reviewers:  → Sebastian Oehms 

Status:  needs_review → positive_review 
LGTM
comment:9 Changed 22 months ago by
Replying to tscrim:
Thank you. I hope you are doing well.
Thank you, too! Yes, everthing for me and my family is o.K. I hope the same is true for you! Have a nice Chrismas time!
comment:10 Changed 21 months ago by
Branch:  public/knots/fix_trivial_issues31001 → f86f3ec186f513d424d39895705197cf97f25a24 

Resolution:  → fixed 
Status:  positive_review → closed 
The bug for the Jones polynomial originates in the braid group code with trying to deal with the fact that it wants to remove unbraided strands.