Optimized phase switching using a single-atom nonlinearity | Synapse