Models (qiskit_dynamics.models)#

This module contains classes for constructing the right-hand 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:

\[\dot{y}(t) = -i H(t)y(t),\]

where \(H(t)\) is the Hamiltonian, or the Lindblad equation:

\[\dot{\rho}(t) = -i[H(t), \rho(t)] + \sum_j g_j(t) \left(L_j\rho(t)L_j^\dagger - \frac{1}{2}\{L_j^\dagger L_j, \rho(t)\}\right),\]

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 anti-commutator.

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 time-dependent quantum differential equations. For example, for a Hamiltonian, this corresponds to the transformation

\[H(t) \mapsto e^{iH_0t}(H(t) - H_0)e^{-iH_0t},\]

for a Hermitian operator \(H_0\) called the frame operator.

Note

The frame operator is commonly equivalently expressed as the corresponding anti-Hermitian 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 anti-Hermitian 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 time-dependent 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 matrix-vector 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#

HamiltonianModel([static_operator, ...])

A model of a Hamiltonian for the Schrodinger equation.

LindbladModel([static_hamiltonian, ...])

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

GeneratorModel([static_operator, operators, ...])

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

Model transformations#

RotatingFrame(frame_operator[, atol, rtol])

Class for representing a rotation frame transformation.

rotating_wave_approximation(model, cutoff_freq)

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