Traces of pseudo-differential operators on compact and Hausdorff groups