Only with this, as the waves have different wavelengths, I guess there can't be any interference, we will only see the difraction pattern, the two functions of the form sin2(x)/x2, with the principal maximums separated a distance d. Am I right here?

Sort of. The diffraction pattern is visible "at infinity", which is in fact your case #3. I'll explain there.

1.- In the first one, the system is configured such that the slits are far away from the lens. Here, we can approximate the wave that arrives as a planar wave, and therefore the lens will perform the Fourier transform in the focal plane of the screen. The diffraction of the slits also performs the Fourier transform, so this configuration should lead to having only two bars of light in the screen, centered in the focus. Am I right?

Sort of. Your lens has a limited diameter, so if you place it far from the slits, it will capture only the central portion of the diffraction pattern, i.e. the top of the sinx/x function. In other words, you will loose the fringe pattern and reconstruct slits without fringes.

2.- The slits are in the focal plane on the lens, such that the lens is in the middle of slits-screen. Here, the same thing should happen, right? As the light comes from the focal plane, the lens must do the fourier transform with no extra things, and we should get the two bars, again both of them in the same line (center of the screen). Am I right here?

This will be somewhat different because you do the image of the slits at infinity, i.e. a blurry image at close distances. Depending on how close is the lens, you may only be taking the "no-fringe" portion of the diffraction pattern.

3.- The last one, I can't see... the lens is just behind the slits so the distance between slits and lens is 0.

That is exactly the typical *school* case. The diffraction pattern is, before the lens, *located at infinity*, or in other words, the fringes are defined as angles and not position ($\sin\theta/\theta$). The role of the lens is to bring these fringes at a finite distance (the focal length). You probably learned that a lens makes an image, initially located at infinity, located at the focal length. That's the same with the diffraction fringes.

Now, as the two slits are both close to the lens, you won't do an image of them. That means that you should not see separated slit images, but instead, you should see two superimposed diffraction patterns, centered at the same point.

The situation is that there is an incoming light wave that is transmitted through a lens. The thickness of the lens is chosen in the z-direction and the cross section of the lens is in the x,y-plane. A plane is defined at one edge of the lens at $z = z_1$ and another plane is defined at the other edge of the lens at $z = z_2$. We want to know the phase difference of the light between the moments that the light enters the plane at $z=z_1$ and the moment the light leaves the plane at $z = z_2$. In general the light will travel partly in the vacuum and partly in the medium of the lens. If the light would be incident exactly at $\Delta_0$ there would only be travel in the lens medium, but in all other situations part of the light path will be in the vacuum and the other part will be in the lens medium. The total difference in phase is equal to the contribution caused by the part in the lens plus the contribution caused by the part in the vacuum.

Let's assume the incoming light can be written as an amplitude function times an exponential, so: $A(r)e^{ikr}$. The phase has to do with the complex exponential, namely $kr$.

Let's make the discussion a bit general and let some light travel a distance between two planes. The electric and magnetic fields of the light oscillate with a period $T$ and a angular frequency $\omega$. The light has a certain wave length $\lambda$. If you look a the light at position $x = x_0$ and a position $x = x_0 + \lambda$ you don't see a difference due to the periodicity of the light. So, if the light travels a certain distance $r$ you need to subtract the wave length $\lambda$ as many times as you can and the difference that is left at the end is interesting for the difference in phase.

Let the light enter the first plane at position $r_1$ with a light phase $\phi_1$ and let the light hit the second plane at position $r_2$ with a light phase $\phi_2$. Then $mod(|r_2 - r_1|, \lambda)$ is the fraction of the period we need to shift. Also $\phi$ is just a number in the interval $\left[0, 2 \pi \right)$. The phase at position 2 is $\phi_2 = \phi_1 + mod(|r_2 - r_1|, \lambda) \cdot 2 \pi $. Thus: $\phi_2 - \phi_1 = mod(|r_2 - r_1|, \lambda) \cdot 2 \pi$. Let's put the phase in a complex exponential, because that is the formula for the light. $ e^{i(\phi_2 - \phi_1)} = e^{i( mod(|r_2 - r_1|, \lambda) \cdot 2 \pi)}$. The right hand side can be rewritten using the periodicity of the complex exponential. $ e^{i(\phi_2 - \phi_1)} = e^{i( (|r_2 - r_1|/ \lambda )\cdot 2 \pi)}$.

When light enters a medium with a different optical density, such as a lens, the wave length changes but not the frequency. $\lambda_{medium} = \lambda_{vacuum}/n$. The $\lambda$ used in the previous paragraph is $\lambda_{medium}$, so you can replace that $\lambda$ in the previous paragraph with $\lambda_{vacuum}/n$. In the formula's $k$ is the wave vector in vacuum.

The definition of the wave vector: $k = 2 \pi / \lambda_{vacuum}$ leads to $e^{i (\phi_2-\phi_1)} = e^{i k n |r_2 - r_1|}$. What we know now is that when you let some light of the form $A(r)e^{ikr}$ travel a distance $|r_2 - r_1|$ you can multiply with $e^{i k n|r_2 - r_1|}$ to get the correct phase. Let's call this factor $t$. So $t = e^{i k n|r_2 - r_1|}$.

Back to our set-up. The total distance between the two planes $z_2-z_1 = \Delta_0$. Distance travelled through the lens is $\Delta(x,y)$ and the distance travelled through the vacuum is $\Delta_0 - \Delta(x,y)$. $t$ is the factor we need to multiply our light formula with to get the correct phase after the light has travelled through the two planes.

In the vacuum $n=1$. $t$-factor due to vacuum part: $e^{i k \cdot 1 \cdot distance} = e^{i k \cdot (\Delta_0 - \Delta(x,y))}$.

$t$-factor due to lens part: $e^{i k n \cdot distance} = e^{i k n \cdot \Delta(x,y)}$

Total t-factor is: t = $e^{i k n \cdot \Delta(x,y)} \cdot e^{i k \cdot (\Delta_0 - \Delta(x,y))}$

$$t = e^{i k \Delta_0} e^{i k (n-1) \Delta(x,y)}$$

The resulting formula neglects the fact that the light actually bents due to the lens. We assumed that light travelled in a straight line when we said that the distance the light travels in the vacuum is equal to $\Delta_0 - \Delta(x,y)$ and the distance the light travels in the lens is equal to $\Delta(x,y)$. Because the light rays actually bent, the distances are an underestimation and the phase shift is in reality larger. The approximation becomes exact in the limit of an infinitely thin lens.

An application I can think of is that you can make a computer program to calculate interference patterns. For example define a lens with a certain $\Delta(x,y)$. Then calculate the phase difference for light rays incident at different coordinates $(x, y, z_1)$. Based on the phase differences you can work out what the interference pattern looks like for a lens with a certain $\Delta(x,y)$ function.

In practice, I think the phase of the light is only important in applications where interference plays a role. So you might want to use the formula to make an estimation of a phase shift and compare it with a different phase.

## Best Answer

The equations you write are not those of a focussing wave (I think you're missing an $i\,\pi$ in your exponent for the $x$ variation for $z>0$). There is no way for the wavefront curvature to change with $z$ in your equations, thus no focussing. You need to model the effect of diffraction on your wavefront.

The easiest way to model diffraction is to assume a Gaussian intensity variation in the input, instead of a plane wave as you have done. You simply have to have the spotsize large enough to model the beamwidth you are dealing with. Then you impart the thin lens phase mask so that the field at $z=0$ which is immediately to the right of the lens output has the $x$ variation:

$$E(x,\,0) = \exp\left(-\frac{x^2}{2\,\sigma^2}\right) \,\exp\left(i\frac{k\, x^2}{2\,f}\right)\tag{1}$$

One can model the effect of diffraction on a field variation like this by taking heed of the following formula for the propagation of a generalized Gaussian beam in a homogeneous medium:

$$E(x,\,z) = \frac{1}{\sqrt{z-z_0 + i\,z_R}}\, \exp\left(-i \,k\, \frac{x^2}{2 \,(z-z_0 + i\,z_R)}\right)\tag{2}$$

where $z_R$ is the Rayleigh length for the beam. So your task is to find $z_0$ and $z_R$ in (2) to match (1) and then you can use (2) to propagate the Gaussian beam.

Note that the above is not the exact scalar diffraction operator; it makes a paraxial approximation that the transverse component $k_x$ of the wavevector is small compared to $k$; alternatively, that the beam's numerical aperture is small (less than about 0.3, depending on the accuracy you need).

Otherwise, you need to calculate the exact diffraction integral, which I outline below.

Full Diffraction CalculationYou begin with the Helmholtz equation in a homogeneous medium $(\nabla^2 + k^2)\psi = 0$. If the field comprises only plane waves in the positive $z$ direction then we can represent the diffraction of any scalar field on any transverse (of the form $z=c$) plane by:

$$\begin{array}{lcl}\psi(x,y,z) &=& \frac{1}{2\pi}\int_{\mathbb{R}^2} \left[\exp\left(i \left(k_x x + k_y y\right)\right) \exp\left(i \left(\sqrt{k^2 - k_x^2-k_y^2}-k\right) z\right)\,\Psi(k_x,k_y)\right]{\rm d} k_x {\rm d} k_y\\ \Psi(k_x,k_y)&=&\frac{1}{2\pi}\int_{\mathbb{R}^2} \exp\left(-i \left(k_x u + k_y v\right)\right)\,\psi(x,y,0)\,{\rm d} u\, {\rm d} v\end{array}$$

To understand this, let's put carefully into words the algorithmic steps encoded in these two equations:

Here is a short, well tested Mathematica code of mine to implement the above. In the following $f$ is a square array of complex values of the input field, $d$ the axial ($z$) distance we wish to diffract the wave, $k$ the wavenumber and $Dx,\,Dy$ are the widths of the simulation domain in the $x$ and $y$ directions. It is easy to modify this code to cope with one transverse direction.

`Diffract[f_, d_, k_, Dx_, Dy_] /; If[MatrixQ[f], True, Message[Diffract::nnarg] False] := Module[{lenX, lenY, phase, mask, jx, jy}, ( lenX = Length[f]; lenY = Length[f[[1]]]; phase = Table[N[(jx - If[jx > lenX/2, lenX, 0])/Dx]^2 + N[(jy - If[jy > lenY/2, lenY, 0])/Dy]^2, {jx, 0, lenX - 1}, {jy, 0, lenY - 1}]; phase = k^2 - (4 Pi^2 phase); mask = Table[If[phase[[jx, jy]] < 0, 0, 1], {jx, 1, lenX}, {jy, 1, lenY}]; phase = Table[If[phase[[jx, jy]] < 0, 0, d (k - Sqrt[phase[[jx, jy]]])], {jx, 1, lenX}, {jy, 1, lenY}]; Return[InverseFourier[Fourier[f] Exp[-I phase] mask]]; );];`