2

I am thinking of having a custom multiplication operation CenterDot[A,B] for non-commutative operators, and some rules that should commute the operators to a desired ordering. The calculation would be very time intensive, while manipulations would just be trivial swapping of entries and addition of other entries. Therefore, I wonder if there is any (perhaps hacky?) way to Compile a code of this type in Mathematica? Thanks for any suggestion!

Kagaratsch
  • 11,955
  • 4
  • 25
  • 72
  • Let's say you could compile it. You are aware of the fact that a compiled function only takes numerical arguments of a specific, pre-determined type, yes? Can you provide the code for CenterDot and a small example on how to use it? – halirutan Dec 06 '17 at 09:13
  • @halirutan Yes, now I'm thinking of some way to only use lists and integers as labels, since AppendTo is compilable. I'll have to think more about it. – Kagaratsch Dec 06 '17 at 14:48
  • 2
    When you have a minimal example that works without compiling, then we can have a look at it and discuss if it is compilable. – halirutan Dec 06 '17 at 15:15
  • 2
    Perhaps Dispatch would be useful? – WReach Dec 06 '17 at 15:45
  • @WReach It is indeed interesting. Unfortunately it does not appear in the list of compilable functions though. https://mathematica.stackexchange.com/questions/1096/list-of-compilable-functions – Kagaratsch Dec 06 '17 at 17:37

0 Answers0