[GiNaC-list] is_a<su3f>(e) return zero!!

Christian Bauer Christian.Bauer at uni-mainz.de
Mon Mar 21 15:17:15 CET 2005


On Thu, Mar 17, 2005 at 09:03:10PM -0300, mdias at ift.unesp.br wrote:
> But a diferent question arise: I make a struct that look at a ex
> e=color_f($0,$1,$2) and return zero.

Uhm, what exactly are you trying to do? Indices of color_f() need to be of
type idx, so if you want to use wildcards, it needs to look like this:

  ex e = color_f(idx(wild(0), 8), idx(wild(1), 8), idx(wild(2), 8));
  cout << e << endl;
   // -> "f.($0).($1).($2)"

> is_a<su3f>(e)
> is_exactly_a<su3f>(e)
> is_a<su3f>(e.op(0))
> is_a<color>(e)

The third one is the correct test.

  cout << is_a<su3f>(e.op(0)) << endl;
   // -> "1"

(The fourth test returns 0 because an f_abc is not a color object; only the
noncommutative t_a are.)


  / Physics is an algorithm
\/ http://www.uni-mainz.de/~bauec002/

More information about the GiNaC-list mailing list