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

Derivatives do not inherit SelfAntiCommuting properly in canonicalise #113

Open
kpeeters opened this issue Aug 24, 2018 · 5 comments
Open
Labels
bug An actual bug

Comments

@kpeeters
Copy link
Owner

They do work in sort_product, so it is most likely a bug in core/Exchange.cc.

@kpeeters
Copy link
Owner Author

@kpeeters kpeeters added the bug An actual bug label Jan 14, 2022
@dpbutter
Copy link
Contributor

dpbutter commented Nov 20, 2023

If I edit properties/Derivative.hh and add "public Inherit<SelfCommutingBehaviour>" to the definition of "class Derivative", then canonicalise behaves as expected.

(In cadabra v1, the corresponding modification goes into modules/algebra.hh.)

@kpeeters
Copy link
Owner Author

Thanks for digging into this! I suspect that there are still issue lurking here (those comments about anti-commuting derivatives in the source point to problems which cannot really be solved with the current setup). But since your fix squashes the bug you reported and it does not break any of the other tests, I have pushed to github now.

@dpbutter
Copy link
Contributor

dpbutter commented Nov 22, 2023

Thanks! I also intended to mention that I noticed in pythoncdb/py_properties.cc that there is a line:

using Py_Derivative = BoundProperty<Derivative, Py_IndexInherit, Py_CommutingAsProduct, Py_NumericalFlat, Py_TableauBase, Py_Distributable, Py_WeightBase>;

I don't understand how the python bindings work, and I wasn't sure if this needed to be modified to track with the change in Derivative.cc.

@kpeeters
Copy link
Owner Author

To be consistent this should also include Py_SelfCommutingBehaviour. But those declarations are only there to make the property visible on the Python side; if it is not listed then you will simply not be able to check on the Python side whether a pattern with a a Derivative property has a SelfCommutingBehaviour attached to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An actual bug
Projects
None yet
Development

No branches or pull requests

2 participants