A laser and optical amplifier waveguide device with a plurality of layers that supports a single lowest-order optical mode with gain while higher order modes radiate and have a net loss. The arrayed waveguide-embedded optical circuit according to the present invention comprises a waveguide, a groove formed across the waveguide and two or more spot-size transformer pairs whose members face each other across the groove. Examples of heat sources from which heat can be transferred from include, for example, fluids and surfaces.