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.Wed, 08 Jul 2015 16:50:36 +0200subgroup of number field unit grouphttps://ask.sagemath.org/question/27274/subgroup-of-number-field-unit-group/I would like to be able to create subgroups of a unit group generated by given elements. I haven't, thus far, been able to find a way to make this work. The following doesn't work:
N.<a> = NumberField(x^3+2)
G = N.unit_group()
g = G.random_element()
G.subgroup([g])
Can anyone help me find a workaround?
(Note: it appears to be a bug, see [trac.sagemath.org/ticket/18863](http://trac.sagemath.org/ticket/18863), but I'm just looking for a workaround for now.)Wed, 08 Jul 2015 00:59:55 +0200https://ask.sagemath.org/question/27274/subgroup-of-number-field-unit-group/Answer by tmonteil for <p>I would like to be able to create subgroups of a unit group generated by given elements. I haven't, thus far, been able to find a way to make this work. The following doesn't work:</p>
<pre><code>N.<a> = NumberField(x^3+2)
G = N.unit_group()
g = G.random_element()
G.subgroup([g])
</code></pre>
<p>Can anyone help me find a workaround? </p>
<p>(Note: it appears to be a bug, see <a href="http://trac.sagemath.org/ticket/18863">trac.sagemath.org/ticket/18863</a>, but I'm just looking for a workaround for now.)</p>
https://ask.sagemath.org/question/27274/subgroup-of-number-field-unit-group/?answer=27279#post-id-27279It seems you hit a bug with gap interface (though i am not able to explain further):
sage: G.inject_variables()
Defining u0, u1
sage: gap(u0)
f1
sage: gap(u1)
TypeError: Gap produced error output
Error, Variable: 'u1' must have a value
executing $sage5:=u1;;
sage: u1.value()
a + 1
sage: gap(u1.value())
a+1
It is not clear to me what kind of value is gap requiring. I tried with an embedded number field, but i get the same error.
Wed, 08 Jul 2015 15:48:34 +0200https://ask.sagemath.org/question/27274/subgroup-of-number-field-unit-group/?answer=27279#post-id-27279Comment by kcrisman for <p>It seems you hit a bug with gap interface (though i am not able to explain further):</p>
<pre><code>sage: G.inject_variables()
Defining u0, u1
sage: gap(u0)
f1
sage: gap(u1)
TypeError: Gap produced error output
Error, Variable: 'u1' must have a value
executing $sage5:=u1;;
sage: u1.value()
a + 1
sage: gap(u1.value())
a+1
</code></pre>
<p>It is not clear to me what kind of value is gap requiring. I tried with an embedded number field, but i get the same error.</p>
https://ask.sagemath.org/question/27274/subgroup-of-number-field-unit-group/?comment=27280#post-id-27280Ticket # ?Wed, 08 Jul 2015 16:50:36 +0200https://ask.sagemath.org/question/27274/subgroup-of-number-field-unit-group/?comment=27280#post-id-27280