Magnet
Rare earth (lanthanoid) elements have a partially occupied "f" electron shell (which can accommodate up to 14 electrons). The spin of these electrons can be aligned, resulting in very strong magnetic fields, and therefore, these elements are used in compact high-strength magnets where their higher price is not a concern. The most common types of rare-earth magnets are samarium-cobalt and neodymium-iron-boron (NIB) magnets.
Tungsten
Quenched (martensitic) tungsten steel (approx. 5.5% to 7.0% W with 0.5% to 0.7% C) was used for making hard permanent magnets, due to its high remanence and coercivity, as noted by John Hopkinson (1849 - 1898) as early as 1886. The magnetic properties of a metal or an alloy are very sensitive to microstructure. For example, while the element tungsten is not ferromagnetic (but iron is), when present in steel in these proportions, it stabilizes the martensite phase, which has an enhanced ferromagnetism, as compared to the ferrite (iron) phase, due to its greater resistance to magnetic domain wall motion.