Opened 11 years ago

Closed 11 years ago

#9423 closed defect (fixed)

Gap interface for number fields

Reported by: SimonKing Owned by: was
Priority: major Milestone: sage-4.6.2
Component: interfaces Keywords: gap interface number field
Cc: Merged in: sage-4.6.2.alpha2
Authors: Simon King Reviewers: Luis Felipe Tabera Alonso
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Originally motivated by work on #5618, I found two bugs in the Gap interface for number fields, reported here.

#8909 has a positive review and seems partially relevant here, so, I started work with the patch from #8909 applied.

With the new patch, the following works (and is doctested):

sage: L.<tau> = NumberField(x^3-2)
sage: gap(tau)^3  # note the exclamation mark used by GAP
sage: L(gap(tau)^3) # this used to fail
sage: P.<z> = QQ[]  # Note: The var'name is z, not x
sage: K.<zeta> = NumberField(z^2 - 2)
sage: k = gap(K)  # this used to fail, as only var'name x was accepted

Fixing the second problem, it is needed to avoid a conflict with an internal variable name of a GAP function, namely "E". This tests that the conflict is indeed avoided:

sage: P.<E> = QQ[]
sage: L.<tau> = NumberField(E^3-2)
sage: gap(L)
<algebraic extension over the Rationals of degree 3>

Attachments (2)

trac_9423_gap_for_numberfields.patch (4.2 KB) - added by SimonKing 11 years ago.
Fixing two bugs (doctested) in the GAP interface of number fields
trac_9423_gap_for_numberfields.2.patch (4.2 KB) - added by lftabera 11 years ago.
Updated headers

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by SimonKing

Fixing two bugs (doctested) in the GAP interface of number fields

comment:1 Changed 11 years ago by SimonKing

  • Status changed from new to needs_review

comment:2 Changed 11 years ago by lftabera

  • Reviewers set to Luis Felipe Tabera Alonso

The code corrects a couple of bugs in the gap interface of number fields. Since ! cannot be part of the name of a generator of a number field, then eliminating "!" from the gap representation is correct.

The solution to the "E" variable problem is correct, althought there should be a more system-wide solution to this kind of problems.

I will not give it a positive review until #5618 is also ready to merge, since this patch eliminates a doctest that after #5618 will be obsolete.

Changed 11 years ago by lftabera

Updated headers

comment:3 Changed 11 years ago by lftabera

  • Milestone changed from sage-4.6.1 to sage-4.6.2
  • Status changed from needs_review to positive_review

Positive review, I have only updated the patch header to add the ticket number



Note to the release manager: ticket #5618 depends on this. This ticket should be merged together with #5618.

comment:4 Changed 11 years ago by jdemeyer

  • Merged in set to sage-4.6.2.alpha2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.