For a given set of quadrupoles, generate and return reciprocals

def gen_reciprocals(self, quadrupoles):
        """For a given set of quadrupoles, generate and return reciprocals
        """
        reciprocals = quadrupoles[:, ::-1].copy()
        reciprocals[:, 0:2] = np.sort(reciprocals[:, 0:2], axis=1)
        reciprocals[:, 2:4] = np.sort(reciprocals[:, 2:4], axis=1)
        return reciprocals