LindbladModel#

class LindbladModel(static_hamiltonian=None, hamiltonian_operators=None, hamiltonian_signals=None, static_dissipators=None, dissipator_operators=None, dissipator_signals=None, rotating_frame=None, in_frame_basis=False, evaluation_mode='dense', validate=True)[source]#

Bases: BaseGeneratorModel

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

The Lindblad master equation models the evolution of a density matrix according to:

\[\dot{\rho}(t) = -i[H(t), \rho(t)] + \mathcal{D}_0(\rho(t)) + \mathcal{D}(t)(\rho(t)),\]

where \(\mathcal{D}_0\) is the static dissipator portion, and \(\mathcal{D}(t)\) is the time-dependent dissipator portion of the equation, given by

\[\mathcal{D}_0(\rho(t)) = \sum_j N_j \rho N_j^\dagger - \frac{1}{2} \{N_j^\dagger N_j, \rho\},\]

and

\[\mathcal{D}(t)(\rho(t)) = \sum_j \gamma_j(t) L_j \rho L_j^\dagger - \frac{1}{2} \{L_j^\dagger L_j, \rho\},\]

respectively. In the above:

  • \([\cdot, \cdot]\) and \(\{\cdot, \cdot\}\) respectively denote the matrix commutator and anti-commutator,

  • \(H(t)\) denotes the Hamiltonian,

  • \(N_j\) denotes the operators appearing in the static dissipator,

  • \(L_j\) denotes the operators appearing in the time-dpendent portion of the dissipator, and

  • \(\gamma_j(t)\) denotes the signal corresponding to the \(j^{th}\) time-dependent dissipator operator.

Instantiating an instance of LindbladModel requires specifying the above decomposition:

lindblad_model = LindbladModel(
    static_hamiltonian=static_hamiltonian,
    hamiltonian_operators=hamiltonian_operators,
    hamiltonian_signals=hamiltonian_signals,
    static_dissipators=static_dissipators,
    dissipator_operators=dissipator_operators,
    dissipator_signals=dissipator_signals
)

where the arguments hamiltonian_operators, hamiltonian_signals, and static_hamiltonian are for the Hamiltonian decomposition as in HamiltonianModel, and the static_dissipators correspond to the \(N_j\), the dissipator_operators to the \(L_j\), and the dissipator_signals the \(\gamma_j(t)\).

Initialize.

Parameters:
  • static_hamiltonian (Union[Array, csr_matrix, None]) – Constant term in Hamiltonian.

  • hamiltonian_operators (Union[Array, List[csr_matrix], None]) – List of operators in Hamiltonian with time-dependent coefficients.

  • hamiltonian_signals (Union[SignalList, List[Signal], None]) – Time-dependent coefficients for hamiltonian_operators.

  • static_dissipators (Union[Array, csr_matrix, None]) – List of dissipators with coefficient 1.

  • dissipator_operators (Union[Array, List[csr_matrix], None]) – List of dissipator operators with time-dependent coefficients.

  • dissipator_signals (Union[SignalList, List[Signal], None]) – Time-dependent coefficients for dissipator_operators.

  • rotating_frame (Union[Operator, Array, RotatingFrame, None]) – Rotating frame in which calcualtions are to be done. If provided, it is assumed that all operators were already in the frame basis.

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

  • evaluation_mode (Optional[str]) – Evaluation mode to use. Call help(LindbladModel.evaluation_mode) for more details.

  • validate (bool) – If True check input hamiltonian_operators and static_hamiltonian are Hermitian.

Raises:

QiskitError – If model insufficiently or incorrectly specified.

Methods

copy()#

Return a copy of self.

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 an anti-Hermitian matrix.

Return type:

Array

Raises:
  • QiskitError – If model cannot be evaluated.

  • NotImplementedError – If the model is currently unvectorized.

evaluate_hamiltonian(time)[source]#

Evaluates Hamiltonian matrix at a given time.

Parameters:

time (float) – The time at which to evaluate the Hamiltonian.

Returns:

Hamiltonian matrix.

Return type:

Array

evaluate_rhs(time, y)[source]#

Evaluates the Lindblad model at a given time.

Parameters:
  • time (Union[float, int]) – The time at which the model should be evaluated.

  • y (Array) – Density matrix as an (n,n) Array if not using a vectorized evaluation_mode, or an (n^2) Array if using vectorized evaluation.

Returns:

Either the evaluated generator or the state.

Return type:

Array

Raises:

QiskitError – If signals not sufficiently specified.

classmethod from_hamiltonian(hamiltonian, static_dissipators=None, dissipator_operators=None, dissipator_signals=None, evaluation_mode=None)[source]#

Construct from a HamiltonianModel.

Parameters:
  • hamiltonian (HamiltonianModel) – The HamiltonianModel.

  • static_dissipators (Union[Array, csr_matrix, None]) – List of dissipators with coefficient 1.

  • dissipator_operators (Union[Array, List[csr_matrix], None]) – List of dissipators with time-dependent coefficients.

  • dissipator_signals (Union[SignalList, List[Signal], None]) – List time-dependent coefficients for dissipator_operators.

  • evaluation_mode (Optional[str]) – Evaluation mode. Call help(LindbladModel.evaluation_mode) for more information.

Returns:

Linblad model from parameters.

Return type:

LindbladModel

Attributes

dim#

The matrix dimension.

dissipator_operators#

The dissipator operators.

evaluation_mode#

Numerical evaluation mode of the model.

Available options:

  • 'dense': Stores Hamiltonian and dissipator terms as dense Array types.

  • 'dense_vectorized': Stores the Hamiltonian and dissipator terms as \((dim^2,dim^2)\) matrices that acts on a vectorized density matrix by left-multiplication. Allows for direct evaluate generator.

  • 'sparse': Like dense, but matrices stored in sparse format. If the default Array backend is JAX, uses JAX BCOO sparse arrays, otherwise uses scipy csr_matrix sparse type.

  • `sparse_vectorized`: Like dense_vectorized, but matrices stored in sparse format. If the default Array backend is JAX, uses JAX BCOO sparse arrays, otherwise uses scipy csr_matrix sparse type. Note that JAX sparse mode is only recommended for use on CPU.

Raises:

NotImplementedError – If this property is set to something other than one of the above modes.

hamiltonian_operators#

The Hamiltonian operators.

in_frame_basis#

Whether to represent the model in the basis in which the frame operator is diagonalized.

rotating_frame#

The rotating frame.

This property can be set with a RotatingFrame instance, or any valid constructor argument to this class.

Setting this property updates the internal operator to use the new frame.

signals#

The model’s signals as tuple with the 0th entry storing the Hamiltonian signals and the 1st entry storing the dissipator signals.

Raises:

QiskitError – If, when setting this property, the given signals are incompatible with operator structure.

static_dissipators#

The static dissipator operators.

static_hamiltonian#

The static Hamiltonian term.