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.Thu, 21 Jun 2018 23:18:31 +0200get multiplicative subgroup of Z/nZhttps://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/Is it possible to get a multiplicative group object of integers modulo n?
For example for n=15 the elements are {1,2,4,7,8,11,13,14}
Of course I can get the elements itself with
> R = Integers(15)
> R.list_of_elements_of_multiplicative_group()
but not as a group.
It is also possible to construct the isomorphic group C2 x C4,
but then the elements are not integers:
> G=AbelianGroup([2,4])
Thu, 11 Jul 2013 17:15:52 +0200https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/Answer by Volker Braun for <p>Is it possible to get a multiplicative group object of integers modulo n?</p>
<p>For example for n=15 the elements are {1,2,4,7,8,11,13,14}</p>
<p>Of course I can get the elements itself with </p>
<blockquote>
<p>R = Integers(15)</p>
<p>R.list_of_elements_of_multiplicative_group()</p>
</blockquote>
<p>but not as a group.</p>
<p>It is also possible to construct the isomorphic group C2 x C4,
but then the elements are not integers:</p>
<blockquote>
<p>G=AbelianGroup([2,4])</p>
</blockquote>
https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/?answer=15226#post-id-15226The `list_of_elements_of_multiplicative_group` should definitely return elements of `R`, not Python integers. Somewhat ugly, but ok there is your group:
sage: M = map(R, R.list_of_elements_of_multiplicative_group())
sage: M[2]*M[5] in M
True
sage: prod(M) == 1
True
Now the isomorphism with `C2 x C4` is not unique, so its not clear how this can be improved. Maybe one could return a particular morphism from `C2 x C4` to `R`. In any case, as far as I know this is not (yet) implemented.Thu, 11 Jul 2013 17:30:12 +0200https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/?answer=15226#post-id-15226Comment by mathjain for <p>The <code>list_of_elements_of_multiplicative_group</code> should definitely return elements of <code>R</code>, not Python integers. Somewhat ugly, but ok there is your group:</p>
<pre><code>sage: M = map(R, R.list_of_elements_of_multiplicative_group())
sage: M[2]*M[5] in M
True
sage: prod(M) == 1
True
</code></pre>
<p>Now the isomorphism with <code>C2 x C4</code> is not unique, so its not clear how this can be improved. Maybe one could return a particular morphism from <code>C2 x C4</code> to <code>R</code>. In any case, as far as I know this is not (yet) implemented.</p>
https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/?comment=42712#post-id-42712Yeah this surely works for the case when R is defined as Integers(something). Is there any method to get it for a general finite field for instance, a residue field?Thu, 21 Jun 2018 23:18:31 +0200https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/?comment=42712#post-id-42712Comment by jack77 for <p>The <code>list_of_elements_of_multiplicative_group</code> should definitely return elements of <code>R</code>, not Python integers. Somewhat ugly, but ok there is your group:</p>
<pre><code>sage: M = map(R, R.list_of_elements_of_multiplicative_group())
sage: M[2]*M[5] in M
True
sage: prod(M) == 1
True
</code></pre>
<p>Now the isomorphism with <code>C2 x C4</code> is not unique, so its not clear how this can be improved. Maybe one could return a particular morphism from <code>C2 x C4</code> to <code>R</code>. In any case, as far as I know this is not (yet) implemented.</p>
https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/?comment=17296#post-id-17296Hello,
I'm not sure if I have an account for the sagemath tracker.
Did you open an issue ticket for return value of
'list_of_elements_of_multiplicative_group' ?
Thu, 11 Jul 2013 18:16:34 +0200https://ask.sagemath.org/question/10346/get-multiplicative-subgroup-of-znz/?comment=17296#post-id-17296