% angles of paddles of polarization controller
Q1 = 0 + pi/4; % angle of paddle 1
Q2 = 0; % angle of paddle 2
Q3 = 0 - pi/4; % angle of paddle 3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp('initial Jones vector')
E = [rand()*exp(1i*pi* rand()); rand()*exp(1i*pi* rand())]
disp('first polarizer')
E = PolarizerLinear(0) * E
disp('rotation of polarization')
E = PolarizationController(...
    pi/2, Q1,...% QWL
    pi, Q2,...  % HWL
    pi/2, Q3... % QWL
    ) * E
disp('second polarizer')
E = PolarizerLinear(pi / 4) * E
E1 =  ReflectionIsotropicSurface(0, 1550, 1, 0.2-16i, 0.5e6, 1) * E
E2 =  TransmittionIsotropicSurface(0, 1550, 1, 0.2-16i, 0.5e6, 1) * E
initial Jones vector

E =

   0.6516 + 0.0734i
  -0.8309 + 0.1748i

first polarizer

E =

   0.6516 + 0.0734i
   0.0000 + 0.0000i

rotation of polarization

E =

  -0.0000 + 0.0000i
   0.6516 + 0.0734i

second polarizer

E =

   0.3258 + 0.0367i
   0.3258 + 0.0367i


E1 =

   0.3273 - 0.0041i
  -0.3273 + 0.0041i


E2 =

     0
     0