Linear algebra API#

Kronecker and partial-trace kernels shared by the structured operators.

sdplab.linalg.kron_sum

Return \(\mathcal{A}^\dagger y\) for one-body blocks blocks.

sdplab.linalg.kron_prod

Return the left-folded Kronecker product.

sdplab.linalg.kron_sum(ctx, blocks)[source]#

Return \(\mathcal{A}^\dagger y\) for one-body blocks blocks.

If blocks[k] represents \(y_k \in \operatorname{Herm}(d)\), then blocks represents \(y = (y_0, \ldots, y_{N-1}) \in \operatorname{cod}(\mathcal{A})\). The result is the matrix in \(\operatorname{dom}(\mathcal{A})\)

\[\mathcal{A}^\dagger y = y_0 \oplus \cdots \oplus y_{N-1} = \sum_k I \otimes \cdots \otimes y_k \otimes \cdots \otimes I.\]
Parameters:
  • ctx (Context)

  • blocks (DenseArray)

Return type:

DenseArray

sdplab.linalg.kron_prod(ctx, factors)[source]#

Return the left-folded Kronecker product.

For matrices \(A_1,\ldots,A_n\), this computes

\[A_1 \otimes A_2 \otimes \cdots \otimes A_n.\]

If A_i acts on a local vector space V_i, the result acts on the tensor product space \(V_1 \otimes \cdots \otimes V_n\).

Parameters:
  • ctx (Context)

  • factors (Sequence[DenseArray])

Return type:

DenseArray