  We present a gradient-based algorithm to design general 1D grating couplers
without any human input from start to finish, including a choice of initial
condition. We show that we can reliably design efficient couplers to have
multiple functionalities in different geometries, including conventional
couplers for single-polarization and single-wavelength operation,
polarization-insensitive couplers, and wavelength-demultiplexing couplers. In
particular, we design a fiber-to-chip blazed grating with under 0.2 dB
insertion loss that requires a single etch to fabricate and no back-reflector.
