Highly nonlocal optical nonlinearities in atoms trapped near a waveguide