Magnetic switch traps quantum information carriers in one dimension