kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

Make trace more versatile #184

Closed cbehan closed 4 years ago

cbehan commented 4 years ago

Hopefully I didn't make a mistake about how products are wrapped.

kpeeters commented 4 years ago

Can you please ensure that make test completes without failed tests? Several tests fail because of the line in canonicalise.cc which I have annotated, but even with that fixed there are tests which fail. I can help to fix these, but don't have any more time tonight to do much digging.

kpeeters commented 4 years ago

Sorry for the wait, I have now merged this, thanks a lot for the contribution. There was still one test failing in your version, which had to do with Traceless not having anything set for the index_set_name, and canonicalise.cc hence not recognising that a trace using indices with Indices property should be set to zero.

kpeeters commented 4 years ago

Just one more comment: as you are probably aware, your improved sort_order will still not recognise that tr( A B B A) and tr(A A B B) are equal, because it only makes the first element the 'smallest', but does not look beyond that.

Let me know if you want to improve this; if not I'll give it a shot.

cbehan commented 4 years ago

Hey Kasper. I'll work on refining the trace cycling for my next commit. And thanks for figuring out the problem with the canonicalise test. I forgot to mention that I was having trouble spotting it.