Skip to content

dq.braket

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

Returns the inner product \(\braket{\psi|\varphi}\) between two kets.

Parameters

  • x –

    Left-side ket.

  • y –

    Right-side ket.

Returns

(array of shape (...)) Complex-valued inner product.

Examples

>>> fock0 = dq.fock(3, 0)
>>> fock01 = dq.unit(dq.fock(3, 0) + dq.fock(3, 1))
>>> dq.braket(fock0, fock01)
Array(0.707+0.j, dtype=complex64)