Laser: Basic concepts
                                  ECE 6358 - H. Q. Le Copyrights

1. Basic concepts and links to  PPT lectures

1.1 Coherence

A pure harmonic plane-wave signal:                 A (e^(i (k z   -ω t )))
where A is the amplitude. We can write: A=|A| (e^(i ϕ)), hence:
                                                      A (e^(i (k z   -ω t ))) =|A| (e^(i (k z   -ω t +ϕ )))  
We also call  | A |  absolute amplitude, and ϕ the phase (constant).
When we have many signals of the same frequency:
                                                     (∑_i)|(Subscript[A, i])| (e^(i (k z   -ω t +(Subscript[ϕ, i]) ))) 
Consider signals of the same amplitude and phase; as m (the number of photons) increases, the wave amplitude increases proportionally.

k=2 π  ; ω= 2 π  ; ϕ=2 π * 0.734  ;
Manipulate[
Plot[ Re[ (∑_(i=1)^m)(E^(I  (k  z -  ω  t + ϕ )))    ],{z,0,20}, PlotPoints->50,PlotRange->{-10,10}],
{t, 0,1},{m,1,10,1} ]

What if they DO NOT have the same phase? generally speaking, the phases tend to be random because as a source emits a photon, there is nothing that controls its phase. As m (the number of photons) increases, the wave amplitude does NOT increase proportionally; eventually it will increase statistically, but not like photons of the same phase.

k=2 π  ; ω= 2 π  ;  m=20  ;
Manipulate[ z=0  ;
ϕr=Table[Random[]*2 π,{p,1,m}]  ;
Plot[ Re[ (∑_(i=1)^m)(E^(I  (k  z -  ω  t + ϕr[[i]] )))    ],{t,0,20}, PlotPoints->50,PlotRange->{-10,10}]  , {p,1,20} ]

When lights are of random phases relative to each other, they are said to be incoherent with each other, and when they add, the signal is random in amplitude and phase.
Then the phases are coherent with each other, the amplitude add together to have a strength proportional to the number of signals.

1.2 Coherence in time and space

We see that the phase term add to expression that contains both space and time. We did an example for planewave, which means that the phase is coherent through out the entire plane.
Generally speaking, the emission is not plane wave, and hence, if the phases are random also in space, the beam also have random phase front and not a nice surface, but ragged.

1.2.1 Temporal coherence: Transformed-limited pulse

We have learnt from previous chapter that we can construct a pulse:
                        E(z,t)=∫a(ω) (e^(i (k[ω] z - ω t)))dω            
where a(ω) represents the spectral component. Such a pulse is called transform-limited pulse, because it satisfies the Fourier transform relation between the EM field and the spectral amplitude.
We know that for Fourier transform, the product of bandwidth  Δω  and pulse width Δt is at a minimum:
                                                                          Δω Δt ≥ 2 π 
Other non-transform-limited pulse has a much worse product:
                                                                         Δω Δt >> 2 π 
Transform-limited pulse gives us the shortest pulse with a minimal bandwidth required.

As an exercise, construct pulse with a random oor highly-varying phase function ϕ[ω]
                       E(z,t)=∫a(ω) (e^(i (k[ω] z - ω t+ϕ[ω])))dω

We will see that with a random or highly varying phase function ϕ[ω] (incoherent phase), the pulse width will be much larger than transform-limited pulse

1.2.2 Spatial coherence: diffraction-limited pulse

This is the spatial analogue of temporally transform limited pulse. Here, we construct the pulse for different spatial k-vector:
                        E(r,t)=∫a((OverHat[k])) (e^(i (k (OverHat[k]) · r - ω t)))d(OverHat[k]) =(e^(-i  ω t))∫a((OverHat[k])) (e^(i k (OverHat[k]) · r ))d(OverHat[k])  
We keep the wave cw (pure single frequency ω for simplicity), and hence the integral applies only over k-space. This is a Fourier-transform in space instead of time, and the same principle applies.
An example is Gaussian beam:
                                 E(r,t)=(e^(-i  ω t)) (e^(i  k z))(w/(  (Sqrt[2π])))∫(e^(-(1/4) (q^2) ((w^2)+i ((2 z)/( (Subscript[k, 1]))) ))) q  (Subscript[J, 0])[ q ρ]dq 
Or:                                E(r,t)     =((w  (Subscript[k, 1]))/(i ( z-i  (Subscript[k, 1]) (w^2)/2))) (e^(i  ((Subscript[k, 1]) z - ω t)))(e^(i (Subscript[k, 1])  (((x^2)+(y^2))/(2(z-i  (Subscript[k, 1]) (w^2)/2)))))
This is an example of diffraction-limited beam: the product of its beam waist and spread angle is the minimum allowed by diffraction. Note the smooth phase front. A spatially incoherent beam with a random, distorted phase front cannot be focused to a beam waist as small as shown below.

2. Stimulated emission

See PPT lecture

3. Optical Cavity, Fabry-Perot

3.1 Introduction

An optical cavity is a structure with boundary which admits a certain set of optical EM solutions, some are usually discrete

Example: waveguide is an optical cavity with one or 2 dimensional boundary in the direction lateral with respect to beam propagation. Planar waveguide is 1-dimensional. 2D planar waveguide is 2-dimensional. Fiber is also 2-dimensional.
What about boundary in the propagation direction?
Yes, there is a type of cavity with boundary perpendicular to the propagation direction.

Example: parallel mirrors

We often see 2 mirrors facing each other in parallel. What is the electromagnetic field between them? Below is the sketch of the problem. The two mirrors are perpendicular to the z-axis. Suppose the electromagnetic field is plane wave with only (Subscript[E, x]) component, (that means (Subscript[E, y]) and (Subscript[E, z]) are zero) as shown. And suppose it has a pure frequency ω. What is the EM field between the mirrors? 
The boundary condition at the mirror is that the (Subscript[E, x])=0 all the time.

Solution: The plane wave E field is:  E=(OverHat[x])  (Subscript[E, 0])    (e^(i  (k z -ω t ))) or  E=(OverHat[x])  (Subscript[E, 0]) (e^(i  (-k z -ω t ))). Let's choose the first mirror z=0, and the second z=L, where L is the distance between the 2 mirrors. The boundary conditions are  E[z=0]=0 and  E[z=L]=0? 
We can write the most general solution:
                                     E=(OverHat[x])  (a (e^(i  (k z -ω t )))  + b (e^(i  (-k z -ω t ))) ) 
                                      E=(OverHat[x])  (a (e^(i  k z ))  + b (e^(-i  k z )) ) (e^(-i  ω t )) 
where a and b are unknown. Given the boundary conditions
                                E[z=0]=(OverHat[x])  (a   + b  ) (e^(-i  ω t ))=0                                        (1)
and:                         E[z=L]=(OverHat[x])  (a (e^(i  k L ))  + b (e^(-i  k L )) ) (e^(-i  ω t ))=0                     (2)
From Eq. (1):                  (a   + b  ) =0      or               a  =- b 
Substitute in Eq. (2):
                            (OverHat[x])  a ( (e^(i  k L ))  -  (e^(-i  k L )) ) (e^(-i  ω t ))=0     
                                      (e^(i  k L ))  -  (e^(-i  k L )) =0               
                                             Sin[k L ]  =0 
                                               k L   =m π  where m is an integer
Hence, ONLY certain discrete frequencies are allowed in the cavity:
                                               (ω/c)   =((m π)/L)     or      ω =m ((c π)/L)  
                                               or    (Subscript[ν, m]) =m (c/(2 L))

3.2 S matrix method for optical cavity

3.2.1 introduction

We recall in other chapters that S matrix is a matrix that can be used to connect the optical EM solution from one point to another. Example, consider the following cavity

S1 connects the solution of the left-boundary of mirror 1 (M1) to its right-boundary. S2 connects that solution to that of M2 left-boundary, and so on for S3. The nice things about S matrix is that we just connect them together: S3.S2.S1 and thus, can connect one end to another without having to write over and over the middle solutions.
If a solution can be separable into a propagation solution, e. g. (e^(i (β z-ω t))) and a transverse solution, e. g. F[x,y], the S matrix has to deal only with (e^(i (+β z-ω t))) or (e^(i (-β z-ω t))), which makes it a 2nd rank matrix and very easy to handle.

3.2.2 Interface relation matrix

A mirror or a piece of optics in a cavity can be treated as a black box. We sometimes don't need to know what's in it. All we need to know is its S matrix. For example, a partially reflecting mirror can be characterised by 4 parameter: t1p, r1m, t1m, r1p (see discussion in class). Its S matrix is:

Solve[{(({{t1p}, {0}}))==(({{s11, s12}, {s21, s22}})).(({{1}, {r1m}})),
		       (({{r1p}, {1}}))==(({{s11, s12}, {s21, s22}})).(({{0}, {t1m}}))},{s11,s12,s21,s22}]

We can define a matrix:

Refl[r1p_,r1m_,t1p_,t1m_]:=(({{t1p-((r1m r1p)/t1m), (r1p/t1m)}, {-(r1m/t1m), (1/t1m)}}))

S1=Refl[r1p,r1m,t1p,t1m]

3.2.3 uniform segment matrix

If we have a uniform segment of length l with solution: (e^(i (±β z-ω t))), what is its S matrix? Obviously, with an input (e^(i (β z-ω t))) at z=0 (which is (({{1}, {0}}))), the solution at the other end is (e^(i β l ))(e^(i (β z-ω t))) (or  (({{(e^(i β l ))}, {0}}))) and similarly: (e^(i (-β z-ω t))) corresponds to solution (e^(-i β l ))(e^(i (-β z-ω t))). Thus, the S matrix is simply a diagonal: (({{(e^(i β l )), 0}, {0, (e^(-i β l ))}})).

3.3 Fabry-Perot cavity

The simple cavity of 2 mirrors with a free space in between is called Fabry-Perot. We can use the S matrix to find out what happens when we send a beam through a F-P cavity.

3.3.1 S matrix solution of a F-P cavity

We the total S to connect an input wave of the left side of an FP to its output wave on the right side.

S2=Refl[r2p,r2m,t2p,t2m]

The input wave is represented by (({{(e^(i β z)), (e^(-i β z))}})). (({{1}, {r}})) where we drop the term (e^(-i ω t)) for convenient, and the representing vector is just  (({{1}, {r}})). The output wave, by definition is (({{t}, {0}})). Remember that these are definitions of t and r. It's our job to find out what they are.

Solve[(({{t}, {0}}))==S2 . (({{(E^(I β l)), 0}, {0, (E^(-I β l))}})) . S1 . (({{1}, {r}})),{r,t}]

3.3.2 Transmission

The solutions are: Transmission
t->t1p t2p(((e^(i l β)) )/(1-(e^(2 i l β)) r1p r2m))
We can write a routine to calculate:

trans[M1_List,M2_List,l_,λ_,neff_]:=Module[{r2p,r2m,t2p,t2m, r1p,r1m,t1p,t1m,β},
		           {r2p,r2m,t2p,t2m}=M2;
		          {r1p,r1m,t1p,t1m}=M1;
		               β=10^4((2 π)/λ)  neff ;
		                 (((E^(I l β)) t1p t2p)/(1-(E^(2 I l β)) r1p r2m))      ];

Refl[ ((n-1)/(n+1)), ((1-n)/(n+1)),((2 )/(n+1)),((2 n)/(n+1))]

M1={((n-1)/(n+1)), ((1-n)/(n+1)),((2 )/(n+1)),((2 n)/(n+1))};
M2={((1-n)/(n+1)), ((n-1)/(n+1)),((2n )/(n+1)),((2 )/(n+1))};
l= 0.1 ; (* in cm  *)
λ= 1.5;
n= 2. ;
neff=2  ;
trans[M1,M2,l,λ,neff]

Notice that the transmission is complex
Discussion in class: what does it mean being complex?
Notice the solution: t->(((e^(i l β)) t1p t2p)/(1-(e^(2 i l β)) r1p r2m)) 
The numerator (e^(i l β)) t1p t2p has a phase term (e^(i l β)) that represents the fact that the output beam has gone through a phase shift (e^(i l β)). The denominator 1-(e^(2 i l β)) r1p r2m is most interesting when (e^(2 i l β ))= 1 or 2 i l β= m 2 π where m is an integer.

MirL[n_]:={((n-1)/(n+1)), ((1-n)/(n+1)),((2 )/(n+1)),((2 n)/(n+1))}  ;
MirR[n_]:={((1-n)/(n+1)), ((n-1)/(n+1)),((2n )/(n+1)),((2 )/(n+1))}  ;

Manipulate[  Plot[  Abs[trans[MirL[n],MirR[n],l,299.792458/f,n]]^2  ,{f,200.,205}
, PlotRange->{0,1}] ,{l,0.002,0.01},{n,1,4}]

The transmission has maxima at regular intervals: these are cavity resonances. They correspond to when the denominator  1-(e^(2 i l β)) r1p r2m  is at a minimum, which is when (e^(2 i l β))=1, if r1p and r2m are real positive. In general, if r1p and r2m have phases: r1p= |r1p|(e^(i (Subscript[ϕ, 1]))) and r2m= |r2m|(e^(i (Subscript[ϕ, 2]))), then the resonance occurs when:
(e^(2 i l β+(Subscript[ϕ, 1])+(Subscript[ϕ, 2 ])))=1.

Manipulate[ N[MirL[n]^2] ;
Plot[  {Abs[trans[MirL[n],MirR[n],l,299.792458/f,n]]^2  
, 1-Abs[trans[MirL[n],MirR[n],l,299.792458/f,n]]^2},{f,200.,205}
, PlotRange->{0,1}] ,{n,2,20},{l,0.0005,0.01}]

Question: calculate the free spectral range. What does it depend on?

3.3.3 Transmission as a function of cavity length: application as a spectrum analyzer

We see that by sweeping (tuning) the cavity length, we can sweep the filtered wavelength or the resonance frequency of the cavity: we can use it as a spectrum analyzer.

n=100 ;
Manipulate[Plot[   Abs[trans[MirL[n],MirR[n],l,299.792458/f,n]]^2   ,{f,200.1,200.3}
, PlotRange->{0,1}], {l,0.0005,0.000505}
   ]

The reason for the sweep is in the term:  1-(e^(2 i l β)) r1p r2m. The resonance frequency is given by:  l β= m π, or  l  ((2 π  (Subscript[n, eff]) f)/c) = m π  or f=m (c/(2 (Subscript[n, eff]) l )).
In the above, we see that FSR is given: Δf=(c/(2 (Subscript[n, eff]) l))
What is the inverse of FSR? ((2 (Subscript[n, eff]) l)/c)
Thus: ((d f)/f)=- ((d l)/l); and ((∂f)/(∂ l))=- m (c/(2 (Subscript[n, eff]) (l^2))). 
To appreciate how well it filters, look on log scale

l=0.05; n=200;
Plot[  Log[10., Abs[trans[MirL[n],MirR[n],l,299.792458/f,n]]^2]*10   ,{f,200.1,200.5}
, PlotRange->{-50,0}]

3.3.4 Concept of finesse

Suppose we have two F-P like this:

l=0.05; 
Plot[   {Abs[trans[MirL[50],MirR[50],l,299.792458/f,50]]^2
      	,Abs[trans[MirL[5],MirR[5],l,299.792458/f,5]]^2}
	  ,{f,200.1,200.7}, PlotStyle->{ {RGBColor[1.,0.,0], Thickness[0.005]}
			                        ,{RGBColor[0.,0.,1], Thickness[0.005]}}
, PlotRange->{0,1}]

Which one is "coarser"? which one is "finer"?
That's why we have a concept: finesse. Roughly, finesse is approximately the ratio of the FSR vs. the FWHM of the transmission peak. Let's look at the transmission term again:
t->(((e^(i l β)) t1p t2p)/(1-(e^(2 i l β)) r1p r2m))
Let's put a few typical terms in such as cavity with loss: β=(Subscript[β, 0]) + i α/2

l=.;

(((E^(I l β)) t1p t2p)/(1-(E^(2 I l β)) r1p r2m)) /. β->(Subscript[β, 0]) + I α/2

(((E^(Expand[I l (((I α)/2)+(Subscript[β, 0]))])) t1p t2p)/(1-(E^(Expand[2 I l (((I α)/2)+(Subscript[β, 0]))])) r1p r2m))

Simplify[Expand[(1-(E^(2 I l (Subscript[β, 0])-l α)) r1p r2m)*(1-(E^(-2 I l (Subscript[β, 0])-l α)) r1p r2m)]]

ExpToTrig[(rs^2)-Expand[(E^(-l 2 I (Subscript[β, 0]))) (1+(E^(4 I l (Subscript[β, 0]))))]rs+1]

We can write the transmission: T=(((e^(-l α)) (((|t1p t2p|))^2))/(1+(e^(-2 l α)) (r1p^2) (r2m^2)-2  r1p r2m (e^(-l α))cos(2 l (Subscript[β, 0]))))
or    T=(((e^(-l α)) (((|t1p t2p|))^2))/(1+((Subscript[r, s])^2)-2 (Subscript[r, s])cos(l (Subscript[β, 0])))) where (Subscript[r, s])≡r1p r2m (e^(-l α)) 
(Subscript[T, max]) =(((e^(-l α)) (((|t1p t2p|))^2))/(((1-  (Subscript[r, s])))^(2 ))) We can express T in terms of (Subscript[T, max]): 
T= (((e^(-l α)) (((|t1p t2p|))^2))/(1+((Subscript[r, s])^2)-2 (Subscript[r, s])cos(2 l (Subscript[β, 0])))) = (((e^(-l α)) (((|t1p t2p|))^2))/(1+((Subscript[r, s])^2)-2 (Subscript[r, s])+2 (Subscript[r, s])(1-cos(2 l (Subscript[β, 0]))) ))=(((e^(-l α)) (((|t1p t2p|))^2))/((((1-  (Subscript[r, s])))^2)+4 (Subscript[r, s])((Sin[l (Subscript[β, 0])])^(2 ))))   
   =(((e^(-l α)) (((|t1p t2p|))^2))/(((1-  (Subscript[r, s])))^2))(1/(1+((4 (Subscript[r, s]))/(((1-  (Subscript[r, s])))^2))((Sin[l (Subscript[β, 0])])^(2 ))))=  ((Subscript[T, max ])/(1+((4 (Subscript[r, s]))/(((1-  (Subscript[r, s])))^2))((Sin[l (Subscript[β, 0])])^(2 )) ))
What is the FWHM of a resonance peak? 
Near a maximum: Sin[l (Subscript[β, 0])]= Sin[ 2π l (Subscript[n, eff]) (((Subscript[f, m])+Δf)/c)]
			       =Sin[ 2 π l (Subscript[n, eff]) ((Δf)/c)]≈ 2 π l (Subscript[n, eff]) ((Δf)/c)
T=((Subscript[T, max ])/(1+((4 (Subscript[r, s]))/(((1-  (Subscript[r, s])))^2))((Sin[l (Subscript[β, 0])])^(2 )))) ≈ ((Subscript[T, max])/(1+((4 (Subscript[r, s]))/(((1-  (Subscript[r, s])))^2))(((2 π l (Subscript[n, eff]) ((Δf)/c)))^(2   )))) =((Subscript[T, max])/(1+(((((2(Sqrt[ (Subscript[r, s])]))/((1-  (Subscript[r, s]))))2 π l (Subscript[n, eff]) ((Δf)/c)))^(2   ))))  
The above expression gives an asymptotic Lorentzian lineshape: (1/(1+(((2 π Δf/Ω))^2)))
where  Ω= (c/(2 l (Subscript[n, eff]))) ((1-  (Subscript[r, s]))/(Sqrt[ (Subscript[r, s]) ]))
T drops to half of its max at: ((2 (Sqrt[(Subscript[r, s])]))/((1-  (Subscript[r, s]))))2 π l (Subscript[n, eff]) ((Δf)/c)=1  , or Δf =(( (1-(Subscript[r, s])))/(  2 π (Sqrt[(Subscript[r, s ])]))) (c/(2 l (Subscript[n, eff]))). Remember earlier that the FSR is:  (c/(2 l (Subscript[n, eff]))), thus we obtain the relation: 
2 Δf =(( (1-(Subscript[r, s])))/(  π (Sqrt[(Subscript[r, s ])]))) FSR. Indeed, the expression (( π (Sqrt[(Subscript[r, s])]))/(1-(Subscript[r, s]))) is the finesse of the cavity. Thus, the higher the mirror reflection and the lower the internal loss are, the higher the finesse is, and we have the relation:
                                                 FWHM ≈ ((Free spectral range)/finesse) (good for high finesse)

3.3.5 Phase shift near resonance

A very common effect for many optical systems or cavities is that the light-wave solution often experiences a rapid phase shift near resonance. Indeed, we can see this effect for a F-P cavity by looking at just the phase of the optical wave:

l=0.05; n=200;allp={} ;
Plot[   Arg[trans[MirL[n],MirR[n],l,299.792458/f,n]]/Pi  ,{f,200.1,200.4}
, PlotRange->{-1,1}]

One way to visualize this is to look at the phasor diagram above. The phase angle of the vector 1-(Subscript[r, s]) (e^(i β l ))varies the "fastest" from minus to plus near its minimum.

3.4 Optical field inside a F-P cavity, photon lifetime, Q-factor.

3.4.1 Optical field

If we have a 98% reflection mirror, by itself, we expect a 98%-reflected beam for an incident beam of magnitude 1. But if there is another mirror behind it to form a F-P cavity, we sometime sees nearly 0% return. What happens? What is the field inside the cavity? Use S-matrix to solve the problem.

Let's set up two identical mirror as follow: (Subscript[r, p])=(Subscript[r, m]) = 99%; (Subscript[t, p])=(Subscript[t, m])=(Sqrt[1-0.99^2]). What does the field inside look like at maximum transmission and minimum transmission?

The solution inside: (({{A}, {B}}))=S1.(({{1}, {r}})) where r is the F-P reflectivity (not just from one mirror). From the above, 
r->(((e^(2 i l β)) r1p r2m r1m-r1m-(e^(2 i l β)) r2m t1m t1p)/((e^(2 i l β)) r1p r2m-1)) =r1m +r2m(e^(2 i l β))  t1m (t1p/(1-(e^(2 i l β)) r1p r2m  ))

Refl[(Subscript[r, m]),(Subscript[r, m]),(Subscript[t, m]),(Subscript[t, m])].(({{1}, {rFP}}))

FullSimplify[(({{-((Subscript[r, m]^2)/(Subscript[t, m]))+((rFP (Subscript[r, m]))/(Subscript[t, m]))+(Subscript[t, m])}, {(rFP/(Subscript[t, m]))-((Subscript[r, m])/(Subscript[t, m]))}}))/. rFP-> (Subscript[r, m]) + (Subscript[r, m])(E^(2 I l β)) (((Subscript[t, m])^2)/(1-(E^(2 I l β)) ((Subscript[r, m])^2)))]

The field inside the cavity is:

(({{(E^(I β z)), (E^(-I β z))}})).(({{((Subscript[t, m])/(1-(E^(2 I l β)) (Subscript[r, m]^2)))}, {(((E^(2 I l β)) (Subscript[r, m]) (Subscript[t, m]))/(1-(E^(2 I l β)) (Subscript[r, m]^2)))}}))

This term  ((Subscript[t, m])/(1-(e^(2 i l β)) (Subscript[r, m]^2)))= (1/(Subscript[t, m])) (((Subscript[t, m])^2)/(1-(e^(2 i l β)) (Subscript[r, m]^2)))= (1/(Subscript[t, m])) (Subscript[t, FP]). At maximum, (Subscript[t, FP]) ~ 1, while (1/(Subscript[t, m])) is very large (it's a high-reflectivity, low-transmission mirror). In terms of intensity, the field inside is: (1/((Subscript[t, m])^2)) = (1/(1-((Subscript[r, m])^2))). Thus, if ((Subscript[r, m])^2) ~ 98%, the field inside is ~ 50 times larger than the outside field. Let's plot to see:

FieldofFP[M1_List,M2_List,l_,λ_,neff_, z_]:=Module[{r2p,r2m,t2p,t2m, r1p,r1m,t1p,t1m,β, tFP, rFP},
		           {r2p,r2m,t2p,t2m}=M2;
		          {r1p,r1m,t1p,t1m}=M1;
		               β=10^42(π/λ)  ;
		             tFP=    (((E^(I l β)) t1p t2p)/(1-(E^(2 I l β)) r1p r2m))   ;
		             rFP=  r1m +r2m(E^(2 I l β))  (( t1m t1p)/(1-(E^(2 I l β)) r1p r2m))  ;
	   (* Print[	Refl[r1p,r1m,t1p,t1m] . (({{1}, {rFP}}))  ] ;  *)
	               If[z<=0, (E^(I β z)) + rFP (E^(-I β z)) ,
			               If[ z<=l ,({(E^(I β z)),(E^(-I β z))}. Refl[r1p,r1m,t1p,t1m] . (({{1}, {rFP}}))) [[1]],
				                tFP  (E^(I β z)) ] ]
	             ];

M1={0.99,0.99,(Sqrt[1-0.99^2]), (Sqrt[1-0.99^2])} ;
M2=M1; l=0.1; λ=1.51; neff=1. ; 
Plot[Abs[trans[M1,M2,l,λ,neff ]]^2,{λ,1.50,1.5005}, PlotRange->{0,1}]

Vary the wavelength below and observe

Manipulate[
	Plot[Re[FieldofFP[M1,M2,l,λ,neff, z]]^2,{z,-0.001,0.001},
		PlotRange->{0,200 },AspectRatio-> 0.25,
	PlotStyle->{{RGBColor[0,0,1], Thickness[0.005]}} ]
,{λ,1.50035,1.5004}]

How can the field inside a F-P be larger than the input field? Where does the energy come from? Is it a violation of energy conservation?

3.4.2 Photon lifetime

We see that the response of a F-P cannot be instantaneous. Resonance occurs only by building up the internal field which takes time. Likewise, it takes time for the photons to decay by internal loss or leak out of the mirror.
One way to understand the time-dependent behavior of a system is to see its impulse response: if we send an impulse into an F-P, what will happen? First let's look at this intuitive way.
If the pulse is short compared with the cavity length, there is no interference etc. We just have the time sequence:
The first pulse comes out: (Subscript[t, 1p]) (Subscript[t, 2p]) (e^(i β l))
the second pulse: (Subscript[t, 1p]) (Subscript[t, 2p]) (Subscript[r, 2m]) (Subscript[r, 1p]) (e^(3 i β l)) at a time delayed by: 2 l (Subscript[n, g ])/c where (Subscript[n, g]) is the group velocity. And so on. The amplitude of any subsequent pulse compared with the previous is:  (Subscript[r, 2m]) (Subscript[r, 1p]) (e^(-α l)): This is an exponential decay behavior. If we describe it as: (e^(-t/τ)), then the ratio of pulse energy of two subsequent pulses separated by a time T is: 
 ((e^(-(t+T)/τ))/(e^(-t/τ)))=(e^(-T/τ)) = η Thus: τ = - T/Log[η]. In this case,  T = 2 l (Subscript[n, g ])/c =1/(Subscript[ν, R]) and η = (Subscript[r, 2m]) (Subscript[r, 1p]) (e^(-α l)). Usually, one defined: 
Log[η]=Log[((Subscript[r, 2m])^2) ((Subscript[r, 1p])^2)] -2α l= -2l  ((1/(2l))Log[(1/((Subscript[R, 2m]) (Subscript[R, 1p])))]+α) = - 2l ((Subscript[α, m]) +α)   
where (Subscript[α, m]) ≡ (1/(2l))Log[(1/((Subscript[R, 2m]) (Subscript[R, 1p])))] where (Subscript[R, 2m]),(Subscript[R, 1p]) are the mirror reflectivity in terms of intensity, is called the distributed mirror loss. The decay time is: 
τ=- (T/(Log[η]))=((2 l (Subscript[n, g]))/c) (1/(2 l ((Subscript[α, m]) +α))) = ((Subscript[n, g])/(c ((Subscript[α, m]) +α))) =((Subscript[n, g])/(c (Subscript[α, total]))) : this is called the cavity lifetime. We have a concept: the lifetime of photons in the F-P cavity. It doesn't mean the lifetime of a photon, but the only the decay rate of the photon population.
The lower the loss the slower the photon population loss is.

F-P as an LTI system: We can treat the F-P as an LTI (linear time-invariant) system. The two response functions of interest are the transmission and reflection.
Express these function in terms of optical frequency f.

For transmission: t[f] = (((e^(i l (Subscript[β, 0])-((l α)/2))) t1p t2p)/(1-(e^(2i l (Subscript[β, 0])-l α)) r1p r2m))

(((E^(I l (Subscript[β, 0])-((l α)/2))) t1p t2p)/(1-(E^(2I l (Subscript[β, 0])-l α)) r1p r2m)) /. (Subscript[β, 0])-> ((2 π (Subscript[n, eff]) f)/c)

(((E^(((2 I f l π (Subscript[n, eff]))/c)-((l α)/2))) t1p t2p)/(1-(E^(((4 I f l π (Subscript[n, eff]))/c)-l α)) r1p r2m))/. ((2 I f l π (Subscript[n, eff]))/c)-> I (( f π )/(Subscript[ν, R]))
      /. ((4 I f l π (Subscript[n, eff]))/c)->2  I (( f π )/(Subscript[ν, R]))

For reflection: r[f] =  r1m +r2m(e^(2 i l β))  (( t1m t1p)/(1-(e^(2 i l β)) r1p r2m))

r1m +r2m(E^(2 I l β))  (( t1m t1p)/(1-(E^(2 I l β)) r1p r2m))
		/. (E^(2 I l β))-> (E^(((2 I f π)/(Subscript[ν, R]))-l α))

Let f be very near a resonance of order m, we can write: f= m (Subscript[ν, R]) + ν where ν is a small deviation from the resonance frequency m (Subscript[ν, R]). Approximate the response functions near the resonance in terms of ν and up to the first order of ν for resonance term to obtain Lorentzian-like response.

For transmission function: (((e^(((i f π)/(Subscript[ν, R]))-((l α)/2))) t1p t2p)/(1-(e^(((2 i f π)/(Subscript[ν, R]))-l α)) r1p r2m))

(((E^(((I f π)/(Subscript[ν, R]))-((l α)/2))) t1p t2p)/(1-(E^(((2 I f π)/(Subscript[ν, R]))-l α)) r1p r2m)) /. f-> m (Subscript[ν, R]) + ν

(((E^(Expand[((I π (ν+m (Subscript[ν, R])))/(Subscript[ν, R]))]-((l α)/2))) t1p t2p)/(1-(E^(Expand[((2 I π (ν+m (Subscript[ν, R])))/(Subscript[ν, R]))]-l α)) r1p r2m))

(((E^(I π m-((l α)/2)+((I π ν)/(Subscript[ν, R])))) t1p t2p)/(1-(E^(2 I π m-l α+((2 I π ν)/(Subscript[ν, R])))) r1p r2m)) 
		/. (E^(I π m-((l α)/2)+((I π ν)/(Subscript[ν, R]))))-> ((( -1))^m)(E^(-((l α)/2)+((I π ν)/(Subscript[ν, R]))))
/. (E^(2 I π m-l α+((2 I π ν)/(Subscript[ν, R])))) -> (E^(-l α+((2 I π ν)/(Subscript[ν, R]))))

Expand to zeroth order for the numerator (slow variation) and first order for denominator (resonance)

(((((-1))^m) (E^(((I π ν)/(Subscript[ν, R]))-((l α)/2))) t1p t2p)/(1-(E^(((2 I π ν)/(Subscript[ν, R]))-l α)) r1p r2m)) 
		/. (E^(((I π ν)/(Subscript[ν, R]))-((l α)/2)))-> (E^(-((l α)/2)))
   
/. (E^(((2 I π ν)/(Subscript[ν, R]))-l α))-> (1+ ((2 I π ν)/(Subscript[ν, R])))(E^(-l α))

(((((-1))^m) (E^(-((l α)/2))) t1p t2p)/(1-(E^(-l α)) r1p r2m (((2 I π ν)/(Subscript[ν, R]))+1)))/. (E^(-l α)) r1p r2m-> (Subscript[r, s])

(((((-1))^m) (E^(-((l α)/2))) t1p t2p)/(Expand[1-(Subscript[r, s]) (((2 I π ν)/(Subscript[ν, R]))+1)]))

An approximation of the transmission function is thus:
(((((-1))^m) (e^(-((l α)/2))) t1p t2p)/(-((2 i π ν (Subscript[r, s]))/(Subscript[ν, R]))-(Subscript[r, s])+1))= (((-1))^m) (((e^(-((l α)/2))) t1p t2p)/(1-(Subscript[r, s]))) ((1/(1-((2  (Subscript[r, s]))/(1-(Subscript[r, s])))i π (ν/(Subscript[ν, R])))))

For the reflection:

r1m+(((E^(((2 I f π)/(Subscript[ν, R]))-l α)) r2m t1m t1p)/(1-(E^(((2 I f π)/(Subscript[ν, R]))-l α)) r1p r2m)) /. (E^(((2 I f π)/(Subscript[ν, R]))-l α))->(E^(-l α+((2 I π ν)/(Subscript[ν, R]))))

We can rewrite:  
Reflection:  
           r1m+(((e^(-l α)) r2m t1m t1p )/(1-(Subscript[r, s]) (((2 i π ν)/(Subscript[ν, R]))+1))) = r1m+(((e^(-l α)) r2m t1m t1p)/(1-(Subscript[r, s])))((1/(1-((2  (Subscript[r, s]))/(1-(Subscript[r, s])))i π (ν/(Subscript[ν, R])))))    
Transmission:
          (((-1))^m) (((e^(-((l α)/2))) t1p t2p)/(1-(Subscript[r, s]))) ((1/(1-((2  (Subscript[r, s]))/(1-(Subscript[r, s])))i π (ν/(Subscript[ν, R])))))  
They both can be expressed in terms of a common function: 
  H[a, (Subscript[ν, R]), ν]= (1/(1-ai π (ν/(Subscript[ν, R]))));  where a=((2  (Subscript[r, s]))/(1-(Subscript[r, s])))
Transmission:  (((-1))^m) (((e^(-((l α)/2))) t1p t2p)/(1-(Subscript[r, s]))) H[((2  (Subscript[r, s]))/(1-(Subscript[r, s]))), (Subscript[ν, R]), ν] 
Reflection: r1m+(((e^(-l α)) r2m t1m t1p)/(1-(Subscript[r, s])))H[((2  (Subscript[r, s]))/(1-(Subscript[r, s]))), (Subscript[ν, R]), ν]

What are their impulse responses? (with the approximation, Hint: Use the known Fourier transform)

We need to find:
(∫_□^□)H[((2  (Subscript[r, s]))/(1-(Subscript[r, s]))), (Subscript[ν, R]), ν] (e^(-i 2 π ν t)) dν  
Use the Fourier transform theorem: (∫_(-∞)^∞)((e^(-i 2 π ν t))/(Γ-i 2 π ν))dν = (e^(-Γ t)) Θ[t] 
where Θ[t] is the step function, we have: 
((2 (Subscript[ν, R]))/a)(∫_□^□)(1/(((1-(Subscript[r, s]))/( (Subscript[r, s])))(Subscript[ν, R])-2 i π ν))(e^(-i 2 π ν t)) dν =((2 (Subscript[ν, R]))/a) (e^(-((1-(Subscript[r, s]))/( (Subscript[r, s])))(Subscript[ν, R])  t)) Θ[t]
The impulse response of transmission is: (((-1))^m)  (((e^(-((l α)/2))) t1p t2p)/(1-(Subscript[r, s]))) ((1-(Subscript[r, s]))/( (Subscript[r, s])))(Subscript[ν, R]) (e^(-((1-(Subscript[r, s]))/( (Subscript[r, s])))(Subscript[ν, R])  t)) Θ[t]  
or: (((-1))^m)  (((e^(-((l α)/2))) t1p t2p)/(Subscript[r, s])) (Subscript[ν, R]) (e^(-((1-(Subscript[r, s]))/( (Subscript[r, s])))(Subscript[ν, R])  t)) Θ[t]:  This is an exponential decay with a time constant ~  (1/(Subscript[ν, R])) (( (Subscript[r, s]))/((1-(Subscript[r, s]))))= T (( (Subscript[r, s]))/((1-(Subscript[r, s])))) .  We will notice that for the high-resonance condition for this approx.: -Log[(Subscript[r, s])] ~-Log[1-(1-(Subscript[r, s]))]  ~(1-(Subscript[r, s])) (since (Subscript[r, s]) ~ 1).
Recalling that whenever we have a Lorentzian lineshape: (1/((ω^2)+(Γ^2))), the half-width of the resonance is related to the lifetime of the process. Indeed, the term
                                              ((1-(Subscript[r, s]))/( (Subscript[r, s])))(Subscript[ν, R])~ π((Subscript[r, s])/(π  (Sqrt[(Subscript[r, s])]))) ((Subscript[ν, R]) (Sqrt[(Subscript[r, s])])) ~π((Subscript[ν, R ])/F) = 2 π Δf
is related to the resonance full width half max Δf. We can say that the cavity lifetime:
                                              (Subscript[τ, cavity]) ~ (1/(2 π Δf))

(∫_0^∞)(E^(-Γ t)) (E^(I 2 π ν t))\[DifferentialD]t

PROJECT: Suppose we have a Gaussian pulse (e^(i ((Subscript[k, 0]) z  - (Subscript[ω, 0]) t))) (e^(-((((z-t (Subscript[v, g])))^2)/((τ^2) (Subscript[v, g]^2))))). How does the transmission vary as a function of (Subscript[ω, 0]) and pulse duration τ? What does the pulse output look like for different pulse duration τ, given that (Subscript[ω, 0]) is at an F-P resonance ? (you can use both analytical and numerical method; for simplicity, let (Subscript[n, eff]) =(Subscript[n, g]) =1)

3.4.3 Q factor

The field and energy density inside is so much more than the outside because the device (F-P) accumulates energy. The photons in resonance are trapped inside the cavity. They build up until the loss rate is equal to the build-up rate and a balance is reached. Any device "stores" energy (for example, resonance RLC circuit) can be described with Q-factor (Q stands for quality): (2 π) x ratio of stored energy/energy loss per oscillation cycle (at steady state). This concept can be also applied here. 
Stored energy= ∝(((|E|))^2)
Energy loss per cycle: ∝(((|E|))^2) ((c (Subscript[α, total]))/((Subscript[n, g]) f))
So, Q is:   ((2 π f (Subscript[n, g]))/(c (Subscript[α, total]))).
If we recall that the cavity lifetime is also expressed as:
                                                    (Subscript[τ, cavity]) ~ (1/(2 π Δf))
or the loss rate per cycle is: (1/((Subscript[τ, cavity]) f))= ((2 π Δf)/f), we have another way to express Q:
                                             Q= (f/(Δf)) =(f/(Subscript[ν, R])) Finesse  
which shows that Q is indeed proportional to the cavity finesse, which make sense: the higher the finesse, or the sharper the resonance is, the higher the quality (Q factor) of the resonance device must be. Note that the optical frequency f is much >> (Subscript[ν, R]) for typical F-P (length >> wavelength), Q is much larger than the finesse value. One way to think is this: the longer the F-P cavity, the more standing waves it can pack in, the higher the energy is stored, and the higher the Q factor.

4. Fabry-Perot with a gain segment: FP laser

4.1 Solving the F-P transmission and reflection with gain.

4.1.1 S matrix method

S1=Refl[rp1,rm1,tp1,tm1]

S2=Refl[rp2,rm2,tp2,tm2]

Sm=(({{(E^(I β l)), 0}, {0, (E^(-I β l))}}))

We can set up an equation to ask: can there be a solution that light comes out on both end WITHOUT any input light?

(({{T2}, {0}}))==S2 . Sm . S1 . (({{0}, {T1}}))

(({{T2}, {0}}))==FullSimplify[(({{T1 ((((E^(-I l β)) rp2)/(tm1 tm2))+(((E^(I l β)) rp1 (tp2-((rm2 rp2)/tm2)))/tm1))}, {T1 (((E^(-I l β))/(tm1 tm2))-(((E^(I l β)) rm2 rp1)/(tm1 tm2)))}}))]

4.1.2 Condition for self-oscillation

In order for the above equation to have non-trivial equation, we must have:

(E^(-I l β))-(E^(I l β)) rm2 rp1==0 /. β->(Subscript[β, R])-I (((OverHat[g])/2))

(E^(Expand[-I l ((Subscript[β, R])-((I (OverHat[g]))/2))]))-(E^(Expand[I l ((Subscript[β, R])-((I (OverHat[g]))/2))])) rm2 rp1==0

Simplify[%]

(E^(l ((OverHat[g])+2 I (Subscript[β, R])))) rm2 rp1-1==0

This is the key equation:    (e^(l ((OverHat[g])+2 i (Subscript[β, R])))) rm2 rp1-1==0 that must be satisfied to have a solution in which a F-P generates light on its own.

(E^(l (OverHat[g]))) (E^( 2 I (Subscript[β, R]) l)) ==(1/( rm2 rp1)) /. rm2->rm2 (E^(I (Subscript[ϕ, 2 ]))) /. rp1->rp1 (E^(I (Subscript[ϕ, 1 ])))

(E^(l (OverHat[g])))==(1/(rm2 rp1))

PowerExpand[Log[(E^(l (OverHat[g])))]]==Log[(1/(rm2 rp1))]

Solve[l (OverHat[g])==log((1/(rm2 rp1))) /. (OverHat[g])->g-α,{g}]

The amplitude of the equation gives the gain required:

{{g->Simplify[-((-l α-log((1/(rm2 rp1))))/l)]}}

The phase of the equation gives the resonance frequency required: 
(e^(2 i l (Subscript[β, R])+i (Subscript[ϕ, 1])+i (Subscript[ϕ, 2])))==1  
Or: 2 l (Subscript[β, R])+ (Subscript[ϕ, 1])+ (Subscript[ϕ, 2]) = 2 m π, where m is an integer. 
To summarize: in order for a cavity to oscillate (to lase), we must have 2 conditions: 
GAIN condition: g=α+(1/l)log((1/((Subscript[| r, 2m])  (Subscript[r, 1p]) |))) 
FREQUENCY (or round-trip phase) condition: 2 l (Subscript[β, R])+ (Subscript[ϕ, 1])+ (Subscript[ϕ, 2]) = 2 m π

4.2 Threshold

Why does a laser have a threshold?
We can model the gain (absorption loss) behavior of an optical medium this way:
                                              g=(Subscript[G, 0])[λ] (n-(Subscript[n, 0])) for n near (Subscript[n, 0])
where n is the carrier population density (electrons in conduction band or holes in valence band in a semiconductor, or the excited atoms density in a gas, or a condensed medium, etc.). (Subscript[n, 0]) is called the transparency point. With this, what does the gain equation tell us?
                                      (Subscript[G, 0])[λ] (n-(Subscript[n, 0])) = α+(1/l)log((1/((Subscript[| r, 2m])  (Subscript[r, 1p]) |)))

Solve[(Subscript[G, 0])[λ] (n-n0) == α+(1/l)log((1/((Subscript[r, 2m])  (Subscript[r, 1p])))),{n}]

n->-((-l α-log((1/((Subscript[r, 2 m]) (Subscript[r, p]))))-l n0 (Subscript[G, 0])(λ))/(l (Subscript[G, 0])(λ))) = (Subscript[n, 0])+(1/((Subscript[G, 0])[λ]))(α+(1/l)log((1/((Subscript[r, 2m])  (Subscript[r, 1p]))))) 
Since the population density n is a function of input pump power, which we can model in the most simplistic way: 
                                                   n= (J/(e d ))
 we see that there is a minimum current required for the gain to reach threshold:
                                     (J/(e d))= (Subscript[n, 0])+(1/((Subscript[G, 0])[λ]))(α+(1/l)log((1/((Subscript[r, 2m])  (Subscript[r, 1p]))))) 
 or:                                (Subscript[J, th])=e d ((Subscript[n, 0])+(1/((Subscript[G, 0])[λ]))(α+(1/l)log((1/((Subscript[r, 2m])  (Subscript[r, 1p]))))) ) 
  So: we must turn on the current up to a certain point when (Subscript[J, th]) is reached.
  Do we see something odd in this equation?

4.3 Cavity loss spectrum

What wavelength does a laser lase?
 Suppose   g=α+(1/l)log((1/(| (Subscript[r, 2m])  (Subscript[r, 1p]) |))) a constant?

Cavity mode loss and rate equation

Homework on laser