example_hes.m 756 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
function example_hes
  % QSN package example
  %
  % Higher excitation subspace example
  %

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Construct hes chain and display
  disp('=======================================================================');
  disp('Constructing an XX chain of length 5');
  N = 5;
  chain = qsn.QSN('chain', N)
  key ();

  % Hes chain
  disp('Constructing higher excitation subspace 0:3 for chain');
  J = chain.H;
  Z = zeros(N,N);
  M = ceil(N/2);
  hes = qsn.QSN('hes',{J J Z},0:M)
  key ();

  % Plot hes chain
  disp('Plotting higher excitation subspace 0:3 for chain')
  figure(1);
  clf;
  hes.plot ();
  key ();

  function key ()
    disp('Press key to continue');
    pause;
  end

end