Models (qiskit_dynamics.models
)#
This module contains classes for constructing the righthand side of an ordinary differential equations. In this package, a “model of a quantum system” means a description of a differential equation used to model a physical quantum system, which in this case is either the Schrodinger equation:
where \(H(t)\) is the Hamiltonian, or the Lindblad equation:
where the second term is called the dissipator term. Each \(L_j\) is a dissipation operator dissipator, and \([\cdot, \cdot]\) and \(\{\cdot, \cdot\}\) are, respectively, the matrix commutator and anticommutator.
The classes for representing the Schrodinger and Lindblad equations are, respectively,
HamiltonianModel
and
LindbladModel
. Model classes primarily serve a computational
purpose, and expose functions for evaluating model expressions, such as \(t \mapsto H(t)\) or
\(t,y \mapsto iH(t)y\) in the case of a Hamiltonian, and with similar functionality for
LindbladModel
.
Rotating frames#
Frame transformations are a common technique for solving timedependent quantum differential equations. For example, for a Hamiltonian, this corresponds to the transformation
for a Hermitian operator \(H_0\) called the frame operator.
Note
The frame operator is commonly equivalently expressed as the corresponding antiHermitian operator under the association \(F = iH_0\). This package refers to either \(F\) or \(H_0\) as the frame operator, with this association being understood.
Any model class can be transformed into a rotating frame by setting the
rotating_frame
property:
model.rotating_frame = frame_operator
where frame_operator
is a specification of either \(H_0\) or \(F = iH_0\) (see the
documentation for RotatingFrame
for valid types and behaviours).
Setting this property modifies the behaviour of the evaluation functions, e.g. a
HamiltonianModel
will compute \(e^{tF}(iH(t)  F)e^{tF}\) in
place of \(H(t)\). LindbladModel
has similar behaviour.
Internally, the model classes make use of the RotatingFrame
class,
which is instantiated when the rotating_frame
property is set. This class contains helper
functions for transforming various objects into and out of the rotating frame. This class works
directly with the antiHermitian form \(F = iH_0\), however, it can also be instantiated with a
Hermitian operator \(H_0\) from which \(F\) is automatically constructed.
Rotating wave approximation#
The rotating wave approximation (RWA) is a transformation in which rapidly oscillating
timedependent components, above a given cutoff frequency, are removed from a model. This
transformation is implemented in rotating_wave_approximation()
, see
its documentation for details.
Controlling model evaluation: array libraries and vectorization#
The underlying array library used by any model class can be controlled via the array_library
instantiation argument. The model will store the underlying arrays using the specified library, and
use this library to evaluate the model. See the arraylias
submodule API documentation for a
list of array_library
options. If unspecified, the model will use the general dispatching rules
of the configured aliases in arraylias
to determine which library to use based on how the
operators are specified.
Additionally, the LindbladModel
class can be set to store and evaluate the Lindblad
equation in a matrixvector vectorized format using the vectorized
instatiation argument.
Note
When setting a rotating frame, models internally store their operators in the basis in which the frame operator is diagonal. In general, sparsity of an operator is not perserved by basis transformations. Hence, preserving internal sparsity with rotating frames requires more restrictive choice of frames. For example, diagonal frame operators exactly preserve sparsity.
Model classes#

A model of a Hamiltonian for the Schrodinger equation. 

A model of a quantum system in terms of the Lindblad master equation. 

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

Class for representing a rotation frame transformation. 

Construct a new model by performing the rotating wave approximation with a given cutoff frequency. 