Can a magnet be tuned to attract only to one other magnet?

Such things are called programmable magnets or correlated magnets. They have a sequence of alternating polarities of N and S, which will only strongly attract magnets with the opposite sequence:

N S S N S N N S N S S S N
S N N S N S S N S N N N S 

But as Michael Brown's answer says, there is only one kind of magnetic field, and it will repel and attract all other magnetic fields; you have to use spatial coding with this magnetic field to obtain these correlated magnet pairs.

EDIT: And looking at wbeaty's answer, with electromagnets you could use temporal coding, too. If an electromagnet was driven by an alternating current with an irregular pulse sequence, then it would only attract/repel magnets driven by the same irregular pulse sequence. I don't know whether anybody has thought of/patented/tested this idea. But I don't see why it shouldn't work.


No, there is no sense in which you can "tune" a magnet. A material is either magnetic or it's not, and if it's a magnet then it is attracted/repelled by all other magnets. You can make electromagnets which can be switched on or off, but when it is on it acts like any other magnet.

EDIT: Peter Shor's answer is a neat trick. I had assumed you were talking about a individual magnets. If you have an assembly of magnets you can arrange them in a tricky way as Peter shows. Maybe this fits into your definition of "tuning."


Yes, it's trivial to "tune" a magnet. Of course this only applies to AC electromagnets. Driven synchronously, they'd either attract or repel each other depending on the phase relationship of the driving supply. Shunt-wound AC/DC motors, when run using AC, are a common example.

But if you mean "bar magnets," then no. Permanent magnets are essentially DC, and lack an operating frequency.

Hmmm. If you had a rapidly-spinning permanent magnet in free fall vacuum conditions, you could either attract or repel it using an electromagnet where the AC drive was synchronized to the rotation frequency.