ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 07 Feb 2022 10:25:24 +0100Challenges with subgroup elementshttps://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/I'm running into apparent inconsistencies when studying subgroups of the unit group of a cyclotomic field.
k = CyclotomicField(7,'z')
U = k.unit_group()
z = k.gen()
a = 1+z
b = a^(-1)
T = U.subgroup([U(a)])
print(U(a) in U)
print(U(b) in U)
print(U(a) in T)
print(U(b) in T)
What I'm getting is:
True
True
True
False
which doesn't make sense. $T$ is a subgroup, so if it contains $a$ it must also contain $a^{-1}$. The group $U$ gets it right, but the subgroup $T$ does not. I'm guessing this is some coercion issue, but I'm not sure why it's happening, if it's a bug, and how to work around it.
(Checked this on the Sage Cell Server and CoCalc with Sage 9.4)Sat, 05 Feb 2022 01:11:27 +0100https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/Comment by AlonAmit for <p>I'm running into apparent inconsistencies when studying subgroups of the unit group of a cyclotomic field.</p>
<pre><code>k = CyclotomicField(7,'z')
U = k.unit_group()
z = k.gen()
a = 1+z
b = a^(-1)
T = U.subgroup([U(a)])
print(U(a) in U)
print(U(b) in U)
print(U(a) in T)
print(U(b) in T)
</code></pre>
<p>What I'm getting is:</p>
<pre><code>True
True
True
False
</code></pre>
<p>which doesn't make sense. $T$ is a subgroup, so if it contains $a$ it must also contain $a^{-1}$. The group $U$ gets it right, but the subgroup $T$ does not. I'm guessing this is some coercion issue, but I'm not sure why it's happening, if it's a bug, and how to work around it. </p>
<p>(Checked this on the Sage Cell Server and CoCalc with Sage 9.4)</p>
https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?comment=60981#post-id-60981Wow. Thank you both. Yeah, ver 9.5 resolves this issue. Whew!Mon, 07 Feb 2022 03:06:40 +0100https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?comment=60981#post-id-60981Comment by Max Alekseyev for <p>I'm running into apparent inconsistencies when studying subgroups of the unit group of a cyclotomic field.</p>
<pre><code>k = CyclotomicField(7,'z')
U = k.unit_group()
z = k.gen()
a = 1+z
b = a^(-1)
T = U.subgroup([U(a)])
print(U(a) in U)
print(U(b) in U)
print(U(a) in T)
print(U(b) in T)
</code></pre>
<p>What I'm getting is:</p>
<pre><code>True
True
True
False
</code></pre>
<p>which doesn't make sense. $T$ is a subgroup, so if it contains $a$ it must also contain $a^{-1}$. The group $U$ gets it right, but the subgroup $T$ does not. I'm guessing this is some coercion issue, but I'm not sure why it's happening, if it's a bug, and how to work around it. </p>
<p>(Checked this on the Sage Cell Server and CoCalc with Sage 9.4)</p>
https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?comment=60951#post-id-60951Implentation of subgroups of unit groups is known to be buggy. E.g., see https://ask.sagemath.org/question/59558 along the same lines.Sat, 05 Feb 2022 13:43:01 +0100https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?comment=60951#post-id-60951Comment by rburing for <p>I'm running into apparent inconsistencies when studying subgroups of the unit group of a cyclotomic field.</p>
<pre><code>k = CyclotomicField(7,'z')
U = k.unit_group()
z = k.gen()
a = 1+z
b = a^(-1)
T = U.subgroup([U(a)])
print(U(a) in U)
print(U(b) in U)
print(U(a) in T)
print(U(b) in T)
</code></pre>
<p>What I'm getting is:</p>
<pre><code>True
True
True
False
</code></pre>
<p>which doesn't make sense. $T$ is a subgroup, so if it contains $a$ it must also contain $a^{-1}$. The group $U$ gets it right, but the subgroup $T$ does not. I'm guessing this is some coercion issue, but I'm not sure why it's happening, if it's a bug, and how to work around it. </p>
<p>(Checked this on the Sage Cell Server and CoCalc with Sage 9.4)</p>
https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?comment=60948#post-id-60948Please try SageMath 9.5, as there was a fix in this area recently.Sat, 05 Feb 2022 11:42:27 +0100https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?comment=60948#post-id-60948Answer by rburing for <p>I'm running into apparent inconsistencies when studying subgroups of the unit group of a cyclotomic field.</p>
<pre><code>k = CyclotomicField(7,'z')
U = k.unit_group()
z = k.gen()
a = 1+z
b = a^(-1)
T = U.subgroup([U(a)])
print(U(a) in U)
print(U(b) in U)
print(U(a) in T)
print(U(b) in T)
</code></pre>
<p>What I'm getting is:</p>
<pre><code>True
True
True
False
</code></pre>
<p>which doesn't make sense. $T$ is a subgroup, so if it contains $a$ it must also contain $a^{-1}$. The group $U$ gets it right, but the subgroup $T$ does not. I'm guessing this is some coercion issue, but I'm not sure why it's happening, if it's a bug, and how to work around it. </p>
<p>(Checked this on the Sage Cell Server and CoCalc with Sage 9.4)</p>
https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?answer=60991#post-id-60991The issue is fixed in SageMath 9.5.Mon, 07 Feb 2022 10:25:24 +0100https://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/?answer=60991#post-id-60991