Skip to content

dq.sprepost

sprepost(x: ArrayLike, y: ArrayLike) -> Array

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 (array_like of shape (..., n, n)) –

    Operator for pre-multiplication.

  • y (array_like of shape (..., n, n)) –

    Operator for post-multiplication.

Returns

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

Examples

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