Truncation of Zeros

The contract (and some other functions) of the QSpace library may remove the sectors whose reduced matrix elements (elements of .data{..}) are all zeros. For example, consider the following case.

[F,Z,S,I] = getLocalSpace( 'FermionS', 'Acharge', 'SU2spin', 'NC',1);
M1 = I.E; M1.info.itags = { 's00', 's00*'};
M2 = I.E; M2.info.itags = { 's01', 's01*'};
A = getIdentity(M1,2,M2,2, 'A01*',[1 3 2]);
contract(A, '!2*',{M1, '!1',{M2, '!1',A}})

A =
    Q: 6x [2 2] having 'A,SU2',      { A01, A01* }   
 data: 2-D double (784 bytes)       10 x 10 => 16 x 16

    1. 1x1        | 1x1       [ -1 0 ; -2 0 ]          1.
    2. 2x2        | 2x2       [ -1 0 ; -1 1 ]  32 B        {1.414}
    3. 3x3        | 1x1       [  0 1 ; -1 1 ]  72 B        
    4. 1x1        | 3x3       [ -1 0 ;  0 0 ]          1.    {1.732}
    5. 2x2        | 2x2       [  0 1 ;  0 0 ]  32 B        {1.414}
    6. 1x1        | 1x1       [  1 0 ;  0 0 ]          1.

This is the normal contraction of the identity tensors. The result acts on 16-dimensional space of two spinful fermionic sites.

What happens if we replace one sector of A with all-zero reduced matrix elements?

A.data{1} = zeros(size(A.data{1}));
contract(A, '!2*',{M1, '!1',{M2, '!1',A}});
A =
    Q: 5x [2 2] having 'A,SU2',      { A01, A01* }   
 data: 2-D double (672 bytes)       9 x 9 => 15 x 15

    1. 2x2        | 2x2       [ -1 0 ; -2 0 ]  32 B        {1.414}
    2. 3x3        | 1x1       [ -1 0 ; -1 1 ]  72 B        
    3. 1x1        | 3x3       [  0 1 ; -1 1 ]          1.  {1.732}
    4. 2x2        | 2x2       [ -1 0 ;  0 0 ]  32 B      {1.414}
    5. 1x1        | 1x1       [  0 1 ;  0 0 ]          1.
    

Then we have the sector [-2 0] is missing, and the result acts on 15-dimensional space.

It is an intended feature rather than a bug. When contract tensors over the tensor network, the all-zero sectors in the constituent tensors do not contribute to the result. So the truncation of such all-zero sectors yields better computational efficiency.

However, when we consider the Hamiltonian in effective basis, the Hamiltonian may have the sectors of all zero matrix elements, and such sectors should be kept. All the energy eigenvalues, whether zero or finite, have meaning! For this, we should enforce to keep all-zero sectors. One trick is to add the identity operator, multiplied by very small number smaller than double precision (e.g., \(10^{-30}\)), to the Hamiltonian. Such small number should not change the physical results, but prevents unwanted truncation.