ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 13 Apr 2018 07:03:37 -0500connected sum of knotshttp://ask.sagemath.org/question/41985/connected-sum-of-knots/ Hi! I was trying to recursively construct connected sums of knots, but I seem to run in to some problems when connect summing a knot to itself more than two times:
>B = BraidGroup(2)
>trefoil = Knot(B([1,1,1]))
>K = trefoil.connected_sum(trefoil)
>L = K.connected_sum(trefoil)
This does not work:
> ValueError Traceback (most recent call last)
> ipython-input-1-7b977cf99468 in module()
> 2 trefoil = Knot(B([Integer(1),Integer(1),Integer(1)]))
> 3 K = trefoil.connected_sum(trefoil)
> --> 4 L = K.connected_sum(trefoil)
> /home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in connected_sum(self, other)
> 294 return Knot(B(list(b1.Tietze())
> 295 + [(abs(i) + b2s) * Integer(i).sign() for i in b2.Tietze()]
> --> 296 + [b1s]))
> 297
> /home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in __init__(self, data, check)
> 104 if check:
> 105 if self.number_of_components() != 1:
> --> 106 raise ValueError("the input has more than 1 connected component")
> 107
> 108 def __repr__(self):
> ValueError: the input has more than 1 connected component
Am I doing something wrong here?
Thanks in advance!Wed, 11 Apr 2018 06:14:13 -0500http://ask.sagemath.org/question/41985/connected-sum-of-knots/Comment by danieleC for <p>Hi! I was trying to recursively construct connected sums of knots, but I seem to run in to some problems when connect summing a knot to itself more than two times:</p>
<blockquote>
<p>B = BraidGroup(2)</p>
<p>trefoil = Knot(B([1,1,1]))</p>
<p>K = trefoil.connected_sum(trefoil)</p>
<p>L = K.connected_sum(trefoil)</p>
</blockquote>
<p>This does not work: </p>
<blockquote>
<pre><code>ValueError Traceback (most recent call last)
ipython-input-1-7b977cf99468 in module()
2 trefoil = Knot(B([Integer(1),Integer(1),Integer(1)]))
3 K = trefoil.connected_sum(trefoil)
--> 4 L = K.connected_sum(trefoil)
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in connected_sum(self, other)
294 return Knot(B(list(b1.Tietze())
295 + [(abs(i) + b2s) * Integer(i).sign() for i in b2.Tietze()]
--> 296 + [b1s]))
297
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in __init__(self, data, check)
104 if check:
105 if self.number_of_components() != 1:
--> 106 raise ValueError("the input has more than 1 connected component")
107
108 def __repr__(self):
ValueError: the input has more than 1 connected component
</code></pre>
<p>Am I doing something wrong here?
Thanks in advance!</p>
</blockquote>
http://ask.sagemath.org/question/41985/connected-sum-of-knots/?comment=41992#post-id-41992so it does not work either way? the result should be the same! anyway, it seems to have problems even when all knots are called in different ways, very weird!Thu, 12 Apr 2018 09:34:59 -0500http://ask.sagemath.org/question/41985/connected-sum-of-knots/?comment=41992#post-id-41992Comment by slelievre for <p>Hi! I was trying to recursively construct connected sums of knots, but I seem to run in to some problems when connect summing a knot to itself more than two times:</p>
<blockquote>
<p>B = BraidGroup(2)</p>
<p>trefoil = Knot(B([1,1,1]))</p>
<p>K = trefoil.connected_sum(trefoil)</p>
<p>L = K.connected_sum(trefoil)</p>
</blockquote>
<p>This does not work: </p>
<blockquote>
<pre><code>ValueError Traceback (most recent call last)
ipython-input-1-7b977cf99468 in module()
2 trefoil = Knot(B([Integer(1),Integer(1),Integer(1)]))
3 K = trefoil.connected_sum(trefoil)
--> 4 L = K.connected_sum(trefoil)
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in connected_sum(self, other)
294 return Knot(B(list(b1.Tietze())
295 + [(abs(i) + b2s) * Integer(i).sign() for i in b2.Tietze()]
--> 296 + [b1s]))
297
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in __init__(self, data, check)
104 if check:
105 if self.number_of_components() != 1:
--> 106 raise ValueError("the input has more than 1 connected component")
107
108 def __repr__(self):
ValueError: the input has more than 1 connected component
</code></pre>
<p>Am I doing something wrong here?
Thanks in advance!</p>
</blockquote>
http://ask.sagemath.org/question/41985/connected-sum-of-knots/?comment=41991#post-id-41991Note that, calling `t` the trefoil knot and `tt` its connected sum with itself,
one gets different errors when trying the connected sum of `tt` with `t`,
versus of `t` with `tt`. Indeed, defining:
B = BraidGroup(2)
t = Knot(B([1, 1, 1]))
c = Knot.connected_sum
tt = c(t, t)
one attempt gives:
sage: c(tt, t)
Traceback (most recent call last)
...
ValueError: the input has more than 1 connected component
while the other attempt gives:
sage: c(t, tt)
Traceback (most recent call last)
...
ValueError: generators not in the groupThu, 12 Apr 2018 08:03:03 -0500http://ask.sagemath.org/question/41985/connected-sum-of-knots/?comment=41991#post-id-41991Answer by slelievre for <p>Hi! I was trying to recursively construct connected sums of knots, but I seem to run in to some problems when connect summing a knot to itself more than two times:</p>
<blockquote>
<p>B = BraidGroup(2)</p>
<p>trefoil = Knot(B([1,1,1]))</p>
<p>K = trefoil.connected_sum(trefoil)</p>
<p>L = K.connected_sum(trefoil)</p>
</blockquote>
<p>This does not work: </p>
<blockquote>
<pre><code>ValueError Traceback (most recent call last)
ipython-input-1-7b977cf99468 in module()
2 trefoil = Knot(B([Integer(1),Integer(1),Integer(1)]))
3 K = trefoil.connected_sum(trefoil)
--> 4 L = K.connected_sum(trefoil)
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in connected_sum(self, other)
294 return Knot(B(list(b1.Tietze())
295 + [(abs(i) + b2s) * Integer(i).sign() for i in b2.Tietze()]
--> 296 + [b1s]))
297
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/knots/knot.pyc in __init__(self, data, check)
104 if check:
105 if self.number_of_components() != 1:
--> 106 raise ValueError("the input has more than 1 connected component")
107
108 def __repr__(self):
ValueError: the input has more than 1 connected component
</code></pre>
<p>Am I doing something wrong here?
Thanks in advance!</p>
</blockquote>
http://ask.sagemath.org/question/41985/connected-sum-of-knots/?answer=42003#post-id-42003This points to a bug in the code to compute `connected_sum`.
This issue is now tracked at
- [Sage trac ticket #25159](https://trac.sagemath.org/ticket/25159)
Thanks for reporting!Fri, 13 Apr 2018 07:03:37 -0500http://ask.sagemath.org/question/41985/connected-sum-of-knots/?answer=42003#post-id-42003