datablock()

datablock()#

static QuadraticOperator.datablock(states, inputs=None)[source]#

Return the data matrix block corresponding to the operator, the Khatri–Rao product of the state with itself: \(\Qhat\odot\Qhat\) where \(\Qhat\) is states.

Since \(\Ophat_\ell(\qhat,\u) = \Ohat_{\ell}\d_{\ell}(\qhat,\u)\) with \(\Ohat_{\ell} = \Hhat\) and \(\d_{\ell}(\qhat,\u) = \qhat\otimes\qhat\), the data block should be

\[\D\trp = \left[\begin{array}{ccc} \d_{\ell}(\qhat_0,\u_0) & \cdots & \d_{\ell}(\qhat_{k-1},\u_{k-1}) \end{array}\right] = \left[\begin{array}{ccc} \qhat_0\otimes\qhat_0 & \cdots & \qhat_{k-1}\otimes\qhat_{k-1} \end{array}\right] \in\RR^{r^2 \times k}.\]

Internally, a compressed Kronecker product \(\hat{\otimes}\) with \(r(r+1)/2 < r^{2}\) degrees of freedom is used for efficiency, hence the data block is actually

\[\D\trp = \left[\begin{array}{ccc} \qhat_0\,\hat{\otimes}\,\qhat_0 & \cdots & \qhat_{k-1}\,\hat{\otimes}\,\qhat_{k-1} \end{array}\right] \in\RR^{r(r+1)/2 \times k}.\]
Parameters:
states(r, k) or (k,) ndarray

State vectors. Each column is a single state vector. If one dimensional, it is assumed that \(r = 1\).

inputs(m, k) or (k,) ndarray or None

Input vectors (not used).

Returns:
product(r(r+1)/2, k) ndarray

Compressed Khatri–Rao product of states with itself.