Fast switching magnet for heavy ion beam separation