Closed tBuLi closed 6 months ago
What you could do is give an OperatorDict
a write-once attribute indicating if which usecase it should cover. __call__
can then dispatch to more specific methods based on that attribute. I think that would be the cleanest. Alternatively you code do some live code generation with MixIns, but there be dragons
Already addressed.
The current OperatorDict implementation accepts an erbitrary number of multivectors. However, this introduces a lot of overhead while the typical usecases are unary and binary operators. Therefore, we should have dedicated functionality for these scenarios in order to significantly improve the performance of the
__call__
method of this object. I would prever to implement a__call_unary__
and__call_binary__
method for these scenarios instead of subclassing, such that we can still use the general cases if needed.