Intersection (and quotient) of ideals in a single variable polynomial ring

33 views
Skip to first unread message

Luis Garcia-Puente

unread,
Aug 18, 2020, 9:31:55 AM8/18/20
to sage-support
The following code does not run in a Jupyter notebook inside cocalc 

R.<x> = PolynomialRing(QQ) 
f = x^3+6*x^2+12*x+8;
g = x^2+x-2;
I = R.ideal([f]);
J = R.ideal([g]);
I.intersection(J)

This produces an error that ends with the line:

AttributeError: 'Ideal_1poly_field' object has no attribute 'intersection'

Similarly,  we get an error in the following line

I.quotient(J)

AttributeError: 'Ideal_1poly_field' object has no attribute 'quotient'

However, if we use the ring on 2 variables

R.<x,y> = PolynomialRing(QQ) 

all computations execute.

William

unread,
Aug 18, 2020, 12:56:00 PM8/18/20
to sage-support
  Hi Luis,

It's actually not a bug, but a missing feature.   The problem is that in the first case R is a *univariate* polynomial ring, and in the second case it is a multivariate polynomial ring and different functionality is available in each case.  Read the docs for PolynomialRing (via PolynomialRing?) for more details.  To fix your code, just use the implementation="singular" option to get a multivariate polynomial ring in 1 variable:

     R.<x> = PolynomialRing(QQ, implementation="singular")

-William

William

unread,
Aug 18, 2020, 12:56:26 PM8/18/20
to sage-support
Reply all
Reply to author
Forward
0 new messages