Hi Alexei, would you accept this patch to make creation of non-commutative symbols easier? Problem: The GiNaC info documentation claims: "Both symbols and user-defined functions can be specified as being non-commutative" Currently this is only possible by defining a new subclass of symbol and overloading return_type(). Solution: Added unsigned rtype to class symbol Overloaded return_type() Modified constructors (including realsymbol and possymbol), printing and archiving accordingly ------------ Now my next question is (after applying the above patch) whether there is a bug in ncmul::eval(). I created this test program #include <ginac/ginac.h> using namespace GiNaC; int main() { symbol M1("M1", "M1", return_types::noncommutative); symbol x("x"), y("y"); matrix M2(2,2); M2 = x, 0, y, 0; symbol M3("M3", "M3", return_types::noncommutative); ex nc; nc = M1 * M2; // Produces a mul !! nc = M1 * M1; // Produces a ncmul nc = M1 * M3; // Produces a ncmul nc = nc.subs(M1 == M2); // Produces a mul !! } As you can see, the assignment sometimes creates a mul when a ncmul should be created. Best regards, Jan