Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

I am totally new to Cadabra. Tried the following:

{x,p}::NonCommuting; c:= xp - px; simplify(c);

It gives 0 as output.

How do I use [x,p]=i to calculate commutators?

in General questions by

1 Answer

+1 vote

The simplify algorithm invokes Sympy, but does not (yet) translate all Cadabra properties to Sympy ones (Cadabra's properties are more general, so the map isn't even always possible, but of course in this particular case that's not the problem). For the time being, avoid simplify, as it will give wrong answers with non-commuting objects.

To do computations with non-commuting objects, you may want to have a look at the tutorial on the Poincare algebra, https://cadabra.science/notebooks/poincare_algebra.html . That's a bit more advanced than what you asked for, but perhaps it gets you in the right direction. If not, please ask again and tell in a bit more detail what you want to compute.

by (80.3k points)
...