  Photonic spatial quantum states are a subject of great interest for
applications in quantum communication. One important challenge has been how to
dynamically generate these states using only fiber-optical components. Here we
propose and experimentally demonstrate an all-fiber system that can dynamically
switch between any general transverse spatial qubit state based on linearly
polarized modes. Our platform is based on a fast optical switch based on a
Sagnac interferometer combined with a photonic lantern and few-mode optical
fibers. We show switching times between spatial modes on the order of 5 ns and
demonstrate the applicability of our scheme for quantum technologies by
demonstrating a measurement-device-independent (MDI) quantum random number
generator based on our platform. We run the generator continuously over 15
hours, acquiring over 13.46 Gbits of random numbers, of which we ensure that at
least 60.52% are private, following the MDI protocol. Our results show the use
of photonic lanterns to dynamically create spatial modes using only fiber
components, which due to their robustness and integration capabilities, have
important consequences for photonic classical and quantum information
processing.
