  Artificial Intelligence (AI) demands large data flows within datacenters,
heavily relying on multicasting data transfers. As AI models scale, the
requirement for high-bandwidth and low-latency networking compounds. The common
use of electrical packet switching faces limitations due to
optical-electrical-optical conversion bottlenecks. Optical switches, while
bandwidth-agnostic and low-latency, suffer from having only unicast or
non-scalable multicasting capability. This paper introduces an optical
switching technique addressing this challenge. Our approach enables arbitrarily
programmable simultaneous unicast and multicast connectivity, eliminating the
need for optical splitters that hinder scalability due to optical power loss.
We use phase modulation in multiple layers, tailored to implement any multicast
connectivity map. Phase modulation also enables wavelength selectivity on top
of spatial selectivity, resulting in an optical switch that implements
space-wavelength routing. We conducted simulations and experiments to validate
our approach. Our results affirm the concept's feasibility, effectiveness, and
scalability, as a multicasting switch by experimentally demonstrating 16
spatial ports using 2 wavelength channels. Numerically, 64 spatial ports with 4
wavelength channels each were simulated, with approximately constant efficiency
(< 3 dB) as ports and wavelength channels scale.
