% Hamiltinian matrix: real time-dependent matrix
function H=HH(t);
global n
idim=n;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%     Pauli matrices      %%%%%%%%%
  sig1 = [[0 1]; [1 0]];
  sig2 = [[0 -i]; [i 0]];
  sig3 = [[1 0]; [0 -1]];
% Parameters of the problem
  w0=5;   V0 = 1/2;
%%   Fig 1a
  ep=0;  del=1;   TT= 10;
%%   Fig 1b
%    ep=1/10; del=1/10;   TT= 5;
%%   Fig 2a
%   ep=1/2; del=1;   TT= 5;
%%   Fig 2b
%   ep=2; del=5;    TT= 1;
%% %%%%%%%%%%%%%%%  
  w = w0+ep*cos(del*t);
% Rosen-Zener model
  Vt=V0/cosh(1*t/TT);
  if (idim ==2)
     H = w*sig1 + Vt*sig3  
  else
      idim2=idim/2;
      Z2 =zeros(idim2);  Z1 =eye(idim2);  
      for k = 1:idim2-1;
        Z2(k,k+1)= 1;   Z2(k+1,k)=1;
      end
      H = Vt*kron(Z2,sig1)+ w*kron(Z1,sig3) ;  
  end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
