Skip to content

dq.timecallable

timecallable(f: callable[[float], Array]) -> CallableTimeArray

Instantiate a callable time-array.

A callable time-array is defined by \(O(t) = f(t)\) where \(f(t)\) is a time-dependent operator. The function \(f\) is defined by passing a Python function with signature f(t: float) -> Array that returns an array of shape (..., n, n) for any time \(t\).

The function f must return a JAX array (not an array-like object!)

An error is raised if the function f does not return a JAX array. This error concerns any other array-like objects. This is enforced to avoid costly conversions at every time step of the numerical integration.

Parameters

  • f (function returning array of shape (..., n, n)) –

    Function with signature (t: float) -> Array that returns the array \(f(t)\).

Returns

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