Singular Value Decomposition

We can perform the singular value decomposition (SVD) of QSpace objects, by using MEX function svdQS. The first input to svdQSis a QSpace object whose legs are all in. Indeed, this notion of decomposing all-in tensor is consistent with the diagrammatic expresssion of the Schmidt decomposition.

And the second input is the leg indices. The corresponding legs are to be the legs of the third output Vd for right singular vectors. When non-Abelian symmetry is used, it is allowed to choose only one or \(r-1\) indices, where \(r\) is the rank of the first input. To "split off" different number of legs (to be associated with Vd), we need to fuse the legs by using the isometry generated by getIdentity; then perform the SVD; then split the legs by appling the conjugate of the iseometry used to fuse the legs.

For example, consider an isometry:

[S,I] = getLocalSpace( 'Spin',1/2);
E1 = I.E; E1.info.itags = { 's00', 's00*'};
E2 = I.E; E2.info.itags = { 's01', 's01*'};
A = getIdentity(E1,2,E2,2,'A01*',[1 3 2]);

We need to flip the second leg to perform the SVD.

I0 = getIdentity(A,2, '-0');
AI = contract(A, '!1',I0, '!2*',[1 3 2])

Then use the svdQS.

[U,S,Vd] = svdQS(AI,1);

As mentioned above, the direct outputs from MEX functions are in the form of struct variables, not as QSpace objects. So we need to wrap them up.

U = QSpace(U);

U =
    Q: 2x [1 1 1] having 'A,SU2',      { s00*, A01, s01 }   
 data: 3-D double (224 bytes)      1 x 2 x 1 => 2 x 4 x 2

    1. 1x1x1      | 2x1x2       [ 1 ; 0 ; 1 ]      0.7071
    2. 1x1x1      | 2x3x2       [ 1 ; 2 ; 1 ]       1.225
S = QSpace(S)
S =
    Q: 1x [1 1] having 'A,SU2',      { s00, s00 }   
 data: 2-D double (112 bytes)      1 x 1 => 2 x 2

    1. 1x1      | 2x2       [ 1 ; 1 ]      -1.414  {1.414}
Vd = QSpace(Vd)
Vd =
    Q: 1x [1 1] having 'A,SU2',      { s00*, s00 }   
 data: 2-D double (112 bytes)      1 x 1 => 2 x 2

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

The first leg (incoming) of AI is associated with the second leg (incoming) of Vd. And the singular value tensor S is all-in.