 updates/Maple2019/Physics2 - Maple Help

 Physics

Maple provides a state-of-the-art environment for algebraic computations in Physics, with emphasis on ensuring that the computational experience is as natural as possible. The theme of the Physics project for Maple 2019 has been the consolidation of the functionality introduced in previous releases, together with significant enhancements to further strengthen the functionality mainly in three areas:

 1 Quantum Mechanics: coherent states, tensor products of states, taylor series of expressions involving anticommutative variables and functions, and several improvements in the normalization and simplification of Commutator and AntiCommutator algebra rules.
 2 Tensor computations in general, making Maple 2019 unmatched in the field, covering classical and quantum mechanics, and special and general relativity, using natural tensor input notation and textbook-like display of results. The functionality for tensors is tightly integrated with the full Maple computation system and extensively documented in "A Complete Guide for performing tensor computations using Physics".
 3 Documentation: besides the new guide for tensor computations, two other new pages, linked in all the help pages of Physics commands, are
 a. Physics Updates organizes and presents in one place all formerly scattered links to updates and presentations with examples on the use of Physics.
 b. Mini-Course: Computer Algebra for Physicists, is a course that can be used as a tutorial, with 10 sections to be covered in 5 hands-on guided experiences of 2 hours each. The first part, 5 sections, is about Maple 101, while the remaining 5 sections is all about using the Physics package.

Overall, the enhancements throughout the entire package increase robustness, versatility and functionality, extending furthermore the range of Physics-related algebraic computations that can be done naturally in a worksheet. The presentation below illustrates both the novelties and the kind of mathematical formulations that can now be performed.

As part of its commitment to providing the best possible environment for algebraic computations in Physics, Maplesoft launched a Maple Physics: Research and Development website with Maple 18, which enabled users to download research versions, ask questions, and provide feedback. The results from this accelerated exchange with people around the world have been incorporated into the Physics package in Maple 2019. The Zassenhaus formula and the algebra of the Pauli matrices

The implementation of the Pauli matrices and their algebra were reviewed for Maple 2019, including the algebraic manipulation of nested commutators, resulting in faster computations using simpler and more flexible input. As it frequently happens, improvements of this type suddenly transform research problems presented in the literature as untractable in practice, into tractable.

As an illustration, we tackle below the derivation of the coefficients entering the Zassenhaus formula shown in section 4 of  for the Pauli matrices up to order 10 (results in the literature go up to order 5). The computation presented can be reused to compute these coefficients up to any desired higher-order (hardware limitations may apply). A number of examples which exploit this formula and its dual, the Baker-Campbell-Hausdorff formula, occur in connection with the Weyl prescription for converting a classical function to a quantum operator (see sec. 5 of ), as well as when solving the eigenvalue problem for classes of mathematical-physics partial differential equations . References

  R.M. Wilcox. "Exponential Operators and Parameter Differentiation in Quantum Physics", Journal of Mathematical Physics, V.8, 4, (1967.
  S. Steinberg. "Applications of the lie algebraic formulas of Baker, Campbell, Hausdorff, and Zassenhaus to the calculation of explicit solutions of partial differential equations". Journal of Differential Equations, V.26, 3, 1977.
  K. Huang. "Statistical Mechanics". John Wiley & Sons, Inc. 1963, p217, Eq.(10.60).

Formulation of the problem

The Zassenhaus formula expresses ${ⅇ}^{\mathrm{λ}\left({A}+{B}\right)}$ as an infinite product of exponential operators involving nested commutators of increasing complexity

Given ${A}$, ${B}$ and their commutator ${E}=\mathrm{%Commutator}\left(A,B\right)$, if ${A}$ and ${B}$ commute with ${E}$, ${{C}}_{n}=0$ for $n\ge 3$ and the Zassenhaus formula reduces to the product of the first three exponentials above. The interest here is in the general case, when $\mathrm{%Commutator}\left(A,E\right)\ne 0$ and $\mathrm{%Commutator}\left(B,E\right)\ne 0$, and the goal is to compute the Zassenhaus coefficients in terms of ${A}$, ${B}$ for arbitrary n. Following , in that general case, differentiating the Zassenhaus formula with respect to $\mathrm{λ}$ and multiplying from the right by  one obtains

This is an intricate formula, which however (see eq.(4.20) of ) can be represented in abstract form as

from where an equation to be solved for each ${{C}}_{n}$ is obtained by equating to 0 the coefficient of ${\mathrm{\lambda }}^{n-1}$. In this formula, the repeated commutator bracket is defined inductively in terms of the standard commutator by

and higher-order repeated-commutator brackets are similarly defined. For example, taking the coefficient of $\mathrm{λ}$ and ${\mathrm{λ}}^{2}$ and respectively solving each of them for ${{C}}_{2}$ and ${{C}}_{3}$ one obtains

${{C}}_{2}=-\frac{1}{2}\mathrm{%Commutator}\left(A,B\right)$

${{C}}_{3}=\frac{1}{6}\mathrm{%Commutator}\left(B,\mathrm{%Commutator}\left(A,B\right)\right)+\frac{1}{3}\mathrm{%Commutator}\left(B,\mathrm{%Commutator}\left(A,B\right)\right)$

This method is used in  to treat quantum deviations from the classical limit of the partition function for both a Bose-Einstein and Fermi-Dirac gas. The complexity of the computation of ${{C}}_{n}$ grows rapidly and in the literature only the coefficients up to ${{C}}_{5}$ have been published. Taking advantage of developments in the Physics package for Maple 2019, below we show the computation up to ${{C}}_{10}$ and provide a compact approach to compute them up to arbitrary order.

Computing up to ${{\mathbit{C}}}_{\mathbf{10}}$

Set the signature of spacetime such that its space part is equal to +++ and use lowercaselatin letters to represent space indices. Set also ${A}$, ${B}$ and ${{C}}_{n}$ to represent quantum operators

 >
 >
 $\mathrm{* Partial match of \text{'}}{}\mathrm{op}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumoperators}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumoperators}}{=}\left\{{A}{,}{B}{,}{C}\right\}{,}{\mathrm{signature}}{=}{\mathrm{+ + + -}}{,}{\mathrm{spaceindices}}{=}{\mathrm{lowercaselatin}}\right]$ (1)

To illustrate the computation up to ${{C}}_{10}$, a convenient example, where the commutator algebra is closed, consists of taking ${A}$ and ${B}$ as Pauli Matrices which, multiplied by the imaginary unit, form a basis for the $\mathrm{𝔰𝔲}\left(2\right)$group, which in turn exponentiate to the relevant Special Unitary Group $\mathrm{SU}\left(2\right)$. The algebra for the Pauli matrices involves a commutator and an anticommutator

 > $\mathrm{Library}:-\mathrm{DefaultAlgebraRules}\left(\mathrm{Psigma}\right)$
 ${\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{i}}{,}{{\mathrm{Psigma}}}_{{j}}\right){=}{2}{}{I}{}{{\mathrm{\epsilon }}}_{{i}{,}{j}{,}{k}}{}{{\mathrm{\sigma }}}_{{k}}{,}{\mathrm{%AntiCommutator}}{}\left({{\mathrm{Psigma}}}_{{i}}{,}{{\mathrm{Psigma}}}_{{j}}\right){=}{2}{}{{g}}_{{i}{,}{j}}$ (2)

Assign now ${A}$ and ${B}$ to two Pauli matrices, for instance

 > $A≔\mathrm{Psigma}\left[1\right]$
 ${A}{≔}{{\mathrm{\sigma }}}_{{1}}$ (3)
 > $B≔\mathrm{Psigma}\left[3\right]$
 ${B}{≔}{{\mathrm{\sigma }}}_{{3}}$ (4)

Next, to extract the coefficient of ${\mathrm{\lambda }}^{n}$ from

$0=\left({\sum }_{n=1}^{\mathrm{\infty }}\frac{{\mathrm{\lambda }}^{n}}{n!}\left\{{{A}}^{n},{B}\right\}\right)+2\mathrm{\lambda }\left({\sum }_{m=0}^{\mathrm{\infty }}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{n=0}^{\mathrm{\infty }}\frac{{\mathrm{\lambda }}^{n+m}}{n!m!}\left\{{{A}}^{m},{{B}}^{n},{{C}}_{2}\right\}\right)+3{\mathrm{\lambda }}^{2}\left({\sum }_{k=0}^{\mathrm{\infty }}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{m=0}^{\mathrm{\infty }}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{n=0}^{\mathrm{\infty }}\frac{{\mathrm{\lambda }}^{n+m+k}}{n!m!k!}\left\{{{A}}^{k},{{B}}^{m},{{{C}}_{2}}^{n},{{C}}_{3}\right\}\right)+...$

to solve it for ${{C}}_{n+1}$ we note that each term has a factor ${\mathrm{\lambda }}^{m}$ multiplying a sum, so we only need to take into account the first $n+1$ terms (sums) and in each sum replace $\mathrm{∞}$ by the corresponding $n-m$. For example, given to compute ${{C}}_{3}$ we only need to compute these first three terms:

$0=\left({\sum }_{n=1}^{2}\frac{{\mathrm{\lambda }}^{n}}{n!}\left\{{{A}}^{n},{B}\right\}\right)+2\mathrm{\lambda }\left({\sum }_{m=0}^{1}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{n=0}^{1}\frac{{\mathrm{\lambda }}^{n+m}}{n!m!}\left\{{{A}}^{m},{{B}}^{n},{{C}}_{2}\right\}\right)+3{\mathrm{\lambda }}^{2}\left({\sum }_{k=0}^{0}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{m=0}^{0}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\sum }_{n=0}^{0}\frac{{\mathrm{\lambda }}^{n+m+k}}{n!m!k!}\left\{{{A}}^{k},{{B}}^{m},{{{C}}_{2}}^{n},{{C}}_{3}\right\}\right)$

then solving for ${{C}}_{3}$ one gets ${{C}}_{3}=\frac{1}{3}\mathrm{%Commutator}\left(B,\mathrm{%Commutator}\left(A,B\right)\right)+\frac{1}{6}\mathrm{%Commutator}\left(A,\mathrm{%Commutator}\left(A,B\right)\right)$.

Also, since to compute ${{C}}_{n}$ we only need the coefficient of ${\mathrm{\lambda }}^{n-1}$, it is not necessary to compute all the terms of each multiple-sum. One way of restricting the multiple-sums to only one power of $\mathrm{\lambda }$ consists of using multi-index summation, available in the Physics package (see Physics:-Library:-Add). For that purpose, redefine sum to extend its functionality with multi-index summation

 >
 $\left[{\mathrm{redefinesum}}{=}{\mathrm{true}}\right]$ (5)

Now we can represent the same computation of ${{C}}_{3}$ without multiple sums and without computing unnecessary terms as

$0=\left({\sum }_{n=1}\frac{{\mathrm{\lambda }}^{n}}{n!}\left\{{{A}}^{n},{B}\right\}\right)+2\mathrm{\lambda }\left({\sum }_{n+m=1}\frac{{\mathrm{\lambda }}^{n+m}}{n!m!}\left\{{{A}}^{m},{{B}}^{n},{{C}}_{2}\right\}\right)+3{\mathrm{\lambda }}^{2}\left({\sum }_{n+m+k=0}\frac{{\mathrm{\lambda }}^{n+m+k}}{n!m!k!}\left\{{{A}}^{k},{{B}}^{m},{{{C}}_{2}}^{n},{{C}}_{3}\right\}\right)$

Finally, we need a computational representation for the repeated commutator bracket

One way of representing this commutator bracket operation is defining a procedure, say F, with a cache to avoid recomputing lower order nested commutators, as follows

 >
 ${F}{≔}{\mathbf{proc}}\left({A}{,}{B}{,}{n}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{cache}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{if}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{n}{::}{\mathrm{negint}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{0}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{n}{=}{0}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{B}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{n}{::}{\mathrm{posint}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{%Commutator}}{}\left({A}{,}{F}{}\left({A}{,}{B}{,}{n}{-}{1}\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{else}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{'}{F}{}\left({A}{,}{B}{,}{n}\right){'}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{fi}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end}}$ (6)

For example,

 > $F\left(A,B,1\right)$
 ${\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right)$ (7)
 > $F\left(A,B,2\right)$
 ${\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right)\right)$ (8)
 > $F\left(A,B,3\right)$
 ${\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right)\right)\right)$ (9)

We can set now the value of ${{C}}_{2}$

 > ${{C}}_{2}≔-\frac{1}{2}\mathrm{Commutator}\left(A,B\right)$
 ${{C}}_{{2}}{≔}{I}{}{{\mathrm{\sigma }}}_{{2}}$ (10)

and enter the formula that involves only multi-index summation

 > $H≔\left(\sum _{n=2}\frac{{\mathrm{\lambda }}^{n}}{n!}F\left({A},{B},n\right)\right)+2\mathrm{\lambda }\left(\sum _{n+m=1}\frac{{\mathrm{\lambda }}^{n+m}}{n!m!}F\left({A},F\left({B},{{C}}_{2},n\right),m\right)\right)+3{\mathrm{\lambda }}^{2}\left(\sum _{n+m+k=0}\frac{{\mathrm{\lambda }}^{n+m+k}}{n!m!k!}F\left({A},F\left({B},F\left({{C}}_{2},{{C}}_{3},n\right),m\right),k\right)\right)$
 $\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}{2}{}{\mathrm{λ}}{}\left({\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right){+}{\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right)\right){+}{3}{}{{\mathrm{λ}}}^{{2}}{}{{C}}_{{3}}$ (11)

from where we compute ${{C}}_{3}$ by solving for it the coefficient of ${\mathrm{\lambda }}^{2}$, and since due to the multi-index summation this expression already contains ${\mathrm{λ}}^{2}$ as a factor,

 >
 ${{C}}_{{3}}{=}{-}\frac{{4}{}{{\mathrm{\sigma }}}_{{1}}}{{3}}{+}\frac{{2}{}{{\mathrm{\sigma }}}_{{3}}}{{3}}$ (12)

In order to generalize the formula for H for higher powers of $\mathrm{λ}$, the right-hand side of the multi-index summation limit can be expressed in terms of an abstract N, and H transformed into a mapping:

 > $H≔\mathrm{unapply}\left(\left(\sum _{n=N}\frac{{\mathrm{\lambda }}^{n}}{n!}F\left({A},{B},n\right)\right)+2\mathrm{\lambda }\left(\sum _{n+m=N-1}\frac{{\mathrm{\lambda }}^{n+m}}{n!m!}F\left({A},F\left({B},{{C}}_{2},n\right),m\right)\right)+3{\mathrm{\lambda }}^{2}\left(\sum _{n+m+k=N-2}\frac{{\mathrm{\lambda }}^{n+m+k}}{n!m!k!}F\left({A},F\left({B},F\left({{C}}_{2},{{C}}_{3},n\right),m\right),k\right)\right),N\right)$
 ${H}{≔}{N}{↦}\frac{{{\mathrm{\lambda }}}^{{N}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{{\mathrm{\sigma }}}_{{3}}{,}{N}\right)}{{N}{!}}{+}{2}{}{\mathrm{\lambda }}{}\left({\sum }_{{n}{+}{m}{=}{N}{-}{1}}{}{{\mathrm{\lambda }}}^{{n}{+}{m}}{}\frac{{1}}{{n}{!}{}{m}{!}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{I}{}{{\mathrm{\sigma }}}_{{2}}{,}{n}\right){,}{m}\right)\right){+}{3}{}{{\mathrm{\lambda }}}^{{2}}{}\left({\sum }_{{n}{+}{m}{+}{k}{=}{N}{-}{2}}{}{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}}{}\frac{{1}}{{n}{!}{}{m}{!}{}{k}{!}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({I}{}{{\mathrm{\sigma }}}_{{2}}{,}{{C}}_{{3}}{,}{n}\right){,}{m}\right){,}{k}\right)\right)$ (13)

Now we have

 > $H\left(0\right)$
 ${{\mathrm{\sigma }}}_{{3}}$ (14)
 > $H\left(1\right)$
 ${\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right){+}{2}{}{I}{}{\mathrm{λ}}{}{{\mathrm{Psigma}}}_{{2}}$ (15)

The following is already equal to (11)

 > $H\left(2\right)$
 $\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}{2}{}{\mathrm{λ}}{}\left({\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right){+}{\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right)\right){+}{3}{}{{\mathrm{λ}}}^{{2}}{}{{C}}_{{3}}$ (16)

In this way, we can reproduce the results published in the literature for the coefficients of Zassenhaus formula up to ${{C}}_{5}$ by adding two more multi-index sums to (13). Unassign ${C}$ first

 > $\mathrm{unassign}\left(C\right)$
 > $H≔\mathrm{unapply}\left(\left(\sum _{n=N}\frac{{\mathrm{\lambda }}^{n}}{n!}F\left({A},{B},n\right)\right)+2\mathrm{\lambda }\left(\sum _{n+m=N-1}\frac{{\mathrm{\lambda }}^{n+m}}{n!m!}F\left({A},F\left({B},{{C}}_{2},n\right),m\right)\right)+3{\mathrm{\lambda }}^{2}\left(\sum _{n+m+k=N-2}\frac{{\mathrm{\lambda }}^{n+m+k}}{n!m!k!}F\left({A},F\left({B},F\left({{C}}_{2},{{C}}_{3},n\right),m\right),k\right)\right)+4{\mathrm{\lambda }}^{3}\left(\sum _{n+m+k+l=N-3}\frac{{\mathrm{\lambda }}^{n+m+k+l}}{n!m!k!l!}F\left({A},F\left({B},F\left({{C}}_{2},F\left({{C}}_{3},{{C}}_{4},n\right),m\right),k\right),l\right)\right)+5{\mathrm{\lambda }}^{4}\left(\sum _{n+m+k+l+p=N-4}\frac{{\mathrm{\lambda }}^{n+m+k+l+p}}{n!m!k!l!p!}F\left({A},F\left({B},F\left({{C}}_{2},F\left({{C}}_{3},F\left({{C}}_{4},{{C}}_{5},n\right),m\right),k\right),l\right),p\right)\right),N\right):$

We compute now up to ${{C}}_{5}$ in one go

 >
 ${{C}}_{{2}}{≔}{I}{}{{\mathrm{\sigma }}}_{{2}}$
 ${{C}}_{{3}}{≔}{-}\frac{{4}{}{{\mathrm{\sigma }}}_{{1}}}{{3}}{+}\frac{{2}{}{{\mathrm{\sigma }}}_{{3}}}{{3}}$
 ${{C}}_{{4}}{≔}\frac{{4}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{3}}{+}{{\mathrm{\sigma }}}_{{1}}{+}{2}{}{{\mathrm{\sigma }}}_{{3}}$
 ${{C}}_{{5}}{≔}{-}\frac{{16}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{3}}{-}\frac{{8}{}{{\mathrm{\sigma }}}_{{1}}}{{9}}{-}\frac{{158}{}{{\mathrm{\sigma }}}_{{3}}}{{45}}$ (17)

The nested-commutator expression solved in the last step for ${{C}}_{5}$ is

 > $H\left(4\right)$
 $\frac{{1}}{{24}}{}{{\mathrm{λ}}}^{{4}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}\right)\right)\right)\right){+}{2}{}{\mathrm{λ}}{}\left(\frac{{1}}{{6}}{}{{\mathrm{λ}}}^{{3}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right)\right)\right){+}\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{3}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right)\right)\right){+}\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{3}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right)\right)\right){+}\frac{{1}}{{6}}{}{{\mathrm{λ}}}^{{3}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{I}{}{{\mathrm{Psigma}}}_{{2}}\right)\right)\right)\right){+}{3}{}{{\mathrm{λ}}}^{{2}}{}\left(\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{\mathrm{%Commutator}}{}\left({I}{}{{\mathrm{Psigma}}}_{{2}}{,}{-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{\mathrm{%Commutator}}{}\left({I}{}{{\mathrm{Psigma}}}_{{2}}{,}{-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}\frac{{1}}{{2}}{}{{\mathrm{λ}}}^{{2}}{}{\mathrm{%Commutator}}{}\left({I}{}{{\mathrm{Psigma}}}_{{2}}{,}{\mathrm{%Commutator}}{}\left({I}{}{{\mathrm{Psigma}}}_{{2}}{,}{-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}\right)\right)\right){+}{4}{}{{\mathrm{λ}}}^{{3}}{}\left({\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{1}}{,}\frac{{4}}{{3}}{}{I}{}{{\mathrm{Psigma}}}_{{2}}{+}{{\mathrm{Psigma}}}_{{1}}{+}{2}{}{{\mathrm{Psigma}}}_{{3}}\right){+}{\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({{\mathrm{Psigma}}}_{{3}}{,}\frac{{4}}{{3}}{}{I}{}{{\mathrm{Psigma}}}_{{2}}{+}{{\mathrm{Psigma}}}_{{1}}{+}{2}{}{{\mathrm{Psigma}}}_{{3}}\right){+}{\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({I}{}{{\mathrm{Psigma}}}_{{2}}{,}\frac{{4}}{{3}}{}{I}{}{{\mathrm{Psigma}}}_{{2}}{+}{{\mathrm{Psigma}}}_{{1}}{+}{2}{}{{\mathrm{Psigma}}}_{{3}}\right){+}{\mathrm{λ}}{}{\mathrm{%Commutator}}{}\left({-}\frac{{4}}{{3}}{}{{\mathrm{Psigma}}}_{{1}}{+}\frac{{2}}{{3}}{}{{\mathrm{Psigma}}}_{{3}}{,}\frac{{4}}{{3}}{}{I}{}{{\mathrm{Psigma}}}_{{2}}{+}{{\mathrm{Psigma}}}_{{1}}{+}{2}{}{{\mathrm{Psigma}}}_{{3}}\right)\right){+}{5}{}{{\mathrm{λ}}}^{{4}}{}\left({-}\frac{{16}}{{3}}{}{I}{}{{\mathrm{Psigma}}}_{{2}}{-}\frac{{8}}{{9}}{}{{\mathrm{Psigma}}}_{{1}}{-}\frac{{158}}{{45}}{}{{\mathrm{Psigma}}}_{{3}}\right)$ (18)

With everything understood, we want now to extend these results generalizing them into an approach to compute an arbitrarily large coefficient ${{C}}_{n}$, then use that generalization to compute all the Zassenhaus coefficients up to ${{C}}_{10}$. To type the formula for H for higher powers of $\mathrm{λ}$ is however prone to typographical mistakes. The following is a program, using the Maple programming language, that produces these formulas for an arbitrary integer power of $\mathrm{λ}$:

This Formula program uses a sequence of summation indices with as much indices as the order of the coefficient ${{C}}_{n}$ we want to compute, in this case we need 10 of them

 >
 ${\mathrm{summation_indices}}{≔}{n}{,}{m}{,}{k}{,}{l}{,}{p}{,}{q}{,}{r}{,}{s}{,}{t}{,}{u}$ (19)

To avoid interference of the results computed in the loop (17), unassign ${C}$ again

 > $\mathrm{unassign}\left(C\right)$

Now the formulas typed by hand, used lines above to compute each of ${{C}}_{2}$, ${{C}}_{3}$ and ${{C}}_{5}$, are respectively constructed by the computer

 > $\mathrm{Formula}\left(A,B,C,2\right)$
 ${\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}{,}{n}\right)}{{\mathrm{factorial}}{}\left({n}\right)}{,}{n}{=}{N}\right){+}{2}{}{\mathrm{λ}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{{C}}_{{2}}{,}{n}\right){,}{m}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right)}{,}{n}{+}{m}{=}{N}{-}{1}\right)\right)$ (20)
 > $\mathrm{Formula}\left(A,B,C,3\right)$
 ${\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}{,}{n}\right)}{{\mathrm{factorial}}{}\left({n}\right)}{,}{n}{=}{N}\right){+}{2}{}{\mathrm{λ}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{{C}}_{{2}}{,}{n}\right){,}{m}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right)}{,}{n}{+}{m}{=}{N}{-}{1}\right)\right){+}{3}{}{{\mathrm{λ}}}^{{2}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}{+}{k}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{{C}}_{{3}}{,}{n}\right){,}{m}\right){,}{k}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right){}{\mathrm{factorial}}{}\left({k}\right)}{,}{n}{+}{m}{+}{k}{=}{N}{-}{2}\right)\right)$ (21)
 > $\mathrm{Formula}\left(A,B,C,5\right)$
 ${\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{{\mathrm{Psigma}}}_{{3}}{,}{n}\right)}{{\mathrm{factorial}}{}\left({n}\right)}{,}{n}{=}{N}\right){+}{2}{}{\mathrm{λ}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{{C}}_{{2}}{,}{n}\right){,}{m}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right)}{,}{n}{+}{m}{=}{N}{-}{1}\right)\right){+}{3}{}{{\mathrm{λ}}}^{{2}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}{+}{k}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{{C}}_{{3}}{,}{n}\right){,}{m}\right){,}{k}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right){}{\mathrm{factorial}}{}\left({k}\right)}{,}{n}{+}{m}{+}{k}{=}{N}{-}{2}\right)\right){+}{4}{}{{\mathrm{λ}}}^{{3}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}{+}{k}{+}{l}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{{C}}_{{4}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right){}{\mathrm{factorial}}{}\left({k}\right){}{\mathrm{factorial}}{}\left({l}\right)}{,}{n}{+}{m}{+}{k}{+}{l}{=}{N}{-}{3}\right)\right){+}{5}{}{{\mathrm{λ}}}^{{4}}{}\left({\mathrm{sum}}{}\left(\frac{{{\mathrm{λ}}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}}{}{F}{}\left({{\mathrm{Psigma}}}_{{1}}{,}{F}{}\left({{\mathrm{Psigma}}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{{C}}_{{5}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right)}{{\mathrm{factorial}}{}\left({n}\right){}{\mathrm{factorial}}{}\left({m}\right){}{\mathrm{factorial}}{}\left({k}\right){}{\mathrm{factorial}}{}\left({l}\right){}{\mathrm{factorial}}{}\left({p}\right)}{,}{n}{+}{m}{+}{k}{+}{l}{+}{p}{=}{N}{-}{4}\right)\right)$ (22)

Construct then the formula for ${{C}}_{10}$ and make it be a mapping with respect to N, as done for ${{C}}_{5}$ after (16)

 >
 ${H}{≔}{N}{↦}\left({\sum }_{{n}{=}{N}}{}\frac{{{\mathrm{\lambda }}}^{{n}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{{\mathrm{\sigma }}}_{{3}}{,}{n}\right)}{{n}{!}}\right){+}{2}{}{\mathrm{\lambda }}{}\left({\sum }_{{n}{+}{m}{=}{N}{-}{1}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{{C}}_{{2}}{,}{n}\right){,}{m}\right)}{{n}{!}{}{m}{!}}\right){+}{3}{}{{\mathrm{\lambda }}}^{{2}}{}\left({\sum }_{{n}{+}{m}{+}{k}{=}{N}{-}{2}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{{C}}_{{3}}{,}{n}\right){,}{m}\right){,}{k}\right)}{{n}{!}{}{m}{!}{}{k}{!}}\right){+}{4}{}{{\mathrm{\lambda }}}^{{3}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{=}{N}{-}{3}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{{C}}_{{4}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right)}{{n}{!}{}{m}{!}{}{k}{!}{}{l}{!}}\right){+}{5}{}{{\mathrm{\lambda }}}^{{4}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{+}{p}{=}{N}{-}{4}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{{C}}_{{5}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right)}{{n}{!}{}{m}{!}{}{k}{!}{}{l}{!}{}{p}{!}}\right){+}{6}{}{{\mathrm{\lambda }}}^{{5}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{=}{N}{-}{5}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{F}{}\left({{C}}_{{5}}{,}{{C}}_{{6}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right){,}{q}\right)}{{n}{!}{}{m}{!}{}{k}{!}{}{l}{!}{}{p}{!}{}{q}{!}}\right){+}{7}{}{{\mathrm{\lambda }}}^{{6}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{=}{N}{-}{6}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{F}{}\left({{C}}_{{5}}{,}{F}{}\left({{C}}_{{6}}{,}{{C}}_{{7}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right){,}{q}\right){,}{r}\right)}{{n}{!}{}{m}{!}{}{p}{!}{}{k}{!}{}{q}{!}{}{l}{!}{}{r}{!}}\right){+}{8}{}{{\mathrm{\lambda }}}^{{7}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{+}{s}{=}{N}{-}{7}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{+}{s}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{F}{}\left({{C}}_{{5}}{,}{F}{}\left({{C}}_{{6}}{,}{F}{}\left({{C}}_{{7}}{,}{{C}}_{{8}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right){,}{q}\right){,}{r}\right){,}{s}\right)}{{n}{!}{}{m}{!}{}{p}{!}{}{k}{!}{}{q}{!}{}{r}{!}{}{l}{!}{}{s}{!}}\right){+}{9}{}{{\mathrm{\lambda }}}^{{8}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{+}{s}{+}{t}{=}{N}{-}{8}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{+}{s}{+}{t}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{F}{}\left({{C}}_{{5}}{,}{F}{}\left({{C}}_{{6}}{,}{F}{}\left({{C}}_{{7}}{,}{F}{}\left({{C}}_{{8}}{,}{{C}}_{{9}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right){,}{q}\right){,}{r}\right){,}{s}\right){,}{t}\right)}{{n}{!}{}{m}{!}{}{p}{!}{}{k}{!}{}{q}{!}{}{s}{!}{}{r}{!}{}{l}{!}{}{t}{!}}\right){+}{10}{}{{\mathrm{\lambda }}}^{{9}}{}\left({\sum }_{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{+}{s}{+}{t}{+}{u}{=}{N}{-}{9}}{}\frac{{{\mathrm{\lambda }}}^{{n}{+}{m}{+}{k}{+}{l}{+}{p}{+}{q}{+}{r}{+}{s}{+}{t}{+}{u}}{}{F}{}\left({{\mathrm{\sigma }}}_{{1}}{,}{F}{}\left({{\mathrm{\sigma }}}_{{3}}{,}{F}{}\left({{C}}_{{2}}{,}{F}{}\left({{C}}_{{3}}{,}{F}{}\left({{C}}_{{4}}{,}{F}{}\left({{C}}_{{5}}{,}{F}{}\left({{C}}_{{6}}{,}{F}{}\left({{C}}_{{7}}{,}{F}{}\left({{C}}_{{8}}{,}{F}{}\left({{C}}_{{9}}{,}{{C}}_{{10}}{,}{n}\right){,}{m}\right){,}{k}\right){,}{l}\right){,}{p}\right){,}{q}\right){,}{r}\right){,}{s}\right){,}{t}\right){,}{u}\right)}{{n}{!}{}{m}{!}{}{t}{!}{}{p}{!}{}{k}{!}{}{q}{!}{}{s}{!}{}{r}{!}{}{l}{!}{}{u}{!}}\right)$ (23)

Compute now the coefficients of the Zassenhaus formula up to ${{C}}_{10}$ all in one go

 >
 ${{C}}_{{2}}{≔}{I}{}{{\mathrm{\sigma }}}_{{2}}$
 ${{C}}_{{3}}{≔}{-}\frac{{4}{}{{\mathrm{\sigma }}}_{{1}}}{{3}}{+}\frac{{2}{}{{\mathrm{\sigma }}}_{{3}}}{{3}}$
 ${{C}}_{{4}}{≔}\frac{{4}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{3}}{+}{{\mathrm{\sigma }}}_{{1}}{+}{2}{}{{\mathrm{\sigma }}}_{{3}}$
 ${{C}}_{{5}}{≔}{-}\frac{{16}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{3}}{-}\frac{{8}{}{{\mathrm{\sigma }}}_{{1}}}{{9}}{-}\frac{{158}{}{{\mathrm{\sigma }}}_{{3}}}{{45}}$
 ${{C}}_{{6}}{≔}\frac{{1078}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{405}}{+}\frac{{1030}{}{{\mathrm{\sigma }}}_{{1}}}{{81}}{-}\frac{{8}{}{{\mathrm{\sigma }}}_{{3}}}{{81}}$
 ${{C}}_{{7}}{≔}\frac{{11792}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{243}}{+}\frac{{358576}{}{{\mathrm{\sigma }}}_{{1}}}{{42525}}{+}\frac{{12952}{}{{\mathrm{\sigma }}}_{{3}}}{{135}}$
 ${{C}}_{{8}}{≔}\frac{{35837299048}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{17222625}}{+}\frac{{87277417}{}{{\mathrm{\sigma }}}_{{1}}}{{492075}}{+}\frac{{833718196}{}{{\mathrm{\sigma }}}_{{3}}}{{820125}}$
 ${{C}}_{{9}}{≔}{-}\frac{{449018539801088}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{104627446875}}{-}\frac{{263697596812424}{}{{\mathrm{\sigma }}}_{{1}}}{{996451875}}{+}\frac{{84178036928794306}{}{{\mathrm{\sigma }}}_{{3}}}{{2197176384375}}$
 ${{C}}_{{10}}{≔}\frac{{2185211616689851230363020476}{}{I}{}{{\mathrm{\sigma }}}_{{2}}}{{4204571658549609375}}{+}\frac{{3226624781090887605597040906}{}{{\mathrm{\sigma }}}_{{1}}}{{21022858292748046875}}{+}\frac{{200495118165066770268119656}{}{{\mathrm{\sigma }}}_{{3}}}{{200217698026171875}}$ (24)

Notes: with the material above you can compute higher order values of ${{C}}_{n}$. For that you need:

 1 Unassign ${C}$, as done above in two cases, to avoid interference of the results just computed.
 2 Indicate more summation indices in the sequence $\mathrm{summation_indices}$ in (19), as many as the maximum value of n in ${{C}}_{n}$.
 3 Have in mind that the growth in size and complexity is significant, with each ${{C}}_{n}$ taking significantly more time than the computation of all the previous ones.
 4 Re-execute the input line (23) and the loop (24). Multivariable Taylor series of expressions involving anticommutative (Grassmannian) variables

The Physics:-Gtaylor command, for computing Taylor series of expressions involving anticommutative variables, got rewritten, now as a multivariable Taylor series command (same difference as in between the taylor and mtaylor commands) and combining two different approaches to handle, when possible, the presence of noncommutative and anticommutative variables. One is the standard approach for multi-variable expansions, it requires that the derivative of each function entering the expression being expanded commutes with the function itself. The second approach, for expansions with respect to anticommutative variables, separates the function into a "Body" and a "Soul", as is standard in supermathematics.

Consider a set of anticommutative Grassmann variables $\mathrm{θ__i}$ with , forming a basis enlarged by their products, that satisfies , so that ${\mathrm{θ__i}}^{2}=0.$ The elements of the algebra involving these variables are linear combinations of the form

where the coefficients are complex numbers, ${a}^{\left(0\right)}$ is called the body and everything else, $a-{a}^{\left(0\right)}=\mathrm{nil}\left(a\right)$, is called the soul (nilpotent part).

Consider now a mapping (function) $f\left(a\right)$ which is assumed to be differentiable. Then $f\left(a\right)$ can be defined by its Taylor expansion,

That is the expansion computed by Gtaylor in Maple 2019.

Examples

 > $\mathrm{restart};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathrm{with}\left(\mathrm{Physics}\right):\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathrm{Setup}\left(\mathrm{anticommutativeprefix}=\left\{\mathrm{\Theta },\mathrm{\theta }\right\},\mathrm{quantumoperators}=\left\{\mathrm{\Theta },a\right\}\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}$
 $\left[{\mathrm{anticommutativeprefix}}{=}\left\{{\mathrm{\Theta }}{,}{\mathrm{\theta }}\right\}{,}{\mathrm{quantumoperators}}{=}\left\{{\mathrm{\Theta }}{,}{a}\right\}\right]$ (25)

Consider

 > $\frac{1}{1+\mathrm{θ__1}\mathrm{θ__2}+\mathrm{θ__1}}$
 $\frac{{1}}{{1}{+}\mathrm{θ__1}{}\mathrm{θ__2}{+}\mathrm{θ__1}}$ (26)

Step by step, (26) is the application of the mapping

 >
 ${f}{≔}{u}{↦}\frac{{1}}{{u}}$ (27)

to the element of the algebra

 >
 ${a}{≔}{1}{+}\mathrm{θ__1}{}\mathrm{θ__2}{+}\mathrm{θ__1}$ (28)

The body of ${a}$ is

 >
 ${\mathrm{body}}{≔}{1}$ (29)

The soul of ${a}$ is

 >
 ${\mathrm{soul}}{≔}\mathrm{θ__1}{}\mathrm{θ__2}{+}\mathrm{θ__1}$ (30)

and in view of

 >
 ${\left(\mathrm{θ__1}{}\mathrm{θ__2}{+}\mathrm{θ__1}\right)}^{{2}}{=}{0}$ (31)

for the expression (26), the Taylor expansion, mentioned in the introductory paragraph is

 >
 ${1}{-}\mathrm{θ__1}{}\mathrm{θ__2}{-}\mathrm{θ__1}$ (32)

The same computation, all in one go:

 > $\mathrm{Gtaylor}\left(\right)$
 ${1}{-}\mathrm{θ__1}{}\mathrm{θ__2}{-}\mathrm{θ__1}$ (33)
 • Gauss integrals in this domain, that is, integrals over the exponential of a quadratic form of Grassmann variables, yield the determinant of the coefficient matrix of the quadratic form. These integrals play an important role in applications of anticommutative variables.

Problem. Taking into account that, with regards to Grassmann variables, differentiation and integration are the same operation, recover the determinant of the coefficient matrix with dimension $N=3$

Define the coefficient matrix and construct the exponential

 >
 > $M≔\mathrm{Matrix}\left(N,\mathrm{symbol}=m\right)$
 $\left[\begin{array}{ccc}{m}_{1,1}& {m}_{1,2}& {m}_{1,3}\\ {m}_{2,1}& {m}_{2,2}& {m}_{2,3}\\ {m}_{3,1}& {m}_{3,2}& {m}_{3,3}\end{array}\right]$ (34)
 >
 $\left[\begin{array}{ccc}{\mathrm{θ}}_{4}& {\mathrm{θ}}_{5}& {\mathrm{θ}}_{6}\end{array}\right]$ (35)
 >
 $\left[\begin{array}{c}{\mathrm{θ}}_{1}\\ {\mathrm{θ}}_{2}\\ {\mathrm{θ}}_{3}\end{array}\right]$ (36)
 >
 ${{ⅇ}}^{{-}{{\mathrm{\theta }}}_{{1}}{}\left({{m}}_{{1}{,}{1}}{}{{\mathrm{\theta }}}_{{4}}{+}{{m}}_{{2}{,}{1}}{}{{\mathrm{\theta }}}_{{5}}{+}{{m}}_{{3}{,}{1}}{}{{\mathrm{\theta }}}_{{6}}\right){-}{{\mathrm{\theta }}}_{{2}}{}\left({{m}}_{{1}{,}{2}}{}{{\mathrm{\theta }}}_{{4}}{+}{{m}}_{{2}{,}{2}}{}{{\mathrm{\theta }}}_{{5}}{+}{{m}}_{{3}{,}{2}}{}{{\mathrm{\theta }}}_{{6}}\right){-}{{\mathrm{\theta }}}_{{3}}{}\left({{m}}_{{1}{,}{3}}{}{{\mathrm{\theta }}}_{{4}}{+}{{m}}_{{2}{,}{3}}{}{{\mathrm{\theta }}}_{{5}}{+}{{m}}_{{3}{,}{3}}{}{{\mathrm{\theta }}}_{{6}}\right)}$ (37)

The integral of this exponential can thus be obtained performing a multivariable Taylor series expansion, then differentiating (equivalent to integrating) with respect to the six ${{\mathrm{\theta }}}_{i}$ variables.

 > ${\mathrm{\Theta }}≔\left[{{\mathrm{\theta }}}_{1},{{\mathrm{\theta }}}_{2},{{\mathrm{\theta }}}_{3},{{\mathrm{\theta }}}_{4},{{\mathrm{\theta }}}_{5},{{\mathrm{\theta }}}_{6}\right]:$

To avoid the default behavior of discarding terms of order 6 or higher in ${\mathrm{\Theta }}$, as in the other series commands of the Maple system, indicate the order term to be $\mathrm{O}\left({{{\mathrm{\theta }}}_{i}}^{7}\right)$.

 > $\mathrm{Gtaylor}\left(,\mathrm{Θ},\mathrm{order}=7\right)$
 ${1}{-}{{m}}_{{2}{,}{2}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{5}}{-}{{m}}_{{1}{,}{2}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{4}}{-}{{m}}_{{3}{,}{1}}{}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{6}}{-}{{m}}_{{2}{,}{1}}{}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{5}}{-}{{m}}_{{1}{,}{1}}{}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{4}}{-}{{m}}_{{3}{,}{3}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{6}}{-}{{m}}_{{2}{,}{3}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{5}}{-}{{m}}_{{1}{,}{3}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{4}}{-}{{m}}_{{3}{,}{2}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{6}}{+}\left(\left({{m}}_{{1}{,}{1}}{}{{m}}_{{2}{,}{2}}{-}{{m}}_{{2}{,}{1}}{}{{m}}_{{1}{,}{2}}\right){}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{1}{,}{2}}{}{{m}}_{{2}{,}{3}}{+}{{m}}_{{1}{,}{3}}{}\left({{m}}_{{2}{,}{1}}{}{{m}}_{{3}{,}{2}}{-}{{m}}_{{3}{,}{1}}{}{{m}}_{{2}{,}{2}}\right){-}{{m}}_{{1}{,}{1}}{}{{m}}_{{3}{,}{2}}{}{{m}}_{{2}{,}{3}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{5}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{2}{,}{2}}{}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{2}}{}{{m}}_{{2}{,}{3}}\right){}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{5}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{1}{,}{2}}{}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{2}}{}{{m}}_{{1}{,}{3}}\right){}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{1}{,}{2}}{}{{m}}_{{2}{,}{3}}{+}{{m}}_{{2}{,}{2}}{}{{m}}_{{1}{,}{3}}\right){}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{5}}{+}\left({-}{{m}}_{{2}{,}{1}}{}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{2}{,}{3}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{5}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{1}{,}{1}}{}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{1}{,}{3}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{1}{,}{1}}{}{{m}}_{{2}{,}{3}}{+}{{m}}_{{2}{,}{1}}{}{{m}}_{{1}{,}{3}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{3}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{5}}{+}\left({-}{{m}}_{{2}{,}{1}}{}{{m}}_{{3}{,}{2}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{2}{,}{2}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{5}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{1}{,}{1}}{}{{m}}_{{3}{,}{2}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{1}{,}{2}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{6}}{+}\left({-}{{m}}_{{1}{,}{1}}{}{{m}}_{{2}{,}{2}}{+}{{m}}_{{2}{,}{1}}{}{{m}}_{{1}{,}{2}}\right){}{{\mathrm{\theta }}}_{{1}}{}{{\mathrm{\theta }}}_{{2}}{}{{\mathrm{\theta }}}_{{4}}{}{{\mathrm{\theta }}}_{{5}}$ (38)

Perform now the integration of the expanded exponential

 >
 $\left({{m}}_{{1}{,}{1}}{}{{m}}_{{2}{,}{2}}{-}{{m}}_{{2}{,}{1}}{}{{m}}_{{1}{,}{2}}\right){}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{1}{,}{2}}{}{{m}}_{{2}{,}{3}}{+}{{m}}_{{1}{,}{3}}{}\left({{m}}_{{2}{,}{1}}{}{{m}}_{{3}{,}{2}}{-}{{m}}_{{3}{,}{1}}{}{{m}}_{{2}{,}{2}}\right){-}{{m}}_{{1}{,}{1}}{}{{m}}_{{3}{,}{2}}{}{{m}}_{{2}{,}{3}}$ (39)

Compare with the determinant of the coefficient matrix M

 > $\mathrm{\Delta }≔\mathrm{LinearAlgebra}:-\mathrm{Determinant}\left(M\right)$
 ${\mathrm{\Delta }}{≔}{{m}}_{{1}{,}{1}}{}{{m}}_{{2}{,}{2}}{}{{m}}_{{3}{,}{3}}{-}{{m}}_{{1}{,}{1}}{}{{m}}_{{3}{,}{2}}{}{{m}}_{{2}{,}{3}}{-}{{m}}_{{2}{,}{1}}{}{{m}}_{{1}{,}{2}}{}{{m}}_{{3}{,}{3}}{+}{{m}}_{{3}{,}{1}}{}{{m}}_{{1}{,}{2}}{}{{m}}_{{2}{,}{3}}{+}{{m}}_{{2}{,}{1}}{}{{m}}_{{3}{,}{2}}{}{{m}}_{{1}{,}{3}}{-}{{m}}_{{3}{,}{1}}{}{{m}}_{{2}{,}{2}}{}{{m}}_{{1}{,}{3}}$ (40)
 > $\mathrm{normal}\left(\mathrm{Delta}-\right)$
 ${0}$ (41)
 • An example with fermionic annihilation and creation operators, typical from quantum field theory.

 >
 $\mathrm{* Partial match of \text{'}}{}\mathrm{op}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumoperators}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{anticommutativeprefix}}{=}\left\{{\mathrm{\Lambda }}{,}{\mathrm{\Theta }}{,}{\mathrm{\lambda }}{,}{\mathrm{\theta }}\right\}{,}{\mathrm{quantumoperators}}{=}\left\{{\mathrm{\Lambda }}{,}{\mathrm{\Theta }}{,}{a}\right\}\right]$ (42)

Define corresponding annihilation and creation operators

 >
 ${\mathrm{am}}{≔}{{a}}^{{-}}$ (43)
 >
 ${\mathrm{ap}}{≔}{{a}}^{{+}}$ (44)

Note that the anticommutator of these two operators is equal to 1 (so they don't anticommute)

 >
 ${\mathrm{%AntiCommutator}}{}\left({{a}}^{{-}}{,}{{a}}^{{+}}\right){=}{1}$ (45)

while they do anticommute with all Grassmann variables

 >
 ${\mathrm{%AntiCommutator}}{}\left({{a}}^{{-}}{,}{\mathrm{θ}}\right){=}{0}$ (46)
 >
 ${\mathrm{%AntiCommutator}}{}\left({{a}}^{{+}}{,}{\mathrm{λ}}\right){=}{0}$ (47)

and, because of Pauli's exclusion principle for fermions, the square of ${{a}}^{{+}}$ and ${{a}}^{{-}}$are equal to 0.

Consider now the product of exponentials

 >
 ${{ⅇ}}^{{\mathrm{\theta }}{}{{a}}^{{-}}}{}{{ⅇ}}^{{-}{\mathrm{\lambda }}{}{{a}}^{{+}}}$ (48)

Because the corresponding exponents ${\mathrm{\theta }}{{a}}^{{-}}$ and $-{\mathrm{\lambda }}{{a}}^{{+}}$ commute with their commutator, this product of exponentials can be combined using Hausdorff's formula

 >
 ${{ⅇ}}^{{\mathrm{\theta }}{}{{a}}^{{-}}}{}{{ⅇ}}^{{-}{\mathrm{\lambda }}{}{{a}}^{{+}}}{=}{{ⅇ}}^{{\mathrm{\theta }}{}{{a}}^{{-}}{-}{\mathrm{\lambda }}{}{{a}}^{{+}}{-}\frac{{\mathrm{\lambda }}{}{\mathrm{\theta }}}{{2}}}$ (49)

Both sides can be expanded in multivariable Taylor series, this time including the annihilation and creation operators as series variables since their commutation rules are all known ((45), (46), (47)) and their square is equal to 0:

 > $\mathrm{Gtaylor}\left(\right)$
 ${1}{-}{\mathrm{\lambda }}{}{{a}}^{{+}}{+}{\mathrm{\theta }}{}{{a}}^{{-}}{-}{\mathrm{\lambda }}{}{\mathrm{\theta }}{+}{\mathrm{\lambda }}{}{\mathrm{\theta }}{}{{a}}^{{+}}{}{{a}}^{{-}}{=}{1}{-}{\mathrm{\lambda }}{}{{a}}^{{+}}{+}{\mathrm{\theta }}{}{{a}}^{{-}}{-}{\mathrm{\lambda }}{}{\mathrm{\theta }}{+}{\mathrm{\lambda }}{}{\mathrm{\theta }}{}{{a}}^{{+}}{}{{a}}^{{-}}$ (50)

On the left-hand side is the product of the expansion of each exponential while on the right-hand side it is the expansion of the single exponential (no-trivially) combined taking into account the commutator of the exponents on the left-hand side. Verify that both expansions are one and the same:

 > $\mathrm{evalb}\left(\right)$
 ${\mathrm{true}}$ (51)
 • Both Gtaylor and diff now handle $\mathrm{Dagger}\left(\mathrm{θ}\right)$ as a differentiation or series variable in equal footing as ${\mathrm{\theta }}$ itself
 > $\mathrm{exp}\left(\mathrm{Dagger}\left(\mathrm{θ}\right){{a}}^{{-}}-{\mathrm{\theta }}{{a}}^{{+}}\right)$
 ${\mathrm{exp}}{}\left({\mathrm{*}}{}\left({\mathrm{Dagger}}{}\left({\mathrm{θ}}\right){,}{{a}}^{{-}}\right){-}{\mathrm{*}}{}\left({\mathrm{θ}}{,}{{a}}^{{+}}\right)\right)$ (52)
 > $=\mathrm{Gtaylor}\left(\right)$
 ${\mathrm{exp}}{}\left({\mathrm{*}}{}\left({\mathrm{Dagger}}{}\left({\mathrm{θ}}\right){,}{{a}}^{{-}}\right){-}{\mathrm{*}}{}\left({\mathrm{θ}}{,}{{a}}^{{+}}\right)\right){=}{1}{+}{\mathrm{*}}{}\left({\mathrm{Dagger}}{}\left({\mathrm{θ}}\right){,}{{a}}^{{-}}\right){-}{\mathrm{*}}{}\left({\mathrm{θ}}{,}{{a}}^{{+}}\right){+}\frac{{1}}{{2}}{}{\mathrm{*}}{}\left({\mathrm{Dagger}}{}\left({\mathrm{θ}}\right){,}{\mathrm{θ}}\right){-}{\mathrm{*}}{}\left({\mathrm{Dagger}}{}\left({\mathrm{θ}}\right){,}{\mathrm{θ}}{,}{{a}}^{{+}}{,}{{a}}^{{-}}\right)$ (53)
 > $\mathrm{diff}\left({,}{\mathrm{θ}},\mathrm{Dagger}\left(\mathrm{θ}\right)\right)$
 ${-}\frac{{1}}{{2}}{+}{{a}}^{{+}}{}{{a}}^{{-}}{=}{-}\frac{{1}}{{2}}{+}{{a}}^{{+}}{}{{a}}^{{-}}$ (54)
 • Depending on the case, multivariable Taylor expansions in the presence of not commutative variables can also be computed for functions of more than one variable and for unknown functions
 >
 ${F}{}\left({0}{,}{0}{,}{0}\right){+}{x}{}{{\mathrm{D}}}_{{1}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right){+}\frac{{{x}}^{{2}}{}{{\mathrm{D}}}_{{1}{,}{1}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right)}{{2}}{+}\left({x}{}{{\mathrm{D}}}_{{1}{,}{3}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right){+}{{\mathrm{D}}}_{{3}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right)\right){}{\mathrm{\lambda }}{+}\left({x}{}{{\mathrm{D}}}_{{1}{,}{2}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right){+}{{\mathrm{D}}}_{{2}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right)\right){}{\mathrm{\theta }}{+}{{\mathrm{D}}}_{{2}{,}{3}}{}\left({F}\right){}\left({0}{,}{0}{,}{0}\right){}{\mathrm{\lambda }}{}{\mathrm{\theta }}$ (55)
 >
 $\left[{\mathrm{noncommutativeprefix}}{=}\left\{{A}{,}{B}\right\}\right]$ (56)
 > $\mathrm{Gtaylor}\left({ⅇ}^{\left({A}+{B}\right)\mathrm{\delta }},\mathrm{\delta }=0,\mathrm{order}=3\right)$
 ${1}{+}{\mathrm{\delta }}{}\left({A}{+}{B}\right){+}\frac{{{\mathrm{\delta }}}^{{2}}{}{\left({A}{+}{B}\right)}^{{2}}}{{2}}$ (57)
 > New SortProducts command

A new command, SortProducts, receives an expression involving products and sorts the operands of these products according to the ordering indicated as the second argument, a list containing some or all of the operands of the product(s) found in the expression. The sorting of operands performed automatically takes into account any algebra rules set using Setup.

Examples

 > $\mathrm{restart};$
 > $\mathrm{with}\left(\mathrm{Physics}\right):$

Consider the product of the commutative $a,b,c,d$

 > $P≔abcd$
 ${P}{≔}{a}{}{b}{}{c}{}{d}$ (58)

Reorder the operands $c$ and $b$ "in place".

 > $\mathrm{SortProducts}\left(P,\left[c,b\right]\right)$
 ${a}{}{c}{}{b}{}{d}$ (59)

Sort the operands $b$ and $c$ and put them to the left, then to the right

 > $\mathrm{SortProducts}\left(P,\left[c,b\right],\mathrm{totheleft}\right)$
 ${c}{}{b}{}{a}{}{d}$ (60)
 > $\mathrm{SortProducts}\left(P,\left[c,b\right],\mathrm{totheright}\right)$
 ${a}{}{d}{}{c}{}{b}$ (61)

Set a prefix identifying noncommutative variables and related algebra rules for some of them, such that $\mathrm{Z1},\mathrm{Z2},\mathrm{Z3}$ and $\mathrm{Z4}$ commute between themselves, but none of them commute with $\mathrm{Z5}$.

 > $\mathrm{Setup}\left(\mathrm{noncommutativeprefix}=Z,\mathrm{%Commutator}\left(\mathrm{Z1},\mathrm{Z2}\right)=0,\mathrm{%Commutator}\left(\mathrm{Z1},\mathrm{Z3}\right)=0,\mathrm{%Commutator}\left(\mathrm{Z2},\mathrm{Z3}\right)=0,\mathrm{%Commutator}\left(\mathrm{Z3},\mathrm{Z4}\right)=0,\mathrm{%Commutator}\left(\mathrm{Z2},\mathrm{Z4}\right)=0,\mathrm{%Commutator}\left(\mathrm{Z1},\mathrm{Z4}\right)=0\right)$
 $\left[{\mathrm{algebrarules}}{=}\left\{{\mathrm{%Commutator}}{}\left({\mathrm{Z1}}{,}{\mathrm{Z2}}\right){=}{0}{,}{\mathrm{%Commutator}}{}\left({\mathrm{Z1}}{,}{\mathrm{Z3}}\right){=}{0}{,}{\mathrm{%Commutator}}{}\left({\mathrm{Z1}}{,}{\mathrm{Z4}}\right){=}{0}{,}{\mathrm{%Commutator}}{}\left({\mathrm{Z2}}{,}{\mathrm{Z3}}\right){=}{0}{,}{\mathrm{%Commutator}}{}\left({\mathrm{Z2}}{,}{\mathrm{Z4}}\right){=}{0}{,}{\mathrm{%Commutator}}{}\left({\mathrm{Z3}}{,}{\mathrm{Z4}}\right){=}{0}\right\}{,}{\mathrm{noncommutativeprefix}}{=}\left\{{Z}\right\}\right]$ (62)
 > $P≔\mathrm{Z1}\mathrm{Z2}\mathrm{Z3}\mathrm{Z4}$
 ${P}{≔}{\mathrm{Z1}}{}{\mathrm{Z2}}{}{\mathrm{Z3}}{}{\mathrm{Z4}}$ (63)

Sort Z2 and Z3 "in place".

 > $\mathrm{SortProducts}\left(P,\left[\mathrm{Z3},\mathrm{Z2}\right]\right)$
 ${\mathrm{Z1}}{}{\mathrm{Z3}}{}{\mathrm{Z2}}{}{\mathrm{Z4}}$ (64)
 > $\mathrm{SortProducts}\left(P,\left[\mathrm{Z3},\mathrm{Z2}\right],\mathrm{totheright}\right)$
 ${\mathrm{Z1}}{}{\mathrm{Z4}}{}{\mathrm{Z3}}{}{\mathrm{Z2}}$ (65)

The value of the commutator between Z1 and Z5 is not known to the system, so by default they are not sorted:

 > $\mathrm{SortProducts}\left(\mathrm{Z1}\mathrm{Z5},\left[\mathrm{Z5},\mathrm{Z1}\right]\right)$
 ${\mathrm{Z1}}{}{\mathrm{Z5}}$ (66)

Force their sorting using their commutator or anticommutator

 > $\mathrm{SortProducts}\left(\mathrm{Z1}\mathrm{Z5},\left[\mathrm{Z5},\mathrm{Z1}\right],\mathrm{usecommutator}\right)$
 ${\mathrm{*}}{}\left({\mathrm{Z5}}{,}{\mathrm{Z1}}\right){+}{\mathrm{Commutator}}{}\left({\mathrm{Z1}}{,}{\mathrm{Z5}}\right)$ (67)
 > $\mathrm{expand}\left(\right)$
 ${\mathrm{Z1}}{}{\mathrm{Z5}}$ (68)
 > $\mathrm{SortProducts}\left(\mathrm{Z1}\mathrm{Z5},\left[\mathrm{Z5},\mathrm{Z1}\right],\mathrm{useanticommutator}\right)$
 ${-}{\mathrm{*}}{}\left({\mathrm{Z5}}{,}{\mathrm{Z1}}\right){+}{\mathrm{AntiCommutator}}{}\left({\mathrm{Z1}}{,}{\mathrm{Z5}}\right)$ (69)
 > $\mathrm{expand}\left(\right)$
 ${\mathrm{Z1}}{}{\mathrm{Z5}}$ (70)

Enter the product of $P$ with $\mathrm{Z5}$ at the end (so, to the right of P) and sort it with $\mathrm{Z5}$ to the left. This is a case where $\mathrm{Z5}$ does not commute with any of the other operands. Compare the results with and without the option usecommutator,

 > $P≔P\mathrm{Z5}$
 ${P}{≔}{\mathrm{Z1}}{}{\mathrm{Z2}}{}{\mathrm{Z3}}{}{\mathrm{Z4}}{}{\mathrm{Z5}}$ (71)
 > $\mathrm{SortProducts}\left(P,\left[\mathrm{Z5},\mathrm{Z1}\right]\right)$