Skip to content

dq.TimeArray

Base class for time-dependent arrays.

A time-array is a callable object that returns a JAX array 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.

  • mT (TimeArray) –

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

  • ndim (int) –

    Number of dimensions.

Arithmetic operation support

Time-arrays support elementary operations:

  • negation (__neg__),
  • left-and-right element-wise addition/subtraction with other arrays or time-arrays (__add__, __radd__, __sub__, __rsub__),
  • left-and-right element-wise multiplication with other arrays (__mul__, __rmul__).

TimeArray.reshape

reshape(*new_shape: int) -> TimeArray

Returns a reshaped copy of a time-array.

Parameters

  • *new_shape –

    New shape, which must match the original size.

Returns

New time-array object with the given shape.

TimeArray.broadcast_to

broadcast_to(*new_shape: int) -> TimeArray

Broadcasts a time-array to a new shape.

Parameters

  • *new_shape –

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

Returns

New time-array object with the given shape.

TimeArray.conj

conj() -> TimeArray

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

Returns

New time-array object with element-wise complex conjuguated values.

TimeArray.__call__

__call__(t: ScalarLike) -> Array

Returns the time-array evaluated at a given time.

Parameters

  • t –

    Time at which to evaluate the array.

Returns

Array evaluated at time \(t\).