Skip to content

dq.sprepost

sprepost(x: QArrayLike, y: QArrayLike) -> QArray

Returns the superoperator formed from pre- and post-multiplication by operators.

Pre-multiplication by matrix \(A\) and post-multiplication by matrix \(B\) is defined by the superoperator \(B^\mathrm{T} \otimes A\) in vectorized form: $$ AXB \to (B^\mathrm{T} \otimes A) \kett{X}. $$

Parameters

  • x (qarray-like of shape (..., n, n)) –

    Operator for pre-multiplication.

  • y (qarray-like of shape (..., n, n)) –

    Operator for post-multiplication.

Returns

(Qarray of shape (..., n^2, n^2)) Pre- and post-multiplication superoperator.

Examples

>>> dq.sprepost(dq.destroy(3), dq.create(3)).shape
(9, 9)