A mode-locked laser comprising: - an insulating substrate, - a rib extending over the substrate in an extension direction, - a resonant cavity for at least one electromagnetic wave, the cavity being defined in the substrate, in line with the rib, - a wave guide defined in the substrate, extending in a guiding direction (X'), the rib comprising a lower layer (C 2), a plurality of intermediate layers (C 3 to C N-1) and an upper layer (C N), stacked in a stacking direction orthogonal to the direction of extent, the cavity being able to accommodate a plurality of resonance modes equidistant in frequency, the cavity comprising a plurality of trenches formed in at least one of the faces of the cavity, the trenches extending perpendicularly to the direction of extent, each trench having parameters, the parameters being: - a width (W n) of the trench, measured in a transverse direction orthogonal to the direction of extent and to the direction of stacking, - a thickness (E n) of the trench, measured in the direction of extent, - a depth (P n) of the trench, measured in the stacking direction, and - a dimension (a n) of a spacing separating each trench from an adjacent trench, the dimension (a n) being measured in the direction of extent, at least one of the parameters of the trenches varying along the direction of extent according to a law of variation, the law of variation being a symmetrical polynomial function of order greater than or equal to four of a position of the trench along the direction of extent. - an insulating substrate, - a rib extending over the substrate in an extension direction, - a resonant cavity for at least one electromagnetic wave, the cavity being defined in the substrate, in line with the rib, - a wave guide defined in the substrate, extending in a guiding direction (X'), the rib comprising a lower layer (C 2), a plurality of intermediate layers (C 3 to C N-1) and an upper layer (C N), stacked in a stacking direction orthogonal to the direction of extent, the cavity being able to accommodate a plurality of resonance modes equidistant in frequency, the cavity comprising a plurality of trenches formed in at least one of the faces of the cavity, the trenches extending perpendicularly to the direction of extent, each trench having parameters, the parameters being: the rib comprising a lower layer (C 2), a plurality of intermediate layers (C 3 to C N-1) and an upper layer (C N), stacked in a stacking direction orthogonal to the direction of extent, the cavity being able to accommodate a plurality of resonance modes equidistant in frequency, the cavity comprising a plurality of trenches formed in at least one of the faces of the cavity, the trenches extending perpendicularly to the direction of extent, each trench having parameters, the parameters being: - a width (W n) of the trench, measured in a transverse direction orthogonal to the direction of extent and to the direction of stacking, - a thickness (E n) of the trench, measured in the direction of extent, - a depth (P n) of the trench, measured in the stacking direction, and - a dimension (a n) of a spacing separating each trench from an adjacent trench, the dimension (a n) being measured in the direction of extent, at least one of the parameters of the trenches varying along the direction of extent according to a law of variation, the law of variation being a symmetrical polynomial function of order greater than or equal to four of a position of the trench along the direction of extent. at least one of the parameters of the trenches varying along the direction of extent according to a law of variation, the law of variation being a symmetrical polynomial function of order greater than or equal to four of a position of the trench along the direction of extent.