def get_magmom_string(structure):
    """
    Based on a POSCAR, returns the string required for the MAGMOM
    setting in the INCAR. Initializes transition metals with 6.0
    bohr magneton and all others with 0.5.

    Args:
        structure (Structure): Pymatgen Structure object

    Returns:
        string with INCAR setting for MAGMOM according to mat2d
        database calculations
    """
    magmoms, considered = [], []
    for s in structure.sites:
        if s.specie not in considered:
            amount = int(structure.composition[s.specie])
            if s.specie.is_transition_metal:
                magmoms.append('{}*6.0'.format(amount))
            else:
                magmoms.append('{}*0.5'.format(amount))
            considered.append(s.specie)
    return ' '.join(magmoms)