Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let the user define their own primitive element for Fq (in givaro) #20670

Open
dimpase opened this issue May 24, 2016 · 28 comments
Open

Let the user define their own primitive element for Fq (in givaro) #20670

dimpase opened this issue May 24, 2016 · 28 comments

Comments

@dimpase
Copy link
Member

dimpase commented May 24, 2016

Sage does not allow Fq to be defined with a user-supplied polynomial together with a user-supplied primitive element. However, recent (4.0.2 or newer) givaro is able to accept such input and use it.

CC: @sagetrac-jakobkroeker @ClementPernet @malb

Component: finite rings

Issue created by migration from https://trac.sagemath.org/ticket/20670

@dimpase dimpase added this to the sage-7.3 milestone May 24, 2016
@jdemeyer
Copy link

Replying to @dimpase:

Givaro does not allow Fq to be defined with a user-supplied polynomial.

Why do you think that?

sage: k.<a> = GF(9, modulus=x^2+1)
sage: k
Finite Field in a of size 3^2
sage: k.modulus()
x^2 + 1
sage: type(k)
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@jdemeyer jdemeyer removed this from the sage-7.3 milestone May 24, 2016
@dimpase
Copy link
Member Author

dimpase commented May 24, 2016

comment:3

Do you know how to do this on C++ level?

At least, that's what Macaulay2 people came up with, that patch in the ticket branch.
Perhaps they should have done this differently?

@jdemeyer
Copy link

comment:4

In givgfq.h, there is

template<typename Vector>
GFqDom(const UTT P, const UTT e, const Vector& modPoly);

right above the line added by Macaulay2.

Note the subtle difference: it does not take a generatorPoly argument in case that matters.

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented May 24, 2016

comment:5

well, yes, indeed, in Macaulay2 one can specify a primitive element along with a modulus. So with this patch Sage can do the same (although I don't see how to override k.multiplicative_generator(); I thought I can just specify self.__multiplicative_generator in FiniteField_givaro, but it does not work...)

It seems that FiniteField_givaro isn't even used, and the whole class structure is a mystery to me here.

@dimpase dimpase added this to the sage-7.3 milestone May 24, 2016
@jdemeyer
Copy link

comment:6

Are you sure that Macaulay2 really requires a custom primitive element and a custom polynomial or is that just an implementation detail?

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title let the user define their own polynomial for Fq in givaro Let the user define their own modulus and primitive element for Fq in givaro May 25, 2016
@dimpase
Copy link
Member Author

dimpase commented May 25, 2016

comment:7

Replying to @jdemeyer:

Are you sure that Macaulay2 really requires a custom primitive element and a custom polynomial or is that just an implementation detail?

Given a modulus (or not), it can certainly compute a primitive element, although it does have an option to supply a custom primitive element. And to do this it uses givaro backend with the patch in question.

@dimpase
Copy link
Member Author

dimpase commented May 25, 2016

comment:8

This is one of the two patches (another one is for ffpack) needed to build and run Macaulay2 v1.9 (the current version, with an adaptation of Sage's pari/mpir workaround --- after I told them about Sage's pari/mpir workaround related to memory allocators) within Sage.

@dimpase
Copy link
Member Author

dimpase commented May 25, 2016

Author: Dima Pasechnik

@vbraun
Copy link
Member

vbraun commented May 25, 2016

comment:10

The patch should have some sort of documentation (ideally in the patch header)

@dimpase
Copy link
Member Author

dimpase commented May 26, 2016

comment:11

Replying to @vbraun:

The patch should have some sort of documentation (ideally in the patch header)

my hope is to implement a possibility to supply a primitive element to GF(), using this patch as a backend. But I got lost trying to figure out how the current implementation uses givaro.

Could anyone point me to the right place in the code?

@dimpase
Copy link
Member Author

dimpase commented Aug 22, 2016

comment:12

I am told that the patch on the branch is in givaro 4.0.2.

@dimpase
Copy link
Member Author

dimpase commented Aug 26, 2016

Dependencies: #17635

@dimpase dimpase removed this from the sage-7.3 milestone Aug 26, 2016
@dimpase dimpase added this to the sage-7.4 milestone Aug 26, 2016
@ClementPernet
Copy link
Contributor

comment:15

Indeed, the patch has been merged upstream in linbox-team/givaro#18 and released in 4.0.2 that is now in #17635.

@jdemeyer
Copy link

Changed reviewer from Jeroen Demeyer to Dima Pasechnik, Jeroen Demeyer

@jdemeyer
Copy link

Changed author from Dima Pasechnik to none

@jdemeyer jdemeyer removed this from the sage-7.4 milestone Aug 27, 2016
@dimpase
Copy link
Member Author

dimpase commented Aug 27, 2016

comment:17

the question I asked in comment:11 is still unanswered.

@embray
Copy link
Contributor

embray commented Aug 30, 2016

comment:18

Determined to be invalid/duplicate/wontfix (closing as "wontfix" as a catch-all resolution).

@embray embray closed this as completed Aug 30, 2016
@dimpase dimpase self-assigned this Jan 19, 2017
@dimpase dimpase added this to the sage-7.6 milestone Jan 19, 2017
@dimpase
Copy link
Member Author

dimpase commented Jan 19, 2017

comment:20

Replying to @embray:

Determined to be invalid/duplicate/wontfix (closing as "wontfix" as a catch-all resolution).

I have to re-open this, but is it possible without opening a new ticket?

@embray
Copy link
Contributor

embray commented Jan 19, 2017

comment:21

Yes, (under action). I think you have the permissions to do that but I'm not sure. I've been yelled at before for doing this but in this case I was the one who closed the ticket so I don't mind reopening it too if you think it should be.

@embray embray removed the r: wontfix label Jan 19, 2017
@embray embray reopened this Jan 19, 2017
@dimpase

This comment has been minimized.

@dimpase dimpase changed the title Let the user define their own modulus and primitive element for Fq in givaro Let the user define their own primitive element for Fq (in givaro) Jan 20, 2017
@jdemeyer
Copy link

Changed reviewer from Dima Pasechnik, Jeroen Demeyer to none

@jdemeyer
Copy link

Changed commit from adb59c0 to none

@jdemeyer
Copy link

Changed branch from u/dimpase/givaropatch to none

@jdemeyer
Copy link

Changed dependencies from #17635 to none

@dimpase
Copy link
Member Author

dimpase commented Jan 4, 2019

comment:25

Ping - I have been recently asked how to define a custom primitive element (Magma can do it, so they have to use Magma because of this, and better support for Zech transform)

@mkoeppe mkoeppe removed this from the sage-7.6 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants