Identifying measures on non-abelian groups and modules by their moments via reduction to a local problem