A method for producing a semiconductor laser, the method comprising the following steps: - applying a multilayer structure on a semiconductor substrate, the layers of the multilayer structure extending parallel to a layer expansion plane defined by a surface of the semiconductor substrate, and the application of the multilayer structure including at least producing an active region. - removing material of the multilayer structure in at least two separate material removal areas, the material removal taking place essentially perpendicular to the layer expansion plane, thus forming a waveguide ridge (16, 16'). - generating an insulation layer on at least the material removal areas. - determining a two-dimensional discrete binary lateral structure (f(x,y)) in an optimization method while taking into consideration at least the desired properties of the three-dimensional laser mode, in particular the wavelength, the areas in which a lateral structural layer is applicable being divided into a uniform grid in the context of the optimization method and a two-dimensional start function pertaining to the grid cells being optimized for describing the lateral structure, the optimization taking place in a first area which is formed on the first 500 nm adjacent to the waveguide ridge (16, 16'), at least for setting the target wavelength, by structurization in a second area bordering the first area for setting a bracing in the multilayer structure and in a third area of structures further away from the waveguide ridge (16, 16') for the targeted suppression of undesired three-dimensional laser modes, zones (43, 43'') located on both sides of the waveguide ridge (16, 16') and bordering a front facet being formed free of structural elements in the second and third areas in order to not negatively influence the far field of the semiconductor laser via a lateral structure on this front facet. - applying a lateral structural layer made of a material which has a refractive index different to that of the surrounding semiconductor material at least in the area of the material removal areas, the structures (41 - 43, 41' - 43') of the lateral structural layer being formed in a masking and deposition process based on the optimized lateral structure (f(x,y)). - applying a multilayer structure on a semiconductor substrate, the layers of the multilayer structure extending parallel to a layer expansion plane defined by a surface of the semiconductor substrate, and the application of the multilayer structure including at least producing an active region. - removing material of the multilayer structure in at least two separate material removal areas, the material removal taking place essentially perpendicular to the layer expansion plane, thus forming a waveguide ridge (16, 16'). - generating an insulation layer on at least the material removal areas. - determining a two-dimensional discrete binary lateral structure (f(x,y)) in an optimization method while taking into consideration at least the desired properties of the three-dimensional laser mode, in particular the wavelength, the areas in which a lateral structural layer is applicable being divided into a uniform grid in the context of the optimization method and a two-dimensional start function pertaining to the grid cells being optimized for describing the lateral structure, the optimization taking place in a first area which is formed on the first 500 nm adjacent to the waveguide ridge (16, 16'), at least for setting the target wavelength, by structurization in a second area bordering the first area for setting a bracing in the multilayer structure and in a third area of structures further away from the waveguide ridge (16, 16') for the targeted suppression of undesired three-dimensional laser modes, zones (43, 43'') located on both sides of the waveguide ridge (16, 16') and bordering a front facet being formed free of structural elements in the second and third areas in order to not negatively influence the far field of the semiconductor laser via a lateral structure on this front facet. - applying a lateral structural layer made of a material which has a refractive index different to that of the surrounding semiconductor material at least in the area of the material removal areas, the structures (41 - 43, 41' - 43') of the lateral structural layer being formed in a masking and deposition process based on the optimized lateral structure (f(x,y)).