pygsti.tools.lindbladtools
Utility functions relevant to Lindblad forms and projections
Module Contents
Functions
|
Construct a "dual" elementary error generator matrix in the "standard" (matrix-unit) basis. |
|
Construct an elementary error generator as a matrix in the "standard" (matrix-unit) basis. |
|
Construct the superoperator for a term in the common Lindbladian expansion of an error generator. |
- pygsti.tools.lindbladtools.create_elementary_errorgen_dual(typ, p, q=None, sparse=False, normalization_factor='auto')
Construct a “dual” elementary error generator matrix in the “standard” (matrix-unit) basis.
The elementary error generator that is dual to the one computed by calling
create_elementary_errorgen()
with the same argument. This dual element can be used to find the coefficient of the original, or “primal” elementary generator. For example, if A = sum(c_i * E_i), where E_i are the elementary error generators given bycreate_elementary_errorgen()
), then c_i = dot(D_i.conj(), A) where D_i is the dual to E_i.There are four different types of dual elementary error generators: ‘H’ (Hamiltonian), ‘S’ (stochastic), ‘C’ (correlation), and ‘A’ (active). See arxiv:2103.01928. Each type transforms an input density matrix differently. The action of an elementary error generator L on an input density matrix rho is given by:
Hamiltonian: L(rho) = -1j/(2d^2) * [ p, rho ] Stochastic: L(rho) = 1/(d^2) p * rho * p Correlation: L(rho) = 1/(2d^2) ( p * rho * q + q * rho * p) Active: L(rho) = 1j/(2d^2) ( p * rho * q - q * rho * p)
where d is the dimension of the Hilbert space, e.g. 2 for a single qubit. Square brackets denotes the commutator and curly brackets the anticommutator. L is returned as a superoperator matrix that acts on vectorized density matrices.
Parameters
- typ{‘H’,’S’,’C’,’A’}
The type of dual error generator to construct.
- pnumpy.ndarray
d-dimensional basis matrix.
- qnumpy.ndarray, optional
d-dimensional basis matrix; must be non-None if and only if typ is ‘C’ or ‘A’.
- sparsebool, optional
Whether to construct a sparse or dense (the default) matrix.
Returns
ndarray or Scipy CSR matrix
- pygsti.tools.lindbladtools.create_elementary_errorgen(typ, p, q=None, sparse=False)
Construct an elementary error generator as a matrix in the “standard” (matrix-unit) basis.
There are four different types of elementary error generators: ‘H’ (Hamiltonian), ‘S’ (stochastic), ‘C’ (correlation), and ‘A’ (active). See arxiv:2103.01928. Each type transforms an input density matrix differently. The action of an elementary error generator L on an input density matrix rho is given by:
Hamiltonian: L(rho) = -1j * [ p, rho ] Stochastic: L(rho) = p * rho * p - rho Correlation: L(rho) = p * rho * q + q * rho * p - 0.5 {{p,q}, rho} Active: L(rho) = 1j( p * rho * q - q * rho * p + 0.5 {[p,q], rho} )
Square brackets denotes the commutator and curly brackets the anticommutator. L is returned as a superoperator matrix that acts on vectorized density matrices.
Parameters
- typ{‘H’,’S’,’C’,’A’}
The type of error generator to construct.
- pnumpy.ndarray
d-dimensional basis matrix.
- qnumpy.ndarray, optional
d-dimensional basis matrix; must be non-None if and only if typ is ‘C’ or ‘A’.
- sparsebool, optional
Whether to construct a sparse or dense (the default) matrix.
Returns
ndarray or Scipy CSR matrix
- pygsti.tools.lindbladtools.create_lindbladian_term_errorgen(typ, Lm, Ln=None, sparse=False)
Construct the superoperator for a term in the common Lindbladian expansion of an error generator.
Mathematically, for d-dimensional matrices Lm and Ln, this routine constructs the d^2-dimension Lindbladian matrix L whose action is given by:
L(rho) = -i [Lm, rho] ` (when `typ == ‘H’)
or
L(rho) = Ln*rho*Lm^dag - 1/2(rho*Lm^dag*Ln + Lm^dag*Ln*rho) (typ == ‘O’)
where rho is a density matrix. L is returned as a superoperator matrix that acts on a vectorized density matrices.
Parameters
- typ{‘H’, ‘O’}
The type of error generator to construct.
- Lmnumpy.ndarray
d-dimensional basis matrix.
- Lnnumpy.ndarray, optional
d-dimensional basis matrix.
- sparsebool, optional
Whether to construct a sparse or dense (the default) matrix.
Returns
ndarray or Scipy CSR matrix