an optical modulator comprises a first waveguide layer and a barrier layer , and a quantum well layer sandwiched between the first waveguide layer and the barrier layer , where the quantum well layer has a graded composition that varies the bandgap energy of the quantum well layer between a minimum bandgap energy and the bandgap energy of at least one of the first waveguide layer and the barrier layer .