Skip to content

Conversation

darijgr
Copy link
Contributor

@darijgr darijgr commented May 31, 2024

Weyl algebras elements cannot be hashed or compared, since the element class is too barren.
This patch lets the element class inherit from IndexedFreeModuleElement, which fixes this problem automatically.

@darijgr darijgr requested a review from tscrim May 31, 2024 04:28
Copy link

github-actions bot commented May 31, 2024

Documentation preview for this PR (built with commit 12162b2; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _richcmp_ and __init__ are no longer needed as it will be inherited from IndexedFreeModuleElement. Please keep the doctests somewhere though.

These methods are also unnecessary but can simply be removed: _add_, __neg__, monomial_coefficients, support,

Please add a test showing the left and right multiplication of the Weyl algebra by the corresponding polynomial ring generates the correct results. I am slightly worried about the _acted_upon_ versus _lmul_ and _rmul_ not being compatible...

@darijgr
Copy link
Contributor Author

darijgr commented Jun 1, 2024

Good points. All done -- except for the doctests, which already exist.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks. Then let's get this in.

@darijgr
Copy link
Contributor Author

darijgr commented Jun 1, 2024

Thank you, Travis!

vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 3, 2024
sagemathgh-38119: Fix hashing for Weyl algebra elements
    
Weyl algebras elements cannot be hashed or compared, since the element
class is too barren.
This patch lets the element class inherit from IndexedFreeModuleElement,
which fixes this problem automatically.
    
URL: sagemath#38119
Reported by: Darij Grinberg
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 4, 2024
sagemathgh-38119: Fix hashing for Weyl algebra elements
    
Weyl algebras elements cannot be hashed or compared, since the element
class is too barren.
This patch lets the element class inherit from IndexedFreeModuleElement,
which fixes this problem automatically.
    
URL: sagemath#38119
Reported by: Darij Grinberg
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request Jun 5, 2024
sagemathgh-38119: Fix hashing for Weyl algebra elements
    
Weyl algebras elements cannot be hashed or compared, since the element
class is too barren.
This patch lets the element class inherit from IndexedFreeModuleElement,
which fixes this problem automatically.
    
URL: sagemath#38119
Reported by: Darij Grinberg
Reviewer(s): Travis Scrimshaw
@vbraun vbraun merged commit b80817e into sagemath:develop Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants