Class function associated to any finite-dimensional group representation, defined as the trace of the representation matrices