An atomic coilgun: using pulsed magnetic fields to slow a supersonic beam