qalgebra.core.super_operator_algebra module

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

Summary

Classes:

SPost

Linear post-multiplication operator.

SPre

Linear pre-multiplication operator

ScalarTimesSuperOperator

Product of a Scalar coefficient and a SuperOperator.

SuperAdjoint

Adjoint of a super-operator.

SuperCommutativeHSOrder

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

SuperOperator

Base class for super-operators

SuperOperatorDerivative

Symbolic partial derivative of a super-operator

SuperOperatorPlus

A sum of super-operators

SuperOperatorSymbol

Symbolic super-operator

SuperOperatorTimes

Product of super-operators

SuperOperatorTimesOperator

Application of a super-operator to an operator.

Functions:

anti_commutator

If B != None, return the anti-commutator \(\{A,B\}\), otherwise return the super-operator \(\{A,\cdot\}\).

commutator

Commutator of A and B

lindblad

Return the super-operator Lindblad term of the Lindblad operator C

liouvillian

Return the Liouvillian super-operator associated with H and Ls

Data:

IdentitySuperOperator

Neutral element for product of super-operators

ZeroSuperOperator

Neutral element for sum of super-operators

__all__: IdentitySuperOperator, SPost, SPre, ScalarTimesSuperOperator, SuperAdjoint, SuperOperator, SuperOperatorDerivative, SuperOperatorPlus, SuperOperatorSymbol, SuperOperatorTimes, SuperOperatorTimesOperator, ZeroSuperOperator, anti_commutator, commutator, lindblad, liouvillian

Reference

class qalgebra.core.super_operator_algebra.SPost(*args, **kwargs)[source]

Bases: qalgebra.core.super_operator_algebra.SuperOperator, qalgebra.core.abstract_algebra.Operation

Linear post-multiplication operator.

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

simplifications = [<function match_replace>]
property space

The HilbertSpace on which the operator acts non-trivially

class qalgebra.core.super_operator_algebra.SPre(*args, **kwargs)[source]

Bases: qalgebra.core.super_operator_algebra.SuperOperator, qalgebra.core.abstract_algebra.Operation

Linear pre-multiplication operator

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

simplifications = [<function match_replace>]
property space

The HilbertSpace on which the operator acts non-trivially

class qalgebra.core.super_operator_algebra.ScalarTimesSuperOperator(coeff, term)[source]

Bases: qalgebra.core.super_operator_algebra.SuperOperator, qalgebra.core.abstract_quantum_algebra.ScalarTimesQuantumExpression

Product of a Scalar coefficient and a SuperOperator.

simplifications = [<function match_replace>]
class qalgebra.core.super_operator_algebra.SuperAdjoint(operand)[source]

Bases: qalgebra.core.abstract_quantum_algebra.QuantumAdjoint, qalgebra.core.super_operator_algebra.SuperOperator

Adjoint of a super-operator.

The mathematical 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]\]
simplifications = [<function delegate_to_method.<locals>._delegate_to_method>]
class qalgebra.core.super_operator_algebra.SuperOperator(*args, **kwargs)[source]

Bases: qalgebra.core.abstract_quantum_algebra.QuantumExpression

Base class for super-operators

class qalgebra.core.super_operator_algebra.SuperOperatorPlus(*operands, **kwargs)[source]

Bases: qalgebra.core.abstract_quantum_algebra.QuantumPlus, qalgebra.core.super_operator_algebra.SuperOperator

A sum of super-operators

simplifications = [<function assoc>, <function orderby>, <function collect_summands>, <function match_replace_binary>]
class qalgebra.core.super_operator_algebra.SuperOperatorSymbol(label, *sym_args, hs)[source]

Bases: qalgebra.core.abstract_quantum_algebra.QuantumSymbol, qalgebra.core.super_operator_algebra.SuperOperator

Symbolic super-operator

See QuantumSymbol.

class qalgebra.core.super_operator_algebra.SuperOperatorTimes(*operands, **kwargs)[source]

Bases: qalgebra.core.abstract_quantum_algebra.QuantumTimes, qalgebra.core.super_operator_algebra.SuperOperator

Product of super-operators

simplifications = [<function assoc>, <function orderby>, <function filter_neutral>, <function match_replace_binary>]
order_key

alias of qalgebra.core.super_operator_algebra.SuperCommutativeHSOrder

classmethod create(*ops)[source]

Instantiate while applying automatic simplifications.

Instead of directly instantiating cls, it is recommended to use create(), which applies simplifications to the args and keyword arguments according to the simplifications class attribute, and returns an appropriate object (which may or may not be an instance of the original cls).

Two simplifications of particular importance are match_replace() and match_replace_binary() which apply rule-based simplifications.

The temporary_rules() context manager may be used to allow temporary modification of the automatic simplifications that create() uses, in particular the rules for match_replace() and match_replace_binary(). Inside the managed context, the simplifications class attribute may be modified and rules can be managed with add_rule() and del_rules().

class qalgebra.core.super_operator_algebra.SuperOperatorTimesOperator(sop, op)[source]

Bases: qalgebra.core.operator_algebra.Operator, qalgebra.core.abstract_algebra.Operation

Application of a super-operator to an operator.

The result of this operation an Operator.

simplifications = [<function match_replace>]
property space

The HilbertSpace on which the operator acts non-trivially

property sop
property op
qalgebra.core.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 – The first operator to form all anti-commutators of.

  • B – The second operator to form the anti-commutator of, or None.

Returns

The linear superoperator \([A,\cdot]\)

Return type

SuperOperator

qalgebra.core.super_operator_algebra.commutator(A, B=None)[source]

Commutator of A and B

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 – The first operator to form the commutator of.

  • B – The second operator to form the commutator of, or None.

Returns

The linear superoperator \([A,\cdot]\)

Return type

SuperOperator

qalgebra.core.super_operator_algebra.lindblad(C)[source]

Return the super-operator Lindblad term of the Lindblad operator C

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

Returns

The Lindblad collapse generator.

Return type

SuperOperator

qalgebra.core.super_operator_algebra.liouvillian(H, Ls=None)[source]

Return the Liouvillian super-operator associated with H and Ls

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 (list or Matrix) – A sequence of Lindblad operators.

Returns

The Liouvillian super-operator.

Return type

SuperOperator

qalgebra.core.super_operator_algebra.IdentitySuperOperator = IdentitySuperOperator[source]

Neutral element for product of super-operators

qalgebra.core.super_operator_algebra.ZeroSuperOperator = ZeroSuperOperator[source]

Neutral element for sum of super-operators

class qalgebra.core.super_operator_algebra.SuperOperatorDerivative(op, *, derivs, vals=None)[source]

Bases: qalgebra.core.abstract_quantum_algebra.QuantumDerivative, qalgebra.core.super_operator_algebra.SuperOperator

Symbolic partial derivative of a super-operator

See QuantumDerivative.

class qalgebra.core.super_operator_algebra.SuperCommutativeHSOrder(op, space_order=None, op_order=None)[source]

Bases: qalgebra.utils.ordering.DisjunctCommutativeHSOrder

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