Electromagnet lens