Rank-2 Tensors

Rank-2 tensors are of the simplest type. (Quick exercise: Why not rank-1?) They are scalar in terms of Clebsch-Gordan coefficients and there is no (outer) multiplicity of symmetry sectors. And their reduced matrix elements form matrices.

So the QSpace library enables to treat rank-2 QSpace objects, in a way that usual matrices are treated by MATLAB built-in functions.

Z.'  % transpose
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.
Z'  % Hermitian conjugate
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.
Z' - Z  % Z is Hermitian
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 ]           0.
    2. 1x1      | 2x2         [  0 1 ;  0 1 ]           0.  {1.414}
    3. 1x1      | 1x1         [  1 0 ;  1 0 ]           0.
Z * I.E  % matrix multiplication as contraction
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.

As in the case of permute explained above, MATLAB can execute different functions depending on the type of inputs. That is, there are several QSpace functions that override the MATLAB built-in functions.

This simplification also works for some rank-3 tensors (whose .info.otype is set as 'operator'').

F  % Hermitian conjugate, the result is particle creation operators
ans =
    Q: 2x [2 2 2] having 'A,SU2',     operator,   { , *, }   
 data: 3-D double (224 bytes)       2 x 2 x 1 => 3 x 3 x 2

    1. 1x1x1      | 2x1x2      [ 0 1 ; -1 0 ; -1 1 ]         -1.414
    2. 1x1x1      | 1x2x2      [ 1 0 ;  0 1 ; -1 1 ]         -1.414

However, it is advisable to use permute and contract in general, to avoid any mistake.