In sympy, simplify an expression using a canonical commutation relation
问题 I have a ladder operator â, which satisfies this commutator relation with its own adjoint: [â, â⁺] = 1 In sympy I have written this code: import sympy from sympy import * from sympy.physics.quantum import * a = Operator('a') ad = Dagger(a) ccr = Eq( Commutator(a, ad), 1 ) Now I need to expand and simplify an expression like this: (â⁺ + â)⁴ If I just use ((ad + a)**4).expand() , sympy doesn't use the commutator relation. How do I simplify the expression while using the canonical commutator