Symbolics avoid simplifications with rules

How can I avoid simplification before applying a rule in Symbolics?
I have (xy-yx) and I want to replace it with commutator(x, y), but before the rule can be applied xy-yx is simplified to 0.

You’d want to apply a special type and then your own rule set.

1 Like

Thanks for the answers and also for your videos on YB, I am learning a lot from them.
Is there a particular reason why a non-commutative operator or a non-commutative type is not implemented directly in Symbolics? Their absence can be an obstacle for anyone who is not a programmer but wants to use Symbolics.