匕首#

厄米共轭。

class sympy.physics.quantum.dagger.Dagger(arg)[源代码]#

一般厄米共轭运算。

参数:

arg :表达式

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

评价 布尔

Whether the resulting expression should be directly evaluated.

解释

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

实例

攻击各种量子物体:

>>> 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)

内外产品:

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

幂、数和积:

>>> 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还可以无缝地处理复数和矩阵:

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

工具书类