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

is_nilpotent is broken in BooleanPolynomialRings #23311

Open
sagetrac-msaaltink mannequin opened this issue Jun 22, 2017 · 1 comment
Open

is_nilpotent is broken in BooleanPolynomialRings #23311

sagetrac-msaaltink mannequin opened this issue Jun 22, 2017 · 1 comment

Comments

@sagetrac-msaaltink
Copy link
Mannequin

sagetrac-msaaltink mannequin commented Jun 22, 2017

sage: B.<a,b,c> = BooleanPolynomialRing(); B
Boolean PolynomialRing in a, b, c
sage: (a+b).is_nilpotent()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-57-dbf2beaed57d> in <module>()
----> 1 (a+b).is_nilpotent()

src/sage/rings/polynomial/multi_polynomial.pyx in sage.rings.polynomial.multi_polynomial.MPolynomial.is_nilpotent (src/build/cythonized/sage/rings/polynomial/multi_polynomial.c:29775)()
   2347         # This generalizes easily to the multivariate case, by considering
   2348         # K[x,y,...] as K[x][y]...
-> 2349         d = self.dict()
   2350         return all(c.is_nilpotent() for c in d.values())
   2351 

[...]

AttributeError: 'sage.rings.polynomial.pbori.BooleanPolynomial' object has no attribute 'dict'

The code looking for self.dict is from trac [ticket:22454], that implemented is_unit and is_nilpotent for multivariate polynomial rings. It looks like BooleanPolynomialRings inherit that method but do not implement the dictionary.

As only 0 is nilpotent in these rings it should be simple to fix.

Component: algebra

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

@sagetrac-msaaltink sagetrac-msaaltink mannequin added this to the sage-8.0 milestone Jun 22, 2017
@sagetrac-msaaltink
Copy link
Mannequin Author

sagetrac-msaaltink mannequin commented Jul 24, 2017

comment:1

Boolean polynomial elements inherit from MPolynomial, but do not implement the dict, exponents, or _derivative methods, so many other methods also break: coefficients, truncate, derivative, polynomial, gradient, jacobian_ideal, newton_polytope, content, map_coefficients, sylvester_matrix, denominator, numerator, weighted_degree, nth_root, and specialization.

@mkoeppe mkoeppe removed this from the sage-8.0 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

1 participant