Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commutator algebra could be improved #10892

Open
bjodah opened this issue Mar 23, 2016 · 0 comments
Open

Commutator algebra could be improved #10892

bjodah opened this issue Mar 23, 2016 · 0 comments

Comments

@bjodah
Copy link
Member

bjodah commented Mar 23, 2016

From http://stackoverflow.com/questions/36095622

from sympy.physics.quantum import Commutator as Comm
from sympy.physics.quantum import Operator
A = Operator('A')
B = Operator('B')
C = Comm(Comm(Comm(A,B),A),B)
D = Comm(Comm(Comm(A,B),B),A)
E = (C-D).expand(commutator=true)
E

where the expected output would be 0 but it is:

[[[A,B],A],B] - [[[A,B],B],A]

one can invoke the .doit() method:

>>> simplify(E.doit())
0

but arguably Commutator._eval_expand_commutator should already know this identity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant