| 1 | initial version |
Based on the advice from @max and @eric_g - the following works:
commutator_f.expr() \
.collect(diff(f)[0].expr()) \
.collect(diff(f)[1].expr()) \
.collect(diff(f)[2].expr()) \
.collect(diff(f)[3].expr())
Many thanks GPN
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.