Access Subspaces

We can select part of symmetry sectors, by using getsub.

I.E

ans =
    Q: 3x [2 2] having 'A,SU2',     { , * }   
 data: 2-D double (336 bytes)       3 x 3 => 4 x 4

    1. 1x1      | 1x1         [ -1 0 ; -1 0 ]           1.
    2. 1x1      | 2x2         [  0 1 ;  0 1 ]           1.  {-1.414}
    3. 1x1      | 1x1         [  1 0 ;  1 0 ]           1.
getsub(I.E,2)  % select the second sector 
ans =
    Q: 1x [2 2] having 'A,SU2',     { , * }   
 data: 2-D double (112 bytes)       1 x 1 => 2 x 2

    1. 1x1      | 2x2         [ 0 1 ; 0 1 ]           1.  {-1.414}
getsub(I.E,[1 3])  % select the first and third sectors 
ans =
    Q: 2x [2 2] having 'A,SU2',     { , * }   
 data: 2-D double (224 bytes)       2 x 2 => 2 x 2

    1. 1x1      | 1x1         [ -1 0 ; -1 0 ]           1.
    1. 1x1      | 1x1         [  1 0 ;  1 0 ]           1.

To choose the sectors of specific quantum numbers, we can combine getsub, find, and ismember (the latter two are MATLAB built-ins.)

getsub(I.E,find(ismember(I.E.Q{1},[0 1],'rows'))) % choose [0 1] sector 

ans =
    Q: 1x [2 2] having 'A,SU2',     { , * }   
 data: 2-D double (112 bytes)       1 x 1 => 2 x 2

    1. 1x1      | 2x2         [ 0 1 ; 0 1 ]           1.  {1.414}

It can be done also with all and bsxfun.

getsub(I.E,find(all(bsxfun(@eq,I.E.Q{1},[0 1]),2))) % the same 

ans =
    Q: 1x [2 2] having 'A,SU2',     { , * }   
 data: 2-D double (112 bytes)       1 x 1 => 2 x 2

    1. 1x1      | 2x2         [ 0 1 ; 0 1 ]           1.  {1.414}