close all;clear all;clc; % Define Quartions with specific designations % without designation: quartions=perms([1,2,3,4]) q1to4=[1 2 3 4;2 3 4 1;3 4 1 2;4 1 2 3]; % Right-handed Spin=+1 q5to8=[1 4 3 2;2 1 4 3;3 2 1 4;4 3 2 1]; % Left-handed Spin=-1 q9to12=[1 2 4 3;2 3 1 4;3 4 2 1;4 1 3 2]; % Right flip left Spin=0.5 q13to16=[1 4 2 3;2 1 3 4;3 2 4 1;4 3 1 2]; % Left flip right Spin=0.5 q17to20=[1 3 4 2;2 4 1 3;3 1 2 4;4 2 3 1]; % Flip right flip Spin=0.5 q21to24=[1 3 2 4;2 4 3 1;3 1 4 2;4 2 1 3]; % Flip left flip Spin=0.5 quartions=[q1to4;q5to8;q9to12;q13to16;q17to20;q21to24]; % Define vectors and colours of the four spatial possibilities pangles=[0,1,0,90;1,0,0,90;0,1,0,-90;1,0,0,-90]; cols=[218/255 6/255 9/255;255/255 222/255 89/255;0/255 191/255 99/255;56/255 182/255 255/255]; % Four possibility colours RGB (red, yellow, green, blue) figure('units','normalized','outerposition',[0 0 1 1]) hold on xo=0; for qn=1:8 % E.g. show quartions 1 through 8 origin=[xo,0,0]; if mod(qn,4)==0 xo=xo+2;end % Make a gap between anti characters quartion=quartions(qn,:); for n=1:length(quartion)*1;nmod=mod(n-1,4)+1;p=quartion(nmod); unitArrow3d(origin,pangles(p,1:3),pangles(p,4),cols(p,:)); % Show unit spatial possibility unitArrow3d(origin,[1 0 0],180,[0.5 0.5 0.5]); % Show unit time label=['Q',num2str(qn)]; text(origin(1),origin(2),.5,label,'Interpreter','tex','color','white','FontSize',8); origin(3)=origin(3)-1;end xo=xo+1.5; end axis equal axis auto view([30 20]) camroll(0) set(gca,'visible','off') set(gca,'xtick',[]) set(gcf, 'Color', 'k'); % Set figure background to black set(gcf, 'Renderer', 'painters'); exportgraphics(gcf,'vectorfig.pdf','ContentType','vector','BackgroundColor','black') return % Function to draw colour-coded unit possibilities; % a ball at origin with extending cylindrical shaft and cone function unitArrow3d(origin,direction,rotation,colourRGB) a=(pi/180)*(-90:10:60);z=0.05*sin(a);y=0.05*cos(a);x=a*0; z=[z 0.75 0.75 1];y=[y 0.025 0.05 0];x=[x 0 0 0]; a=0:pi/16:33/16*pi;xm=sin(a)';ym=cos(a)';x=xm*y;y=ym*y;zm=xm./xm;z=zm*z; x=x+origin(1);y=y+origin(2);z=z+origin(3); unitArrow3d=surf(x,y,z,'FaceColor',colourRGB,'EdgeColor','none'); rotate(unitArrow3d,direction,rotation,origin); end