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:
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.
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".
Documentation: besides the new guide for tensor computations, two other new pages, linked in all the help pages of Physics commands, are
Physics Updates organizes and presents in one place all formerly scattered links to updates and presentations with examples on the use of Physics.
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.
Tensor product of Quantum States using Dirac's Bra-Ket Notation
Coherent States in Quantum Mechanics
The Zassenhaus formula and the algebra of the Pauli matrices
Multivariable Taylor series of expressions involving anticommutative (Grassmannian) variables
New SortProducts command
Documentation: "Physics updates", "A complete guide for performing tensor computations" and the "Mini-Course: Computer Algebra for Physicists"
Simplification of tensors, Pauli and Dirac matrices and KroneckerDelta
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 .
 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 ⅇλ⁢A+B as an infinite product of exponential operators involving nested commutators of increasing complexity
ⅇλ⁢A+B = ⅇλ⁢A⁢⋅ ⅇλ⁢B⁢⋅ ⅇλ2⁢C2⁢⋅ ⅇλ3⁢C3⁢⋅ ... = ⅇλ⁢A⁢⋅ ⅇλ⁢B⁢⋅ ⅇ−12⁢λ2⁢%Commutator⁡A,B⁢⋅ ⅇ16⁢λ3⁢%Commutator⁡B,%Commutator⁡A,B+2⋅%Commutator⁡A,%Commutator⁡A,B⁢⋅ ...
Given A, B and their commutator E=%Commutator⁡A,B, if A and B commute with E, Cn=0 for n≥3 and the Zassenhaus formula reduces to the product of the first three exponentials above. The interest here is in the general case, when %Commutator⁡A,E≠0 and %Commutator⁡B,E≠0, and the goal is to compute the Zassenhaus coefficients Cn in terms of A, B for arbitrary n. Following , in that general case, differentiating the Zassenhaus formula with respect to λ and multiplying from the right by ⅇ−λ A+B 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 Cn is obtained by equating to 0 the coefficient of λn−1. In this formula, the repeated commutator bracket is defined inductively in terms of the standard commutator %Commutator⁡A,B by
and higher-order repeated-commutator brackets are similarly defined. For example, taking the coefficient of λ and λ2 and respectively solving each of them for C2 and C3 one obtains
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 Cn grows rapidly and in the literature only the coefficients up to C5 have been published. Taking advantage of developments in the Physics package for Maple 2019, below we show the computation up to C10 and provide a compact approach to compute them up to arbitrary order.
Computing up to C10
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 Cn to represent quantum operators
Setupop=A,B,C,signature = `+++-`,spaceindices=lowercaselatin
* Partial match of 'op' against keyword 'quantumoperators'
quantumoperators=A,B,C,signature=+ + + -,spaceindices=lowercaselatin
To illustrate the computation up to C10, 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 𝔰𝔲2group, which in turn exponentiate to the relevant Special Unitary Group SU⁡2. The algebra for the Pauli matrices involves a commutator and an anticommutator
Assign now A and B to two Pauli matrices, for instance
Next, to extract the coefficient of λn from
to solve it for Cn+1 we note that each term has a factor λm multiplying a sum, so we only need to take into account the first n+1 terms (sums) and in each sum replace ∞ by the corresponding n−m. For example, given C2=−12⁢%Commutator⁡A,B, to compute C3 we only need to compute these first three terms:
then solving for C3 one gets C3=13⁢%Commutator⁡B,%Commutator⁡A,B+16⁢%Commutator⁡A,%Commutator⁡A,B.
Also, since to compute Cn we only need the coefficient of λ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 λ 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
Setupredefinesum = true
Now we can represent the same computation of C3 without multiple sums and without computing unnecessary terms as
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≔ procA,B,n option cache; if n∷negint then 0 elif n =0 then B elif n∷posint then %CommutatorA, FA,B,n−1 else 'FA,B,n' fi; end;
F≔procA,B,noptioncache;ifn::negintthen0elifn=0thenBelifn::posintthen%Commutator⁡A,F⁡A,B,n − 1else'F⁡A,B,n'fiend
We can set now the value of C2
and enter the formula that involves only multi-index summation
from where we compute C3 by solving for it the coefficient of λ2, and since due to the multi-index summation this expression already contains λ2 as a factor,
In order to generalize the formula for H for higher powers of λ, 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:
Now we have
The following is already equal to (11)
In this way, we can reproduce the results published in the literature for the coefficients of Zassenhaus formula up to C5 by adding two more multi-index sums to (13). Unassign C first
We compute now up to C5 in one go
for j to 4 do Cj+1 ≔ solvevalueHj,Cj+1 od;
The nested-commutator expression solved in the last step for C5 is
With everything understood, we want now to extend these results generalizing them into an approach to compute an arbitrarily large coefficient Cn, then use that generalization to compute all the Zassenhaus coefficients up to C10. To type the formula for H for higher powers of λ 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 λ:
This Formula program uses a sequence of summation indices with as much indices as the order of the coefficient Cn we want to compute, in this case we need 10 of them
summation_indices ≔ n, m, k, l, p, q, r, s, t, u
To avoid interference of the results computed in the loop (17), unassign C again
Now the formulas typed by hand, used lines above to compute each of C2, C3 and C5, are respectively constructed by the computer
Construct then the formula for C10 and make it be a mapping with respect to N, as done for C5 after (16)
H ≔ unapplyFormulaA,B,C,10,N
Compute now the coefficients of the Zassenhaus formula up to C10 all in one go
for j to 9 do Cj+1 ≔ solvevalueHj, Cj+1 od;
Notes: with the material above you can compute higher order values of Cn. For that you need:
Unassign C, as done above in two cases, to avoid interference of the results just computed.
Indicate more summation indices in the sequence summation_indices in (19), as many as the maximum value of n in Cn.
Have in mind that the growth in size and complexity is significant, with each Cn taking significantly more time than the computation of all the previous ones.
Re-execute the input line (23) and the loop (24).
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 θ__i with i=1.. n, forming a basis enlarged by their products, that satisfies θ__i⋅θ__j = −θ__j⋅θ__i, so that θ__i2=0. The elements of the algebra involving these variables are linear combinations of the form
where the coefficients a__ij ...m are complex numbers, a0 is called the body and everything else, a−a0=nila, is called the soul (nilpotent part).
Consider now a mapping (function) fa which is assumed to be differentiable. Then fa can be defined by its Taylor expansion,
fa=fa0+f⁡ 'a0⁢nil⁡a+12⁢f⁡ ' 'a0⁢nil⁡a2+ ...
That is the expansion computed by Gtaylor in Maple 2019.
Step by step, (26) is the application of the mapping
f ≔ u → 1u
to the element of the algebra
a ≔ 1+θ__1θ__2+θ__1
The body of a is
body ≔ evala,θ__1=0,θ__2=0
The soul of a is
soul ≔ a − body
and in view of
soul2: % = Expand%
for the expression (26), the Taylor expansion, mentioned in the introductory paragraph is
fbody + Dfbody ⋅ soul
The same computation, all in one go:
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
N ≔ 3:
expΘ__1·M · Θ__2
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 θi variables.
To avoid the default behavior of discarding terms of order 6 or higher in Θ, as in the other series commands of the Maple system, indicate the order term to be O⁡θi7.
Perform now the integration of the expanded exponential
Compare with the determinant of the coefficient matrix M
An example with fermionic annihilation and creation operators, typical from quantum field theory.
Setupadditionally, anticommutativeprefix = lambda, Lambda, op = Lambda
Define corresponding annihilation and creation operators
am ≔ AnnihilationΛ
ap ≔ CreationΛ
Note that the anticommutator of these two operators is equal to 1 (so they don't anticommute)
%AntiCommutator = AntiCommutatoram, ap
while they do anticommute with all Grassmann variables
%AntiCommutator = AntiCommutatoram, theta
%AntiCommutator = AntiCommutatorap, lambda
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
exptheta am exp−lambda ap
Because the corresponding exponents θ⁢a− and −λ⁢a+ commute with their commutator, this product of exponentials can be combined using Hausdorff's formula
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:
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:
Both Gtaylor and diff now handle Dagger⁡θ as a differentiation or series variable in equal footing as θ itself
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
GtaylorFx,θ,λ,order = 3
Setupnoncommutativeprefix = A, B
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.
Consider the product of the commutative a,b,c,d
Reorder the operands c and b "in place".
Sort the operands b and c and put them to the left, then to the right
Set a prefix identifying noncommutative variables and related algebra rules for some of them, such that Z1,Z2,Z3 and Z4 commute between themselves, but none of them commute with Z5.
Sort Z2 and Z3 "in place".
The value of the commutator between Z1 and Z5 is not known to the system, so by default they are not sorted:
Force their sorting using their commutator or anticommutator
Enter the product of P with Z5 at the end (so, to the right of P) and sort it with Z5 to the left. This is a case where Z5 does not commute with any of the other operands. Compare the results with and without the option usecommutator,