Skip to content

dq.destroy

destroy(*dims: int) -> Array | tuple[Array, ...]

Returns a bosonic annihilation operator, or a tuple of annihilation operators in a multi-mode system.

If only a single dimension is provided, destroy returns the annihilation operator of corresponding dimension. If instead multiples dimensions are provided, destroy returns a tuple of each annihilation operator of given dimension, in the Hilbert space given by the product of all dimensions.

Parameters

  • *dims

    Variable length argument list of the Hilbert space dimensions.

Returns

(array or tuple of arrays) Annihilation operator of given dimension, or tuple of annihilation operators in a multi-mode system.

Examples

>>> dq.destroy(4)
Array([[0.   +0.j, 1.   +0.j, 0.   +0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 1.414+0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 0.   +0.j, 1.732+0.j],
       [0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j]], dtype=complex64)
>>> a, b = dq.destroy(2, 3)
>>> a
Array([[0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j]], dtype=complex64)
>>> b
Array([[0.   +0.j, 1.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 1.414+0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 1.   +0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 1.414+0.j],
       [0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j, 0.   +0.j]],      dtype=complex64)