Opened 6 months ago

Last modified 7 weeks ago

#31605 new enhancement

Implement integer_representation method for all finite fields

Reported by: slelievre Owned by:
Priority: major Milestone: sage-9.5
Component: finite rings Keywords:
Cc: gh-DaveWitteMorris, slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by slelievre)

In Sage 9.3.rc0, this works:

sage: p = 127
sage: K.<t> = GF(p^2, modulus=x^2 + 1)
sage: type(K)
<class
'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
sage: a = 3*t + 2
sage: a.integer_representation()
383
sage: 3*p + 2
383

but this does not:

sage: p = 367
sage: K.<t> = GF(p^2, modulus=x^2 + 1)
sage: type(K)
<class
'sage.rings.finite_rings.finite_field_pari_ffelt.FiniteField_pari_ffelt_with_category'>
sage: a = 3*t + 2
sage: a.integer_representation()
Traceback (most recent call last)
...
AttributeError:
'sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt'
object has no attribute 'integer_representation'

Expected (3 * 367 + 2):

1103

Additionally, the method should return a Sage integer rather than a Python integer as the existing implementation for Givaro finite field elements currently does.

Suggested by revisiting this 2013 question by Ask Sage user "bonjour":

Similar to:

  • #31294: Implement fetch_int method for non-givaro finite fields

Change History (4)

comment:1 follow-up: Changed 6 months ago by gh-DaveWitteMorris

This seems to be a duplicate of #8578 (except that the name of the method seems to have been int_repr back then), so I think one of the two should be closed.

There is a bit of discussion of this issue in this sage-devel thread.

comment:2 in reply to: ↑ 1 Changed 6 months ago by slelievre

  • Description modified (diff)
  • Summary changed from Implement integer_representation method for non-givaro finite fields to Implement integer_representation method for all finite fields

Replying to gh-DaveWitteMorris:

This seems to be a duplicate of #8578 (except that the name of the method seems to have been int_repr back then), so I think one of the two should be closed.

Thanks for spotting that. I agree one of the tickets should be closed as duplicate. I don't mind which. Maybe it's less trouble to close the older one given the method changed name in the meantime.

comment:3 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.

comment:4 Changed 7 weeks ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5
Note: See TracTickets for help on using tickets.