Skip to contents

AntiCommutator(A, B) is the unevaluated {A, B} = A*B + B*A of sympy.physics.quantum.anticommutator; it is 2*A*B when one argument commutes and its arguments are put in canonical order. doit() evaluates it. The commutator [A, B] is Commutator().

Usage

AntiCommutator(A, B)

Arguments

A, B

Operators or expressions.

Value

An expression.

Examples

A <- Operator("A"); B <- Operator("B")
AntiCommutator(B, A)
#> {A,B}
doit(AntiCommutator(A, B))
#> A*B + B*A