Similar Items: Energetic formulation of the subgroup commutativity degree