1. An all-optical logic gate comprising: a linear optical section receiving at least two input wave fields X and Y, and linearly combining said inputs to produce an intermediary wave field output U; and at least one non-linear phase-erasing optical section that comprises an optically pumped amplifying medium for receiving said intermediary wave field output U of said linear optical section and for receiving a probe beam at a same wavelength as the intermediary wave field output U and producing a final output wave field V; wherein a complex amplitude of said final output wave field V depends solely on an amplitude of said intermediary wave field output U; wherein said at least two input wave fields X and Y and said final output wave field V of said all optical gate defined as complex two-valued logical alphabet that may be assigned the logic values True and False; and said final output wave field V of said gate is a known result of a Boolean logic function of said inputs.