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

Add modulo to function field element #31244

Closed
Saher-Amasha mannequin opened this issue Jan 15, 2021 · 8 comments
Closed

Add modulo to function field element #31244

Saher-Amasha mannequin opened this issue Jan 15, 2021 · 8 comments

Comments

@Saher-Amasha
Copy link
Mannequin

Saher-Amasha mannequin commented Jan 15, 2021

a function that takes as input a polynomial.
the function returns the the current polynomial modulo the polynomial given as input

Component: algebra

Reviewer: Dave Morris

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

@Saher-Amasha Saher-Amasha mannequin added this to the sage-9.3 milestone Jan 15, 2021
@Saher-Amasha Saher-Amasha mannequin added c: algebra labels Jan 15, 2021
@DaveWitteMorris
Copy link
Member

comment:1

I don't understand the need for this function, because sage's "modulo" operator % works for polynomials:

sage: Qx.<x> = QQ[x]                                                                           
sage: (5*x^4 + 4*x^3 + 3*x^2 + 2*x + 1) % x^2                                                  
2*x + 1

@Saher-Amasha
Copy link
Mannequin Author

Saher-Amasha mannequin commented Jan 15, 2021

comment:2

Replying to @DaveWitteMorris:

I don't understand the need for this function, because sage's "modulo" operator % works for polynomials:

sage: Qx.<x> = QQ[x]                                                                           
sage: (5*x^4 + 4*x^3 + 3*x^2 + 2*x + 1) % x^2                                                  
2*x + 1

the modulo operator doesn't work in this example


sage: FF.<t> = FunctionField(QQ)                                                
sage: f= t^3+t^2+1 ;f                                                           
t^3 + t^2 + 1
sage: g= t^2+ 1 ;g                                                              
t^2 + 1
sage: f%g   
sage: f.mod(g) 

the % operator returns an error

the function mod ( f.mod(g) ) always returns zero regardless of f and g

thanks for taking the time to respond

@DaveWitteMorris
Copy link
Member

comment:3

0 is the correct answer for f.mod(g) (unless g = 0), because 1/g is in FF.

However, perhaps it would make sense to have a polynomial method that returns f.numerator() if f is a polynomial (and gives a ValueError otherwise). This would allow a user to treat f as a polynomial. For example, they could write f.polynomial() % g.polynomial() or f.polynomial().mod(g.polynomial()).

@mkoeppe
Copy link
Member

mkoeppe commented Feb 13, 2021

comment:4

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Feb 13, 2021
@Saher-Amasha
Copy link
Mannequin Author

Saher-Amasha mannequin commented Feb 27, 2021

comment:5

please remove ticket, function already exists.

@Saher-Amasha Saher-Amasha mannequin added the s: needs review label Feb 27, 2021
@Saher-Amasha Saher-Amasha mannequin removed this from the sage-9.4 milestone Feb 27, 2021
@DaveWitteMorris
Copy link
Member

Reviewer: Dave Morris

@DaveWitteMorris
Copy link
Member

comment:7

OK, we can close this ticket as invalid.

@mkoeppe
Copy link
Member

mkoeppe commented Mar 8, 2021

Changed author from Saher Amasha ,Safa Amasha to none

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

3 participants