Home > atphysics > LinearOptics > jmat.m

jmat

PURPOSE ^

JMAT - Computes antisymmetric Matrix [O 1; -1 0]

SYNOPSIS ^

function mat=jmat(dim)

DESCRIPTION ^

 JMAT - Computes antisymmetric Matrix [O 1; -1 0]
 
  INPUTS
    1. dim - 1,2,3 Dimension of the sqare matrix

  OUPUTS
    2. mat - Antisymmetric block Matrix [O 1; -1 0] 
 
  See also symplectify

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mat=jmat(dim)
0002 % JMAT - Computes antisymmetric Matrix [O 1; -1 0]
0003 %
0004 %  INPUTS
0005 %    1. dim - 1,2,3 Dimension of the sqare matrix
0006 %
0007 %  OUPUTS
0008 %    2. mat - Antisymmetric block Matrix [O 1; -1 0]
0009 %
0010 %  See also symplectify
0011 
0012 S2 = [0 1; -1 0];
0013 
0014 if(dim==1)
0015     mat=[0 1;-1 0];
0016 elseif(dim==2)
0017     mat = blkdiag(S2,S2);
0018 elseif(dim==3)
0019     mat = blkdiag(S2,S2,S2);
0020 else
0021     Error('Dim is 1, 2 or 3')
0022 end

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005