Returns a dict of magnetic species and the magnitude of
        their associated magmoms. Will return a set if there are
        multiple magmoms per species.

        :return: dict of magnetic species and magmoms

def magnetic_species_and_magmoms(self):
        """
        Returns a dict of magnetic species and the magnitude of
        their associated magmoms. Will return a set if there are
        multiple magmoms per species.

        :return: dict of magnetic species and magmoms
        """

        structure = self.get_ferromagnetic_structure()

        magtypes = {
            str(site.specie): set()
            for site in structure
            if site.properties["magmom"] != 0
        }

        for site in structure:
            if site.properties["magmom"] != 0:
                magtypes[str(site.specie)].add(site.properties["magmom"])

        for sp, magmoms in magtypes.items():
            if len(magmoms) == 1:
                magtypes[sp] = magmoms.pop()
            else:
                magtypes[sp] = sorted(list(magmoms))

        return magtypes