sx = [0 1; 1 0];

sy = [0 -i; i 0];

sz = [1 0; 0 -1];



s = zeros(2,2,3);

s(:,:,1) = sx;

s(:,:,2) = sy;

s(:,:,3) = sz;



xp = 1/sqrt(2)*[1 1]';

xm = 1/sqrt(2)*[1 -1]';

yp = 1/sqrt(2)*[1 j]';

ym = 1/sqrt(2)*[1 -j]';

zp = [1 0]';

zm = [0 1]';