Skip to main content
. 2021 Jul 7;118(28):e2015851118. doi: 10.1073/pnas.2015851118

Algorithm 3:

Return t-SVDMII under M, ρ to meet energy constraint

INPUT: A, M a multiple of unitary matrix; desired energy γ(0,1].
1: Compute t-SVDM of A.
2: Concatenate ((S^j,j,i).2) for all i,j into a vector v.
3: vsort(v,descend).
4: Let w be the vector of cumulative sums: i.e., wk=i=1kvi
5: Find the first index J such that wJ/S^F2>γ.
6: Define τvJ.
7: for i=1,,n do
8: Set ρi as number of singular values for A^:,:,i greater or equal to τ.
9: Keep only the m×ρiU^:,1:ρi,i and G^ρS^1:ρi,1:ρi,iV^:,1:ρi,iH.
End for