Skip to content

dq.dag

dag(x: QArrayLike) -> QArray

Returns the adjoint (complex conjugate transpose) of a matrix.

Parameters

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

    Matrix.

Returns

(qarray of shape (..., n, m)) Adjoint of x.

Equivalent syntax

This function is equivalent to x.mT.conj().

Examples

>>> dq.fock(2, 0)
QArray: shape=(2, 1), dims=(2,), dtype=complex64, layout=dense
[[1.+0.j]
 [0.+0.j]]
>>> dq.dag(dq.fock(2, 0))
QArray: shape=(1, 2), dims=(2,), dtype=complex64, layout=dense
[[1.-0.j 0.-0.j]]