Simplified helper function for projective measurements