qnet.algebra.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 |
liouvillian_normal_form |
Return a Hamilton operator H and a minimal list of collapse operators Ls that generate the liouvillian L . |
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
, liouvillian_normal_form
Reference¶
-
class
qnet.algebra.core.super_operator_algebra.
SuperOperator
(*args, **kwargs)[source]¶ Bases:
qnet.algebra.core.abstract_quantum_algebra.QuantumExpression
Base class for super-operators
-
class
qnet.algebra.core.super_operator_algebra.
SuperOperatorSymbol
(label, *sym_args, hs)[source]¶ Bases:
qnet.algebra.core.abstract_quantum_algebra.QuantumSymbol
,qnet.algebra.core.super_operator_algebra.SuperOperator
Symbolic super-operator
See
QuantumSymbol
.
-
qnet.algebra.core.super_operator_algebra.
IdentitySuperOperator
= IdentitySuperOperator[source]¶ Neutral element for product of super-operators
-
qnet.algebra.core.super_operator_algebra.
ZeroSuperOperator
= ZeroSuperOperator[source]¶ Neutral element for sum of super-operators
-
class
qnet.algebra.core.super_operator_algebra.
SuperOperatorPlus
(*operands, **kwargs)[source]¶ Bases:
qnet.algebra.core.abstract_quantum_algebra.QuantumPlus
,qnet.algebra.core.super_operator_algebra.SuperOperator
A sum of super-operators
-
simplifications
= [<function assoc>, <function orderby>, <function collect_summands>, <function match_replace_binary>]¶
-
-
class
qnet.algebra.core.super_operator_algebra.
SuperCommutativeHSOrder
(op, space_order=None, op_order=None)[source]¶ Bases:
qnet.utils.ordering.DisjunctCommutativeHSOrder
Ordering class that acts like DisjunctCommutativeHSOrder, but also commutes any SPost and SPre
-
class
qnet.algebra.core.super_operator_algebra.
SuperOperatorTimes
(*operands, **kwargs)[source]¶ Bases:
qnet.algebra.core.abstract_quantum_algebra.QuantumTimes
,qnet.algebra.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
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 thesimplifications
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()
andmatch_replace_binary()
which apply rule-based simplifications.The
temporary_rules()
context manager may be used to allow temporary modification of the automatic simplifications thatcreate()
uses, in particular the rules formatch_replace()
andmatch_replace_binary()
. Inside the managed context, thesimplifications
class attribute may be modified and rules can be managed withadd_rule()
anddel_rules()
.
-
-
class
qnet.algebra.core.super_operator_algebra.
ScalarTimesSuperOperator
(coeff, term)[source]¶ Bases:
qnet.algebra.core.super_operator_algebra.SuperOperator
,qnet.algebra.core.abstract_quantum_algebra.ScalarTimesQuantumExpression
Product of a
Scalar
coefficient and aSuperOperator
-
simplifications
= [<function match_replace>]¶
-
-
class
qnet.algebra.core.super_operator_algebra.
SuperAdjoint
(operand)[source]¶ Bases:
qnet.algebra.core.abstract_quantum_algebra.QuantumAdjoint
,qnet.algebra.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
qnet.algebra.core.super_operator_algebra.
SPre
(*args, **kwargs)[source]¶ Bases:
qnet.algebra.core.super_operator_algebra.SuperOperator
,qnet.algebra.core.abstract_algebra.Operation
Linear pre-multiplication operator
Acting
SPre(A)
on an operatorB
just yields the productA * B
-
simplifications
= [<function match_replace>]¶
-
space
¶ The
HilbertSpace
on which the operator acts non-trivially
-
-
class
qnet.algebra.core.super_operator_algebra.
SPost
(*args, **kwargs)[source]¶ Bases:
qnet.algebra.core.super_operator_algebra.SuperOperator
,qnet.algebra.core.abstract_algebra.Operation
Linear post-multiplication operator
Acting
SPost(A)
on an operatorB
just yields the reversed productB * A
.-
simplifications
= [<function match_replace>]¶
-
space
¶ The
HilbertSpace
on which the operator acts non-trivially
-
-
class
qnet.algebra.core.super_operator_algebra.
SuperOperatorTimesOperator
(sop, op)[source]¶ Bases:
qnet.algebra.core.operator_algebra.Operator
,qnet.algebra.core.abstract_algebra.Operation
Application of a super-operator to an operator
The result of this operation is(result is an
Operator
-
simplifications
= [<function match_replace>]¶
-
space
¶ The
HilbertSpace
on which the operator acts non-trivially
-
sop
¶
-
op
¶
-
-
class
qnet.algebra.core.super_operator_algebra.
SuperOperatorDerivative
(op, *, derivs, vals=None)[source]¶ Bases:
qnet.algebra.core.abstract_quantum_algebra.QuantumDerivative
,qnet.algebra.core.super_operator_algebra.SuperOperator
Symbolic partial derivative of a super-operator
See
QuantumDerivative
.
-
qnet.algebra.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 operatorB
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:
-
qnet.algebra.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 operatorB
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:
-
qnet.algebra.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
-
qnet.algebra.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: Returns: The Liouvillian super-operator.
Return type:
-
qnet.algebra.core.super_operator_algebra.
liouvillian_normal_form
(L, symbolic=False)[source]¶ Return a Hamilton operator
H
and a minimal list of collapse operatorsLs
that generate the liouvillianL
.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 operatorsLs
as possible. Consider the following example, which results from a two-port linear cavity with a coherent input into the first port:>>> kappa_1, kappa_2 = sympy.symbols('kappa_1, kappa_2', positive = True) >>> Delta = sympy.symbols('Delta', real = True) >>> alpha = sympy.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 Returns: (H, Ls)
Return type: tuple Raises: BadLiouvillianError