Ask Your Question
1

Constraints on polynomial coefficients

asked 2016-02-09 19:24:49 +0100

nd gravatar image

updated 2016-02-09 19:47:09 +0100

Given a polynomial P=(X-a)(X-b)(X-c) over Q[a,b,c][X] , how can I force the coefficients to fullfill constraints such as elementary symetric function a+b+c=0 or abc=2, some polynomial constraint on coefficients.

It is a bit like using coefficients on a number field with the constraint of a minimal polynomial but with different constraints here.

A simple example: if P = ( X - a ) ( X - b ) and a + b = 0 then I want to find P = X^2 - ab

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-02-09 23:14:53 +0100

tmonteil gravatar image

updated 2016-02-11 17:48:53 +0100

I am not sure to understand your question completely, but usually constraints can be expressed as working modulo some ideal :

sage: R.<x,a,b> = PolynomialRing(QQ)
sage: R
Multivariate Polynomial Ring in x, a, b over Rational Field
sage: P = R((x - a)*(x - b))
sage: P
x^2 - x*a - x*b + a*b
sage: P.mod(a+b)
x^2 - b^2

sage: R.<x,a,b,c> = PolynomialRing(QQ)
sage: P = R((x - a)*(x - b)*(x-c))
sage: P.mod(a+b+c)
x^3 - x*b^2 - x*b*c + b^2*c - x*c^2 + b*c^2
sage: P.mod(a*b*c-2)
x^3 - x^2*a - x^2*b + x*a*b - x^2*c + x*a*c + x*b*c - 2

Does this help ?

EDIT Regarding your answer, you should notice that, when a+b=0 (equivelently b=-a), you have x^2 - b^2 = x^2 + a*b since, you have -b^2 = -b*b = -b*(-a) = a*b !!! So i guess my answer still applies. You can check it as follows:

sage: R.<x,a,b> = PolynomialRing(QQ)
sage: I = R.ideal(a+b)
sage: I
Ideal (a + b) of Multivariate Polynomial Ring in x, a, b over Rational Field
sage: P = R((x - a)*(x - b))
sage: P.mod(I)
x^2 - b^2
sage: P.mod(I) == (x^2+a*b).mod(I)
True

Or, you can work directly in the quotient ring:

sage: Q = R.quotient(I)
sage: Q
Quotient of Multivariate Polynomial Ring in x, a, b over Rational Field by the ideal (a + b)
sage: Q(P)
xbar^2 - bbar^2
sage: Q(P) == Q(x^2+a*b)
True
sage:
edit flag offensive delete link more

Comments

Observe that the result is " X^2 - b^2 " while in case of " a+b=0", you should obtain " X^2 - a*b ".

Am still trying !

nd gravatar imagend ( 2016-02-10 21:29:23 +0100 )edit

Perhaps I wasn't clear at all. I have a polynomial where the coefficients are parameters. I take the example of

P = ( X - a0) * (X -a1) = X^2 + (-a0 - a1)*X + a0 * a1

I want to impose an equation on the parameters who belong to a field ("QQ" here), say "a0 + a1 = 0".

The result must be:

P = X^2 + a0 * a1

A=PolynomialRing(QQ,2,'a')

v=B.gens()

R.<x>=PolynomialRing(A)

P=R( ( X - v[0] ) * ( X - v[1] ) ) ; # P = ( X - a0) * (X -a1)

nd gravatar imagend ( 2016-02-11 09:24:16 +0100 )edit

I edited my answer to explain why x^2 - b^2 is as valid as x^2 + a*b.

tmonteil gravatar imagetmonteil ( 2016-02-11 17:39:53 +0100 )edit

Yes, you are perfectly right. I answered this because I was using coefficients defined on a number field, and the "mod" didn't work because I firstly defined the number field and then the ring. I discovered that if instead you define the ring and then the number field as an extension, the method works, at least for what I tried so far. I didn't have time to explain more my comment in between, and I thank you for your help.

nd gravatar imagend ( 2016-02-11 19:07:04 +0100 )edit
0

answered 2016-02-13 12:56:43 +0100

nd gravatar image

When I use several ideals, I don't have commutativity. Is this normal?

R.<x,a,b>=QQ[]

P1=(X-a)*(X-b)

I=R.ideal(a+b)

J=R.ideal(a*b)

A=P.mod(I).mod(J) => X^2 - b^2

B=P.mod(J).mod(I) => X^2

A==B; => False

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-09 19:24:49 +0100

Seen: 801 times

Last updated: Feb 13 '16