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

BooleanPolynomialRing.remove_var(...) does not return a BooleanPolynomialRing #13965

Closed
sagetrac-Bouillaguet mannequin opened this issue Jan 17, 2013 · 9 comments
Closed

Comments

@sagetrac-Bouillaguet
Copy link
Mannequin

sagetrac-Bouillaguet mannequin commented Jan 17, 2013

sage: P.<x,y,z,w> = BooleanPolynomialRing()
sage: P
Boolean PolynomialRing in x, y, z, w

and :

sage: P.remove_var('x')
Multivariate Polynomial Ring in y, z, w over Finite Field of size 2

CC: @malb @alexanderdreyer @sagetrac-PolyBoRi

Component: commutative algebra

Author: Charles Bouillaguet

Reviewer: Alexander Dreyer

Merged: sage-5.7.beta1

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

@sagetrac-Bouillaguet sagetrac-Bouillaguet mannequin added this to the sage-5.7 milestone Jan 17, 2013
@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jan 17, 2013

Author: Charles Bouillaguet

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Jan 17, 2013

comment:2

The patch looks good, but what about the ordering?

@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jan 18, 2013

comment:3

I mimicked what existed in multi_polynomial_ring_generic.pyx, and it ignored the order (my intuition would be that sometimes it must not be possible to carry on the order, when it is a block order for instance).

I think that we could let the user optionally provide an order for the "reduced" ring, and not try to do anything automatically... Do you agree ?

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Jan 18, 2013

comment:4

Replying to @sagetrac-Bouillaguet:

I mimicked what existed in multi_polynomial_ring_generic.pyx, and it ignored the order (my intuition would be that sometimes it must not be possible to carry on the order, when it is a block order for instance).

For block orders you just have to make the blocks smaller. That' not a oneliner, but something like

blks=R.term_order().blocks()
max_idx = len(blks[0])
if idx < max_idx:
  if nlen > 0:
    new_order = TermOrder(bl, len(bl)-1)
else:
  new_order = bl

for bl in blks[1:]:
  nlen = len(bl)
  max_idx += nlen
  if idx < max_idx:
     if nlen > 0:
       new_order += TermOrder(bl, nlen-1)
  else:
     new_order += bl
 

should do.

I think that we could let the user optionally provide an order for the "reduced" ring, and not try to do anything automatically... Do you agree ?

It the line above do not work out for some case, it would be an acceptable alternative.

@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jan 20, 2013

comment:5

Attachment: 13965_boolean_remove_var.patch.gz

I implemented a compromise solution, and for good measure I also adapted it to generic polynomial rings.

AlexanderDreyer, do you like it?

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Jan 21, 2013

comment:6

Replying to @sagetrac-Bouillaguet:

I implemented a compromise solution, and for good measure I also adapted it to generic polynomial rings.

AlexanderDreyer, do you like it?

Yeah, that indeed a good comprise: it works out of the box in typical use cases and is not to hard in the remaining cases (where people probably know their way thru). So this is a positive review, if patchbot agrees.

@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jan 23, 2013

Reviewer: Alexander Dreyer

@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jan 23, 2013

comment:7

Patchbot agrees :)

@jdemeyer
Copy link

Merged: sage-5.7.beta1

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

2 participants