[GiNaC-list] non-commutative symbols (again)

Alexei Sheplyakov alexei.sheplyakov at gmail.com
Sat Feb 19 22:05:47 CET 2011


Hi, Jan!

> 1. Why does replacing a non-commutative object with another
> non-commutative object result in the ncmul becoming a mul?
> 2. Why is the product of two (different) non-commutative objects a mul
> and not a ncmul?

In a nutshell, non-commutative objects of the different (C++) types are assumed
to commute with each other (say, Dirac matrices commute with Gell-Mann ones).
One can change this behavior by overriding the return_type_tinfo() method.

See the tutorial (section titled `Non-commutative objects') for more details
and examples.

Hope this helps,
	Alexei



More information about the GiNaC-list mailing list