Skip to content

dq.create

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

Returns a bosonic creation operator, or a tuple of creation operators for a multi-mode system.

If multiple dimensions are provided \(\mathtt{dims}=(n_1,\dots,n_N)\), it returns a tuple with len(dims) operators \((A_1^\dag,\dots,A_N^\dag)\), where \(A_k^\dag\) is the creation operator acting on the \(k\)-th subsystem within the composite Hilbert space of dimension \(n=\prod n_k\): $$ A_k^\dag = I_{n_1} \otimes\dots\otimes a_{n_k}^\dag \otimes\dots\otimes I_{n_N}. $$

Parameters

  • *dims –

    Hilbert space dimension of each mode.

Returns

(array or tuple of arrays, each of shape (n, n)) Creation operator(s), with n = prod(dims).

Examples

Single-mode \(a^\dag\):

>>> dq.create(4)
Array([[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, 1.414+0.j, 0.   +0.j, 0.   +0.j],
       [0.   +0.j, 0.   +0.j, 1.732+0.j, 0.   +0.j]], dtype=complex64)

Multi-mode \(a^\dag\otimes I_3\) and \(I_2\otimes b^\dag\):

>>> adag, bdag = dq.create(2, 3)
>>> adag
Array([[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],
       [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]], dtype=complex64)
>>> bdag
Array([[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, 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]],      dtype=complex64)