GeneratorModel#

class GeneratorModel(static_operator=None, operators=None, signals=None, rotating_frame=None, in_frame_basis=False, array_library=None)[source]#

Bases: BaseGeneratorModel

A model for a a linear matrix differential equation in standard form.

GeneratorModel is a concrete instance of BaseGeneratorModel, where the map \(\Lambda(t, y)\) is explicitly constructed as:

\[ \begin{align}\begin{aligned}\Lambda(t, y) = G(t)y,\\G(t) = \sum_i s_i(t) G_i + G_d\end{aligned}\end{align} \]

where the \(G_i\) are matrices (represented by an Operator or array), the \(s_i(t)\) are signals represented by a list of Signal objects, and \(G_d\) is the constant-in-time static term of the generator.

Initialize.

Parameters:
  • static_operator (Union[ndarray, number, int, float, complex, Tracer, Array, Array, spmatrix, BCOO, list, None]) – Constant part of the generator.

  • operators (Union[ndarray, number, int, float, complex, Tracer, Array, Array, spmatrix, BCOO, list, None]) – A list of operators \(G_i\).

  • signals (Union[SignalList, List[Signal], None]) – Stores the terms \(s_i(t)\). While required for evaluation, GeneratorModel signals are not required at instantiation.

  • rotating_frame (Union[ndarray, number, int, float, complex, Tracer, Array, Array, spmatrix, BCOO, list, RotatingFrame, None]) – Rotating frame operator.

  • in_frame_basis (bool) – Whether to represent the model in the basis in which the rotating frame operator is diagonalized.

  • array_library (Optional[str]) – Array library with which to represent the operators in the model, and to evaluate the model. See the list of supported array libraries in the arraylias submodule API documentation. If None, the arrays will be handled by general dispatching rules.

Raises:

QiskitError – If model not sufficiently specified.

Methods

evaluate(time)[source]#

Evaluate the model in array format as a matrix, independent of state.

Parameters:

time (float) – The time to evaluate the model at.

Returns:

The evaluated model as a matrix.

Return type:

ArrayLike

Raises:

QiskitError – If model cannot be evaluated.

evaluate_rhs(time, y)[source]#

Evaluate G(t) @ y.

Parameters:
  • time (float) – The time to evaluate the model at .

  • y (Union[ndarray, number, int, float, complex, Tracer, Array, Array, spmatrix, BCOO, list]) – Array specifying system state.

Return type:

Union[ndarray, number, int, float, complex, Tracer, Array, Array, spmatrix, BCOO, list]

Returns:

Array defined by \(G(t) \times y\).

Raises:

QiskitError – If model cannot be evaluated.

Attributes

array_library#

Array library with which to represent the operators in the model, and to evaluate the model.

See the list of supported array libraries in the arraylias submodule API documentation.

dim#

The matrix dimension.

in_frame_basis#

Whether or not the model is evaluated in the basis in which the frame is diagonalized.

operators#

The operators in the model.

rotating_frame#

The rotating frame.

signals#

The signals in the model.

Raises:

QiskitError – If set to None when operators exist, or when set to a number of signals different then the number of operators.

static_operator#

The static operator.