# qnet.algebra.super_operator_algebra module¶

The specification of a quantum mechanics symbolic super-operator algebra. See Super-Operator Algebra for more details.

## Summary¶

Exceptions:

 BadLiouvillianError Raise when a Liouvillian is not of standard Lindblad form. CannotSymbolicallyDiagonalize

Classes:

 SPost Linear post-multiplication operator. SPre Linear pre-multiplication operator. ScalarTimesSuperOperator Multiply an operator by a scalar coefficient: SuperAdjoint The symbolic SuperAdjoint of a super-operator. SuperCommutativeHSOrder Ordering class that acts like DisjunctCommutativeHSOrder, but also SuperOperator The super-operator abstract base class. SuperOperatorOperation Base class for Operations acting only on SuperOperator arguments. SuperOperatorPlus A sum of super-operators. SuperOperatorSymbol Super-operator symbol class, parametrized by an identifier string and an associated Hilbert space. SuperOperatorTimes A product of super-operators that denotes order of application of SuperOperatorTimesOperator Application of a super-operator to an operator (result is an Operator).

Functions:

 anti_commutator If B != None, return the anti-commutator $$\{A,B\}$$, otherwise return the super-operator $$\{A,\cdot\}$$. commutator If B != None, return the commutator $$[A,B]$$, otherwise return the super-operator $$[A,\cdot]$$. lindblad Return SPre(C) * SPost(C.adjoint()) - (1/2) * santi_commutator(C.adjoint()*C). liouvillian Return the Liouvillian super-operator associated with a Hamilton operator H and a set of collapse-operators Ls = [L1, L2, ...]. liouvillian_normal_form Return a Hamilton operator H and a minimal list of collapse operators Ls that generate the liouvillian L.

Data:

 IdentitySuperOperator IdentitySuperOperator constant (singleton) object. ZeroSuperOperator ZeroSuperOperator constant (singleton) object.

## Reference¶

exception qnet.algebra.super_operator_algebra.CannotSymbolicallyDiagonalize[source]
exception qnet.algebra.super_operator_algebra.BadLiouvillianError[source]

Raise when a Liouvillian is not of standard Lindblad form.

class qnet.algebra.super_operator_algebra.SuperOperator[source]

Bases: object

The super-operator abstract base class.

Any super-operator contains an associated HilbertSpace object, on which it is taken to act non-trivially.

space

The Hilbert space associated with the operator on which it acts non-trivially

superadjoint()[source]

The super-operator adjoint (w.r.t to the Tr operation). See SuperAdjoint documentation.

Returns: The super-adjoint of the super-operator. SuperOperator
expand()[source]

Expand out distributively all products of sums. Note that this does not expand out sums of scalar coefficients.

Returns: A fully expanded sum of superoperators. SuperOperator
simplify_scalar()[source]

Simplify all scalar coefficients within the Operator expression.

Returns: The simplified expression. Operator
class qnet.algebra.super_operator_algebra.SuperOperatorOperation(*operands)[source]

Base class for Operations acting only on SuperOperator arguments.

space
class qnet.algebra.super_operator_algebra.SuperOperatorSymbol(label, *, hs)[source]

Super-operator symbol class, parametrized by an identifier string and an associated Hilbert space.

Instantiate as:

SuperOperatorSymbol(name, hs)

Parameters: label (str) – Symbol identifier hs (HilbertSpace) – Associated Hilbert space.
label
args
kwargs
space
all_symbols()[source]
qnet.algebra.super_operator_algebra.IdentitySuperOperator = IdentitySuperOperator[source]

IdentitySuperOperator constant (singleton) object.

qnet.algebra.super_operator_algebra.ZeroSuperOperator = ZeroSuperOperator[source]

ZeroSuperOperator constant (singleton) object.

class qnet.algebra.super_operator_algebra.SuperOperatorPlus(*operands)[source]

A sum of super-operators.

Instantiate as:

OperatorPlus(*summands)

Parameters: summands (SuperOperator) – super-operator summands.
neutral_element = ZeroSuperOperator

ZeroSuperOperator constant (singleton) object.

order_key

alias of FullCommutativeHSOrder

class qnet.algebra.super_operator_algebra.SuperCommutativeHSOrder(op, space_order=None, op_order=None)[source]

Ordering class that acts like DisjunctCommutativeHSOrder, but also commutes any SPost and SPre

class qnet.algebra.super_operator_algebra.SuperOperatorTimes(*operands)[source]

A product of super-operators that denotes order of application of super-operators (right to left):

SuperOperatorTimes(*factors)

Parameters: factors (SuperOperator) – Super-operator factors.
neutral_element = IdentitySuperOperator

IdentitySuperOperator constant (singleton) object.

order_key
classmethod create(*ops)[source]
class qnet.algebra.super_operator_algebra.ScalarTimesSuperOperator(*operands, **kwargs)[source]

Multiply an operator by a scalar coefficient:

ScalarTimesSuperOperator(coeff, term)

Parameters: coeff (SCALAR_TYPES) – Scalar coefficient. term (SuperOperator) – The super-operator that is multiplied.
space
coeff

The scalar coefficient.

term

The super-operator term.

class qnet.algebra.super_operator_algebra.SuperAdjoint(operand)[source]

The symbolic SuperAdjoint of a super-operator.

The math notation for this is typically

${\rm SuperAdjoint}(\mathcal{L}) =: \mathcal{L}^*$

and for any super operator $$\mathcal{L}$$, its super-adjoint $$\mathcal{L}^*$$ satisfies for any pair of operators $$M,N$$:

${\rm Tr}[M (\mathcal{L}N)] = Tr[(\mathcal{L}^*M) N]$
Parameters: L (SuperOperator) – The super-operator to take the adjoint of.
operand
class qnet.algebra.super_operator_algebra.SPre(op)[source]

Linear pre-multiplication operator.

Acting SPre(A) on an operator B just yields the product A * B

space
class qnet.algebra.super_operator_algebra.SPost(op)[source]

Linear post-multiplication operator.

Acting SPost(A) on an operator B just yields the reversed product B * A.

space
class qnet.algebra.super_operator_algebra.SuperOperatorTimesOperator(sop, op)[source]

Application of a super-operator to an operator (result is an Operator).

Parameters: sop (SuperOperator) – The super-operator to apply. op (Operator) – The operator it is applied to.
space
sop
op
qnet.algebra.super_operator_algebra.commutator(A, B=None)[source]

If B != None, return the commutator $$[A,B]$$, otherwise return the super-operator $$[A,\cdot]$$. The super-operator $$[A,\cdot]$$ maps any other operator B to the commutator $$[A, B] = A B - B A$$.

Parameters: A (Operator) – The first operator to form the commutator of. or None) B ((Operator) – The second operator to form the commutator of, or None. The linear superoperator $$[A,\cdot]$$ SuperOperator
qnet.algebra.super_operator_algebra.anti_commutator(A, B=None)[source]

If B != None, return the anti-commutator $$\{A,B\}$$, otherwise return the super-operator $$\{A,\cdot\}$$. The super-operator $$\{A,\cdot\}$$ maps any other operator B to the anti-commutator $$\{A, B\} = A B + B A$$.

Parameters: A (Operator) – The first operator to form all anti-commutators of. or None) B ((Operator) – The second operator to form the anti-commutator of, or None. The linear superoperator $$[A,\cdot]$$ SuperOperator
qnet.algebra.super_operator_algebra.lindblad(C)[source]

Return SPre(C) * SPost(C.adjoint()) - (1/2) * santi_commutator(C.adjoint()*C). These are the super-operators $$\mathcal{D}[C]$$ that form the collapse terms of a Master-Equation. Applied to an operator $$X$$ they yield

$\mathcal{D}[C] X = C X C^\dagger - {1\over 2} (C^\dagger C X + X C^\dagger C)$
Parameters: C (Operator) – The associated collapse operator The Lindblad collapse generator. SuperOperator
qnet.algebra.super_operator_algebra.liouvillian(H, Ls=[])[source]

Return the Liouvillian super-operator associated with a Hamilton operator H and a set of collapse-operators Ls = [L1, L2, ...].

The Liouvillian $$\mathcal{L}$$ generates the Markovian-dynamics of a system via the Master equation:

$\dot{\rho} = \mathcal{L}\rho = -i[H,\rho] + \sum_{j=1}^n \mathcal{D}[L_j] \rho$
Parameters: H (Operator) – The associated Hamilton operator Ls (sequence or Matrix) – A sequence of collapse operators. The Liouvillian super-operator. SuperOperator
qnet.algebra.super_operator_algebra.liouvillian_normal_form(L, symbolic=False)[source]

Return a Hamilton operator H and a minimal list of collapse operators Ls that generate the liouvillian L.

A Liouvillian defined by a hermitian Hamilton operator $$H$$ and a vector of collapse operators $$\mathbf{L} = (L_1, L_2, \dots L_n)^T$$ is invariant under the following two operations:

$\begin{split}\left(H, \mathbf{L}\right) & \mapsto \left(H + {1\over 2i}\left(\mathbf{w}^\dagger \mathbf{L} - \mathbf{L}^\dagger \mathbf{w}\right), \mathbf{L} + \mathbf{w} \right) \\ \left(H, \mathbf{L}\right) & \mapsto \left(H, \mathbf{U}\mathbf{L}\right)\\\end{split}$

where $$\mathbf{w}$$ is just a vector of complex numbers and $$\mathbf{U}$$ is a complex unitary matrix. It turns out that for quantum optical circuit models the set of collapse operators is often linearly dependent. This routine tries to find a representation of the Liouvillian in terms of a Hamilton operator H with as few non-zero collapse operators Ls as possible. Consider the following example, which results from a two-port linear cavity with a coherent input into the first port:

>>> from sympy import symbols
>>> kappa_1, kappa_2 = symbols('kappa_1, kappa_2', positive = True)
>>> Delta = symbols('Delta', real = True)
>>> alpha = symbols('alpha')
>>> H = (Delta * Create(hs=1) * Destroy(hs=1) +
...      (sqrt(kappa_1) / (2 * I)) *
...      (alpha * Create(hs=1) - alpha.conjugate() * Destroy(hs=1)))
>>> Ls = [sqrt(kappa_1) * Destroy(hs=1) + alpha,
...       sqrt(kappa_2) * Destroy(hs=1)]
>>> LL = liouvillian(H, Ls)
>>> Hnf, Lsnf = liouvillian_normal_form(LL)
>>> print(ascii(Hnf))
-I*alpha*sqrt(kappa_1) * a^(1)H + I*sqrt(kappa_1)*conjugate(alpha) * a^(1) + Delta * a^(1)H * a^(1)
>>> len(Lsnf)
1
>>> print(ascii(Lsnf[0]))
sqrt(kappa_1 + kappa_2) * a^(1)


In terms of the ensemble dynamics this final system is equivalent. Note that this function will only work for proper Liouvillians.

Parameters: L (SuperOperator) – The Liouvillian (H, Ls) tuple BadLiouvillianError