抗互换剂#

反换向器: {{A,B}} = A*B + B*A .

class sympy.physics.quantum.anticommutator.AntiCommutator(A, B)[源代码]#

标准反交换子,处于未评估状态。

参数:

A :表达式

反交换子{A,B}的第一个参数。

B :表达式

反交换子{A,B}的第二个参数。

解释

Evaluating an anticommutator is defined [R749] as: {A, B} = A*B + B*A. This class returns the anticommutator in an unevaluated form. To evaluate the anticommutator, use the .doit() method.

反交换子的规范序是 {{A, B}} 对于 A < B . 反交换子的参数按规范顺序排列,使用 __cmp__ .如果 B < A 然后 {{A, B}} 返回为 {{B, A}} .

实例

>>> from sympy import symbols
>>> from sympy.physics.quantum import AntiCommutator
>>> from sympy.physics.quantum import Operator, Dagger
>>> x, y = symbols('x,y')
>>> A = Operator('A')
>>> B = Operator('B')

创建一个反交换程序并使用 doit() 把它们相乘。

>>> ac = AntiCommutator(A,B); ac
{A,B}
>>> ac.doit()
A*B + B*A

换向器按规范顺序排列参数:

>>> ac = AntiCommutator(B,A); ac
{A,B}

交换常数被考虑在内:

>>> AntiCommutator(3*x*A,x*y*B)
3*x**2*y*{A,B}

应用于反交换子的伴随运算正确地应用于参数:

>>> Dagger(AntiCommutator(A,B))
{Dagger(A),Dagger(B)}

工具书类

doit(**hints)[源代码]#

评价抗互换剂