Quantum rectifier in a one-dimensional photonic channel