Photon sorting, efficient bell measurements, and a deterministic controlled-Z gate using a passive two-level nonlinearity.