A semiconductor optical amplifier comprises a semiconductor member having a plurality of flat edge faces, at least one waveguide with an input and an output on the semiconductor member, at last part of the waveguide being formed of active semiconductor material and the input and the output to the waveguide being located on the same or adjacent edge faces of the member.