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
py3: hash collisions of Laurent polynomials #27914
Labels
Milestone
Comments
Author: Markus Wageringel |
New commits:
|
Commit: |
Reviewer: Frédéric Chapoton |
comment:2
ok, let it be |
Changed branch from u/gh-mwageringel/py3_hash_laurent to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This ticket adjusts the hash of multivariate Laurent polynomials, so that it agrees with the hash of univariate Laurent polynomials.
This solves the following problem: Using Python 3, this doctest in
laurent_polynomial.pyx
fails about 1 out of 4 times.Due to hash collisions, the result can be smaller than 25 (such as 23 or 21). This gets even worse when using a larger range of monomials.
Regardless of that, it is desirable that univariate and multivariate Laurent polynomials have the same hash anyway. The univariate hash implementation does not seem to have these collisions, so adopting that implementation solves this problem.
For reference, the univariate and multivariate hashes were implemented in #21272 and #23864.
Component: python3
Author: Markus Wageringel
Branch/Commit:
26eb5fd
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/27914
The text was updated successfully, but these errors were encountered: