Ask Your Question

Revision history [back]

click to hide/show revision 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