In optics, the term soliton is used to refer to any optical field that does not change during propagation because of a delicate balance between nonlinear and linear effects in the medium. There are two main kinds of solitons: spatial solitons: the nonlinear effect can balance the diffraction. The electromagnetic field can change the refractive index of the medium while propagating, thus creating a structure similar to a graded-index fibre.