Dagger

Hermitian conjugation.

class sympy.physics.quantum.dagger.Dagger[source]

General Hermitian conjugate operation.

Take the Hermetian conjugate of an argument [R71]. For matrices this operation is equivalent to transpose and complex conjugate [R72].

Parameters :

arg : Expr

The sympy expression that we want to take the dagger of.

References

[R71](1, 2) http://en.wikipedia.org/wiki/Hermitian_adjoint
[R72](1, 2) http://en.wikipedia.org/wiki/Hermitian_transpose

Examples

Daggering various quantum objects:

>>> from sympy.physics.quantum.dagger import Dagger
>>> from sympy.physics.quantum.state import Ket, Bra
>>> from sympy.physics.quantum.operator import Operator
>>> Dagger(Ket('psi'))
<psi|
>>> Dagger(Bra('phi'))
|phi>
>>> Dagger(Operator('A'))
Dagger(A)

Inner and outer products:

>>> from sympy.physics.quantum import InnerProduct, OuterProduct
>>> Dagger(InnerProduct(Bra('a'), Ket('b')))
<b|a>
>>> Dagger(OuterProduct(Ket('a'), Bra('b')))
|b><a|

Powers, sums and products:

>>> A = Operator('A')
>>> B = Operator('B')
>>> Dagger(A*B)
Dagger(B)*Dagger(A)
>>> Dagger(A+B)
Dagger(A) + Dagger(B)
>>> Dagger(A**2)
Dagger(A)**2

Dagger also seamlessly handles complex numbers and matrices:

>>> from sympy import Matrix, I
>>> m = Matrix([[1,I],[2,I]])
>>> m
[1, I]
[2, I]
>>> Dagger(m)
[ 1,  2]
[-I, -I]

Previous topic

Constants

Next topic

Inner Product

This Page