A semiconductor laser with an integrated attenuator on the same chip as
the laser. In some embodiments the attenuator is formed of the same
material as the laser, but without a grating in the attenuator. In some
embodiments the laser and attenuator are fabricated concurrently, with
the attenuator positioned at the front of the laser and differing from
the laser only in not having a grating and having a much smaller length.
Level of attenuation by the attenuator is adjustable based on drawing
photogenerated current from the attenuator.