Skip to content

dq.TimeQArray

Base class for time-dependent qarrays.

A time-qarray is a callable object that returns a qarray for any time \(t\). It is used to define time-dependent operators for Dynamiqs solvers.

Attributes

  • dtype (numpy.dtype) –

    Data type.

  • shape (tuple of int) –

    Shape.

  • ndim (int) –

    Number of dimensions in the shape.

  • layout (Layout) –

    Data layout, either dq.dense or dq.dia.

  • dims (tuple of ints) –

    Hilbert space dimension of each subsystem.

  • mT (time-qarray) –

    Returns the time-qarray transposed over its last two dimensions.

  • vectorized (bool) –

    Whether the underlying qarray is non-vectorized (ket, bra or operator) or vectorized (operator in vector form or superoperator in matrix form).

  • discontinuity_ts (Array | None) –

    Times at which there is a discontinuous jump in the time-qarray values (the array is always sorted, but does not necessarily contain unique values).

Arithmetic operation support

Time-qarrays support basic arithmetic operations -, +, * with other qarray-likes or time-qarrays.

TimeQArray.reshape

reshape(*shape: int) -> TimeQArray

Returns a reshaped copy of a time-qarray.

Parameters

  • *shape –

    New shape, which must match the original size.

Returns

New time-qarray with the given shape.

TimeQArray.broadcast_to

broadcast_to(*shape: int) -> TimeQArray

Broadcasts a time-qarray to a new shape.

Parameters

  • *shape –

    New shape, which must be compatible with the original shape.

Returns

New time-qarray with the given shape.

TimeQArray.conj

conj() -> TimeQArray

Returns the element-wise complex conjugate of the time-qarray.

Returns

New time-qarray with element-wise complex conjuguated values.

TimeQArray.dag

dag() -> TimeQArray

Returns the adjoint (complex conjugate transpose) of the time-qarray.

Returns

New time-qarray with adjoint values.

TimeQArray.squeeze

squeeze(axis: int | None = None) -> TimeQArray

Squeeze a time-qarray.

Parameters

  • axis –

    Axis to squeeze. If none, all axes with dimension 1 are squeezed.

Returns

New time-qarray with squeezed_shape

TimeQArray.__call__

__call__(t: ScalarLike) -> QArray

Returns the time-qarray evaluated at a given time.

Parameters

  • t –

    Time at which to evaluate the time-qarray.

Returns

Qarray evaluated at time \(t\).