<p>Wavelength multiplex transmission is realized in which the temperature dependency-of an EDFA is compensated for in relation to the wavelengths which are used. A first and a second long-period grating which have different periods from each other are formed in an optical fiber, ensuring that the peak wavelength of a waveform representing a optical transmission loss characteristic of the first long-period grating side is located on the shorter wavelength side than a transmission band and a peak wavelength of a waveform representing a optical transmission loss characteristic of the second long-period grating side is located on the longer wavelength side within the transmission band. The waveforms representing the optical transmission loss characteristics of the respective long-period gratings shift depending on the temperature, a loss deviation characteristic of the first long-period grating allows a optical transmission loss value on the shorter wavelength side than the transmission band to increase as the temperature increases so that a large gain deviation characteristic of an optical amplifier is compensated for, a loss deviation characteristic of the second long-period grating compensates for a residual gain deviation characteristic on the longer wavelength side within the transmission band, whereby the temperature dependent gain characteristic of the optical amplifier is compensated for within the transmission band.</p>