Opened 4 years ago

Last modified 4 years ago

#18863 new defect

Subgroup doesn't work with number field unit group

Reported by: katestange Owned by:
Priority: major Milestone: sage-6.8
Component: group theory Keywords: unit group, number field, subgroup, gap
Cc: katestange Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by katestange)

I think we would like the following code to work:

N.<a> = NumberField(x^3+2)
G = N.unit_group()
g = G.random_element()

But at the moment the last line produces a runtime error

RuntimeError: Gap produced error output
Error, Variable: 'u1' must have a value

This is currently reproducible on the single cell sage server and sage cloud. It does not seem to depend on the number field in question.

As far as I can tell, subgroup() is unable to recognise the input as elements of the group. I think the problem is that one cannot pass the argument 'names' when creating the unit group. For example, the following works:

H = AbelianGroup(5,[2],names=list("pqrst"))

but the following fails in exactly the same way as the unit group example

H = AbelianGroup(5,[2])

Change History (7)

comment:1 Changed 4 years ago by katestange

  • Priority changed from minor to major

comment:2 Changed 4 years ago by katestange

  • Description modified (diff)

comment:3 Changed 4 years ago by katestange

  • Description modified (diff)

comment:4 Changed 4 years ago by katestange

  • Description modified (diff)

comment:5 Changed 4 years ago by katestange

I asked for a workaround here, and there is some more information from other users there:

comment:6 Changed 4 years ago by katestange

  • Keywords gap added

comment:7 Changed 4 years ago by fwclarke

I note that the same problem arises with class groups, which are also built using AbelianGroupWithValues. However in the following case, it is possible to obtain a subgroup of a group with values:

sage: U = Zmod(30).unit_group()
sage: type(U)
<class 'sage.groups.abelian_gps.values.AbelianGroupWithValues_class_with_category'>
sage: U.subgroup([U.random_element()])
Multiplicative Abelian subgroup isomorphic to C2 generated by {f0*f1^2}

I have tried, but failed, to see why the other cases lead to gap errors.

Note: See TracTickets for help on using tickets.