Skip to content

dq.tobra

tobra(x: ArrayLike) -> Array

Returns the bra representation of a pure quantum state.

Parameters

  • x (array_like of shape (..., n, 1) or (..., 1, n)) –

    Ket or bra.

Returns

(array of shape (..., 1, n)) Bra.

Examples

>>> psi = dq.fock(3, 0)  # shape: (3, 1)
>>> psi
Array([[1.+0.j],
       [0.+0.j],
       [0.+0.j]], dtype=complex64)
>>> dq.tobra(psi)  # shape: (1, 3)
Array([[1.-0.j, 0.-0.j, 0.-0.j]], dtype=complex64)