Symplectic relationship

mjf 2006.06.26

Contents

Symplectic relationship

M'*S*M = S Where S is:

S = [0 1 0 0 ; -1 0 0 0 ; 0 0 0 1; 0 0 -1 0]
S =

     0     1     0     0
    -1     0     0     0
     0     0     0     1
     0     0    -1     0

Create a matrix of symbols

syms a b c d e f g h i j k l m n o p real
M=[a b c d; e f g h; i j k l; m n o p]
 
M =
 
[ a, b, c, d]
[ e, f, g, h]
[ i, j, k, l]
[ m, n, o, p]
 
 

S*M flips rows and signs:

S*M
 
ans =
 
[  e,  f,  g,  h]
[ -a, -b, -c, -d]
[  m,  n,  o,  p]
[ -i, -j, -k, -l]
 
 

Full matrix multiply

A = M'*S*M
 
A =
 
[                0, -e*b+a*f-m*j+i*n, -e*c+a*g-m*k+i*o, -e*d+a*h-m*l+i*p]
[ -a*f+e*b-i*n+m*j,                0, -f*c+b*g-n*k+j*o, -f*d+b*h-n*l+j*p]
[ -a*g+e*c-i*o+m*k, -b*g+f*c-j*o+n*k,                0, -g*d+c*h-o*l+k*p]
[ -a*h+e*d-i*p+m*l, -b*h+f*d-j*p+n*l, -c*h+g*d-k*p+o*l,                0]
 
 

A must equal S. Below the diagonal is negative of above the diagonal. So, there are 6 equations left to be solved:

disp('A(1,2) = 1:');
disp(A(1,2));

disp('A(1,3) = 0:')
disp(A(1,3))

disp('A(1,4) = 0:')
disp(A(1,4))

disp('A(2,3) = 0:')
disp(A(2,3))

disp('A(2,4) = 0:')
disp(A(2,4))

disp('A(3,4) = 1:')
disp(A(3,4))
A(1,2) = 1:
-e*b+a*f-m*j+i*n
 
A(1,3) = 0:
-e*c+a*g-m*k+i*o
 
A(1,4) = 0:
-e*d+a*h-m*l+i*p
 
A(2,3) = 0:
-f*c+b*g-n*k+j*o
 
A(2,4) = 0:
-f*d+b*h-n*l+j*p
 
A(3,4) = 1:
-g*d+c*h-o*l+k*p
 

Example with a thin lens quad

Set up the quad matrix

syms qk ql real
Q = [1 0 0 0; -qk*sin(qk*ql) 1 0 0; 0 0 1 0; 0 0 qk*sinh(qk*ql) 1]
 
Q =
 
[              1,              0,              0,              0]
[ -qk*sin(qk*ql),              1,              0,              0]
[              0,              0,              1,              0]
[              0,              0, qk*sinh(qk*ql),              1]
 
 

example multiplication

S*Q

Q'*S*Q
 
ans =
 
[ -qk*sin(qk*ql),              1,              0,              0]
[             -1,              0,              0,              0]
[              0,              0, qk*sinh(qk*ql),              1]
[              0,              0,             -1,              0]
 
 
 
ans =
 
[  0,  1,  0,  0]
[ -1,  0,  0,  0]
[  0,  0,  0,  1]
[  0,  0, -1,  0]