A method of adapting optical properties of a continuous body arranged in a resonator cavity and comprising a nonlinear optical material to light of two different wavelengths passing through the continuous body along an optical axis, the continuous body having a total length along the optical axis, the method comprising:
- adjusting a spatially constant temperature in a first region of the continuous body, the first region comprising the nonlinear optical material and extending over at least 20% of the total length of the continuous body along the optical axis;
- and
- adjusting a first temperature gradient along the optical axis in a second region of the continuous body, the first temperature gradient starting from the spatially constant temperature in the first region, and the second region neighboring the first region on a first side of the first region and extending over at least 10% of the total length of the continuous body along the optical axis.