One way is to use symmetric function theory:
sage: s = SFASchur(QQ); p = SFAPower(QQ)
sage: s(p([2,2])).coefficient([3,1])
-1
This says that the value of the irreducible character indexed by the
partition (3,1) is -1 when evaluated on a conjugacy class of size (2,2).
Cheers,
Jason
I posted a patch about a month ago that constructs irreducible matrix
representations of the symmetric group.
http://trac.sagemath.org/sage_trac/ticket/5878
So you could also do it with that functionality (once the patch is
reviewed!). This is not the fastest way to do what you want, though,
since it computes the entire matrix, and you're interested only in its
trace. I think that it would not be too hard to adapted the code to
return only the trace without computing the entire matrix.
Take care,
Franco
--