Skip to content

dq.constant

constant(array: ArrayLike) -> ConstantTimeArray

Instantiate a constant time-array.

A constant time-array is defined by \(O(t) = O_0\) for any time \(t\), where \(O_0\) is a constant array.

Parameters

  • array (array_like of shape (..., n, n)) –

    Constant array \(O_0\).

Returns

(time-array object of shape (..., n, n) when called) Callable object returning \(O_0\) for any time \(t\).

Examples

>>> H = dq.constant(dq.sigmaz())
>>> H(0.0)
Array([[ 1.+0.j,  0.+0.j],
       [ 0.+0.j, -1.+0.j]], dtype=complex64)
>>> H(1.0)
Array([[ 1.+0.j,  0.+0.j],
       [ 0.+0.j, -1.+0.j]], dtype=complex64)