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.Sat, 05 Feb 2022 01:11:27 +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)AlonAmitSat, 05 Feb 2022 01:11:27 +0100https://ask.sagemath.org/question/60945/