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 2018 has been the consolidation of the functionality introduced in previous releases, together with significant enhancements, mainly in the handling of differential (quantum or not) tensorial operators, new ways to minimize the number of tensor components taking its symmetries into account, automatic handling of collision of indices in tensorial expressions, automatic setting of the EnergyMomentum tensor when loading solutions to Einstein's equations from the database of solutions, automatic setting of the algebras for the Dirac, Pauli and Gell-Mann matrices when Physics is loaded, simplification of Dirac matrices, a new package Physics:-Cactus related to Numerical Relativity and several other improvements.
Taking all together, there are more than 300 enhancements throughout the entire package, increasing robustness, versatility and functionality, extending once more the range of Physics-related algebraic computations that can be done using computer algebra software, and in a natural way.
As part of its commitment to providing the best possible environment for algebraic computations in Physics, Maplesoft launched a Maple Physics: Research and Development web site 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 2018.
Automatic handling of collision of tensor indices in products
User defined algebraic differential operators
The Physics:-Cactus package for Numerical Relativity
Automatic setting of the EnergyMomentumTensor for metrics of the database of solutions to Einstein's equations
Minimize the number of tensor components according to its symmetries, relabel, redefine or count the number of independent tensor components
New functionality and display for inert names and inert tensors
Automatic setting of Dirac, Pauli and Gell-Mann algebras
Simplification of products of Dirac matrices
New Library routines to perform matrix operations in expressions involving spinors with omitted indices
Miscellaneous improvements
The design of products of tensorial expressions that have contracted indices got enhanced. The idea: repeated indices in certain subexpressions are actually dummies. So suppose Ta,b and Bb are tensors, then in Ttrace=Taaaa, a is just dummy, therefore Taaaa⁢Ba=Tbbbb⁢Ba is a well defined object. The new design automatically maps input like Taaaa⁢Ba into Tbbbb⁢Ba.
restart;
withPhysics: Setupspacetimeindices=lowercaselatin, quiet
spacetimeindices=lowercaselatin
DefineTa,b, Bb
Defined objects with tensor properties
Bb,γa,σa,Ta,b,∂a,ga,b,δa,b,εa,b,c,d
This shows the automatic handling of collision of indices
Ta,a Ba
Tbbbb⁢Ba
Ta,a2
Taaaa⁢Tbbbb
Consider now the case of three tensors
DefineAa,Ca
Aa,Bb,Ca,γa,σa,Ta,b,∂a,ga,b,δa,b,εa,b,c,d
Aa Ba Ca
Aa⁢Ba⁢Ca
The product above has indeed the index a repeated more than once, therefore none of its occurrences got automatically transformed into contravariant in the output, and Check detects the problem interrupting with an error message
Check
Error, (in Physics:-Check) wrong use of the summation rule for repeated indices: `a repeated 3 times`, in A[a]*B[a]*C[a]
However, it is now also possible to indicate, using parenthesis, that the product of two of these tensors actually form a subexpression, so that the following two tensorial expressions are well defined, where the dummy is automatically replaced making that explicit
Aa ⋅ Ba⋅ Ca
Ab⁢B⁢b⁢b⁢Ca
Aa⋅Ba ⋅ Ca
Aa⁢Bb⁢C⁢b⁢b
This change in design makes concretely simpler the use of indices in that it eliminates the need for manually replacing dummies. For example, consider the tensorial expression for the angular momentum in terms of the coordinates and momentum vectors, in 3 dimensions
Setupcoordinates = cartesian, dimension = 3, metric = euclidean,quiet
coordinatesystems=X,dimension=3,metric=1,1=1,2,2=1,3,3=1
Define Lj,pk respectively representing angular and linear momentum
DefineLj,pk
γa,Lj,σa,Xa,∂a,ga,b,pk,δa,b,εa,b,c
Introduce the tensorial expression for La
La = LeviCivitaa,b,c⋅Xb ⋅pc
La=εa,b,c⁢Xb⁢pc
The left-hand side has one free index, a, while the right-hand side has two dummy indices b and c
Check,all
The repeated indices per term are: ...,...,...; the free indices are: ...
∅,a=b,c,a
If we want to compute L→2=La2 we can now take the square of (11) directly, and the dummy indices on the right-hand side are automatically handled, there is now no need to manually substitute the repeated indices to avoid their collision
2
La2=εa,b,c⁢Xb⁢pc⁢εa,d,e⁢Xd⁢pe
The repeated indices on the right-hand side are now a,b,c,d,e
Check, all
a,∅=a,b,c,d,e,∅
A new keyword in Setup: differentialoperators, allows for defining differential operators (not necessarily linear) with respect to indicated differentiation variables, so that they are treated as noncommutative operands in products, as we do with paper and pencil. These user-defined differential operators can also be vectorial and/or tensorial or inert. When desired, one can use Library:-ApplyProductOfDifferentialOperators to transform the products in the function application of these operators. This new functionality is a generalization of the differential operators ∂μ and ▿μ, and can used beyond Physics.
A new routine Library:-GetDifferentiationVariables also acts on a differential operator and tells who are the corresponding differentiation variables
Example:
In Quantum Mechanics, in the coordinates representation, the component of the momentum operator along the x axis is given by the differential operator
p__x=−i ℏ∂∂x
The purpose of the exercises below is thus to derive the commutation rules, in the coordinates representation, between an arbitrary function of the coordinates and the related momentum, departing from the differential representation
pn=−i⁢ℏ⁢∂n
FX,p→−=ⅈ ℏ ∇FX
restart:withPhysics:withPhysicsVectors:interfaceimaginaryunit = i:
Start setting the problem:
all ofx,y,z,p__x,p__y,p__z are Hermitian operators
all of x,y,z commute between each other
tell the system only that the operators x, y, z are the differentiation variables of the corresponding (differential) operators p__x,p__y,p__z but do not tell what is the form of the operators
Setupmathematicalnotation = true,differentialoperators=p_,x,y,z,hermitianoperators=p,x,y,z,algebrarules=%Commutatorx,y=0,%Commutatorx,z=0,%Commutatory,z=0,quiet
algebrarules=x,y−=0,x,z−=0,y,z−=0,differentialoperators=p→,x,y,z,hermitianoperators=p,x,y,z,mathematicalnotation=true
Assuming F⁡X is a smooth function, the idea is to apply the commutator F⁡X,p→− to an arbitrary ket of the Hilbert space ψx,y,z, perform the operation explicitly after setting a differential operator representation for p→, and from there get the commutation rule between F⁡X and p→.
Start introducing the commutator, to proceed with full control of the operations we use the inert form %Commutator
aliasX = x,y,z:
CompactDisplayFX
F⁡X⁢will now be displayed as⁢F
%CommutatorFX,p_⋅Ketψ,X
F,p→−⁢ψx,y,z
For illustration purposes only (not necessary), expand this commutator
=expand
F,p→−⁢ψx,y,z=F⁢p→⁢ψx,y,z−p→⁢F⁢ψx,y,z
Note that p→, F⁡X and the ket ψx,y,z are operands in the products above and that they do not commute: we indicated that the coordinates x, y, z are the differentiation variables of p→. This emulates what we do when computing with these operators with paper and pencil, where we represent the application of a differential operator as a product operation.
This representation can be transformed into the (traditional in computer algebra) application of the differential operator when desired, as follows:
=Library:-ApplyProductsOfDifferentialOperators
F,p→−⁢ψx,y,z=F⁢p→⁡ψx,y,z−p→⁡F⁢ψx,y,z
Note that, in p→⁡F⁡X⁢ψx,y,z, the application of p→ is not expanded: at this point nothing is known about p→ , it is not necessarily a linear operator. In the Quantum Mechanics problem at hands, however, it is. So give now the operator p→ an explicit representation as a linear vectorial differential operator (we use the inert form %Nabla, ∇, to be able to proceed with full control one step at a time)
p_≔f→−ⅈ⋅ℏ⋅%Nablaf
p→≔f↦−ⅈ⁢ℏ⁢∇f
The expression (19) becomes
F,p→−⁢ψx,y,z=−ⅈ⁢ℏ⁢F⁢∇ψx,y,z+ⅈ⁢ℏ⁢∇F⁢ψx,y,z
Activate now the inert operator ∇ and simplify taking into account the algebra rules for the coordinate operators x,y−=0,x,z−=0,y,z−=0
Simplifyvalue
F,p→−⁢ψx,y,z=ⅈ⁢ℏ⁢i∧⁢Fx⁢ψx,y,z+ⅈ⁢ℏ⁢j∧⁢Fy⁢ψx,y,z+ⅈ⁢ℏ⁢k∧⁢Fz⁢ψx,y,z
To make explicit the gradient in disguise on the right-hand side, factor out the arbitrary ket ψx,y,z
Factor
F,p→−⁢ψx,y,z=ⅈ⁢ℏ⁢Fx⁢i∧+Fy⁢j∧+Fz⁢k∧⁢ψx,y,z
Combine now the expanded gradient into its inert (not-expanded) form
subsGradient=%GradientFX,
F,p→−⁢ψx,y,z=ⅈ⁢ℏ⁢∇F⁢ψx,y,z
Since (24) is true for all ψx,y,z, this ket can be removed from both sides of the equation. One can do that either taking coefficients (see Coefficients) or multiplying by the "formal inverse" of this ket, arriving at the (expected) form of the commutation rule between F⁡X and p→
⋅InverseKetψ,x,y,z
F,p→−=ⅈ⁢ℏ⁢∇F
Tensor notation, X__m,Pn−=ⅈ ℏ⁢gm,n
The computation rule for position and momentum, this time in tensor notation, is performed in the same way, just that, additionally, specify that the space indices to be used are lowercase Latin letters, and set the relationship between the differential operators and the coordinates directly using tensor notation. You can also specify that the metric is Euclidean, but that is not necessary: the default metric of the Physics package, a Minkowski spacetime, includes a 3D subspace that is Euclidean, and the default signature, (- - - +), is not a problem regarding this computation.
restart; withPhysics:interfaceimaginaryunit = i:
Setupmathematicalnotation=true,coordinates = cartesian,spaceindices = lowercaselatin,algebrarules=%Commutatorx,y=0,%Commutatorx,z=0,%Commutatory,z=0,hermitianoperators = X,P,p,differentialoperators=Pm,x,y,z,quiet
algebrarules=x,y−=0,x,z−=0,y,z−=0,coordinatesystems=X,differentialoperators=Pm,x,y,z,hermitianoperators=P,p,t,x,y,z,mathematicalnotation=true,spaceindices=lowercaselatin
Define now the tensor Pm
DefinePm,quiet
γμ,Pm,σμ,Xμ,∂μ,gμ,ν,γa,b,δμ,ν,εα,β,μ,ν
Introduce now the Commutator, this time in active form, to show how to reobtain the non-expanded form at the end by resorting the operands in products
CommutatorXm,Pn⋅Ketψ,x,y,z
Xm,Pn−⁢ψx,y,z
Expand first (not necessary) to see how the operator Pn is going to be applied
Xm,Pn−⁢ψx,y,z=Xm⁢Pn⁢ψx,y,z−Pn⁢Xm⁢ψx,y,z
Now expand and directly apply in one ago the differential operator Pn
Xm,Pn−⁢ψx,y,z=Xm⁢Pn⁡ψx,y,z−Pn⁡Xm⁢ψx,y,z
Introducing the explicit differential operator representation for Pn, here again using the inert ∂n to keep control of the computations step by step
Pn≔f→−ⅈ⋅ℏ⋅%d_nf
Pn≔f↦−ⅈ⁢ℏ⁢∂n⁡f
The expanded and applied commutator (30) becomes
Xm,Pn−⁢ψx,y,z=−ⅈ⁢ℏ⁢Xm⁢∂n⁡ψx,y,z+ⅈ⁢ℏ⁢∂n⁡Xm⁢ψx,y,z
Activate now the inert operators ∂n and simplify taking into account Einstein's rule for repeated indices
Xm,Pn−⁢ψx,y,z=ⅈ⁢ℏ⁢gm,n⁢ψx,y,z
Since the ket ψx,y,z is arbitrary, we can take coefficients (or multiply by the formal Inverse of this ket as done in the previous section). For illustration purposes, we use Coefficients and note how it automatically expands the commutator
Coefficients,Ketψ,x,y,z
Xm⁢Pn−Pn⁢Xm=ⅈ⁢ℏ⁢gm,n
One can undo this (frequently undesired) expansion of the commutator by sorting the products on the left-hand side using the commutator between Xm and Pn
Library:-SortProducts,Pn,Xm,usecommutator
Xm,Pn−=ⅈ⁢ℏ⁢gm,n
And that is the result we wanted to compute.
Additionally, to see this rule in matrix form,
TensorArray−
x,P1−=ⅈ⁢ℏx,P2−=0x,P3−=0y,P1−=0y,P2−=ⅈ⁢ℏy,P3−=0z,P1−=0z,P2−=0z,P3−=ⅈ⁢ℏ
In the above, we use equation (35) multiplied by -1 to avoid a minus sign in all the elements of (36), due to having worked with the default signature (- - - +); this minus sign is not necessary if in the Setup at the beginning one also sets signature=`+ + + -`
For display purposes, to see this matrix expressed in terms of the geometrical components of the momentum p→ , redefine the tensor Pn explicitly indicating its Cartesian components
DefinePm=p__x,p__y,p__z,quiet
x,p__x−=ⅈ⁢ℏx,p__y−=0x,p__z−=0y,p__x−=0y,p__y−=ⅈ⁢ℏy,p__z−=0z,p__x−=0z,p__y−=0z,p__z−=ⅈ⁢ℏ
Finally, in a typical situation, these commutation rules are to be taken into account in further computations, and for that purpose they can be added to the setup via
Setup
algebrarules=x,p__x−=ⅈ⁢ℏ,x,p__y−=0,x,p__z−=0,x,y−=0,x,z−=0,y,p__x−=0,y,p__y−=ⅈ⁢ℏ,y,p__z−=0,y,z−=0,z,p__x−=0,z,p__y−=0,z,p__z−=ⅈ⁢ℏ
For example, from herein computations are performed taking into account that
%Commutator = Commutatorx, p__x
x,p__x−=ⅈ⁢ℏ
There are 991 metrics in the database of solutions to Einstein's equations, based on the book "Exact solutions to Einstein's equations". One can check this number via
nopsDifferentialGeometry:-Library:-RetrieveStephani,1
991
For the majority of these solutions, the book also presents, explicit or implicitly, the form of the Energy-Momentum tensor. New in Maple 2018, we added to the database one more entry indicating the components of the corresponding EnergyMomentum tensor, covering, in Maple 2018.0, 686 out of these 991 solutions.
The design of the EnergyMomentum tensor got slightly adjusted to take these new database entries into account, so that when you load one of these solutions, if the corresponding entry for the EnergyMomentumTensor is already in the database, it is automatically loaded together with the solution.
In addition, it is now possible to define the tensor components using the Define command, or redefine any of its components using the new Library:-RedefineTensorComponent routine (see Physics,Library)
Examples
restart; withPhysics:
Consider the metric of Chapter 12, equation number 16.1
g_12,18,1
Systems of spacetime Coordinates are: X=τ,r,θ,φ
Default differentiation variables for d_, D_ and dAlembertian are: X=τ,r,θ,φ
The Bertotti (1959), Kramer (1978), Levi-Civita (1917), Robinson (1959) metric in coordinates τ,r,θ,φ
Parameters: k,κ0,β
Resetting the signature of spacetime from "- - - +" to `- + + +` in order to match the signature in the database of metrics:
gμ,ν=−k2r20000k2r20000k20000k2⁢sin⁡θ2
New, the covariant components of the EnergyMomentum tensor got automatically loaded, given by
EnergyMomentum
Τμ,ν=1r2⁢κ00000−1r2⁢κ000001κ00000sin⁡θ2κ0
One can verify this checking for the tensor's definition
EnergyMomentumdefinition
Τμ,ν=Gμ,ν8⁢π,Τ⁢μ,ν⁢μ,ν=r2k4⁢κ00000−r2k4⁢κ000001k4⁢κ000001k4⁢sin⁡θ2⁢κ0
Take now the tensor components of the first defining equation of (44)
TensorArray1,simplifier=simplify
1r2⁢κ0=18⁢r2⁢π0=00=00=00=0−1r2⁢κ0=−18⁢r2⁢π0=00=00=00=01κ0=18⁢π0=00=00=00=0sin⁡θ2κ0=sin⁡θ28⁢π
where κ0=8 π is related to Newton's constant.
To see the continuity equations for the components of Τμ,ν, use for instance the inert version of the covariant derivative operator D_ and the TensorArray command
%D_mu=D_muEnergyMomentummu,nu
▿μ⁡Τ⁢μν⁢μν=0
TensorArray
∂1⁡−1k2⁢κ0+∂2⁡0+∂3⁡0+∂4⁡0=0∂1⁡0+∂2⁡−1k2⁢κ0+∂3⁡0+∂4⁡0=0∂1⁡0+∂2⁡0+∂3⁡1k2⁢κ0+∂4⁡0=0∂1⁡0+∂2⁡0+∂3⁡0+∂4⁡1k2⁢κ0=0
value
0=00=00=00=0
The EnergyMomentum tensor can also be (re)defined in any particular way (a correct definition must satisfy ▿μΤ⁢μν⁢μν=0).
Define the EnergyMomentum tensor indicating the functionality in the definition in terms of W to be constant energy (i.e. no functionality) and the flux density Sμ and stress σμ,ν tensors depending on X. For this purpose, use the new option minimizetensorcomponents to make explicit the symmetry of the stress tensor σμ,ν
DefineSmu, sigmamu,nu,symmetric, minimizetensorcomponents
▿μ,γμ,σμ,Rμ,ν,Rμ,ν,α,β,Sμ,Cμ,ν,α,β,Xμ,∂μ,gμ,ν,σμ,ν,Γμ,ν,α,Gμ,ν,Τμ,ν,δμ,ν,εα,β,μ,ν
The symmetry of σμ,ν is now explicit in that its matrix form is symmetric
sigma
σμ,ν=σ1,1σ1,2σ1,3σ1,4σ1,2σ2,2σ2,3σ2,4σ1,3σ2,3σ3,3σ3,4σ1,4σ2,4σ3,4σ4,4
The new routines for testing tensor symmetries
Library:-IsTensorialSymmetricsigmamu,nu
true
The symmetry is regarding interchanging positions of the 1st and 2nd indices
Library:-GetTensorSymmetryPropertiessigma
1,2,∅
So this is the form of the EnergyMomentum with all its components - but for the total energy - depending on the coordinates
EnergyMomentumμ,ν=Matrix⁡4,μ,ν→ifμ=4thenifν=4thenWelseSν⁡Xfielifν=4thenSμ⁡Xelseσμ,ν⁡Xfi
Τμ,ν=σ1,1⁡Xσ1,2⁡Xσ1,3⁡XS1⁡Xσ2,1⁡Xσ2,2⁡Xσ2,3⁡XS2⁡Xσ3,1⁡Xσ3,2⁡Xσ3,3⁡XS3⁡XS1⁡XS2⁡XS3⁡XW
CompactDisplay⁡
S⁡X⁢will now be displayed as⁢S
sigma⁡X⁢will now be displayed as⁢σ
Define now Τμ,ν with these components
Define⁡
Τμ,ν=σ1,1σ1,2σ1,3S1σ1,2σ2,2σ2,3S2σ1,3σ2,3σ3,3S3S1S2S3W
To see the continuity equations for the components of Τμ,ν, use again the inert version of the covariant derivative operator D_ and the TensorArray command
%D_μ=D_μ⁡EnergyMomentumμ,ν
For a more convenient reading, present the result as a vector column
Vectorcolumn⁡TensorArray⁡
∂1⁡−r2⁢σ1,1k2+∂2⁡r2⁢σ1,2k2+∂3⁡σ1,3k2+∂4⁡S1k2⁢sin⁡θ2−2⁢r⁢σ1,2k2+cos⁡θ⁢σ1,3sin⁡θ⁢k2=0∂1⁡−r2⁢σ1,2k2+∂2⁡r2⁢σ2,2k2+∂3⁡σ2,3k2+∂4⁡S2k2⁢sin⁡θ2−r⁢σ1,1k2−r⁢σ2,2k2+cos⁡θ⁢σ2,3sin⁡θ⁢k2=0∂1⁡−r2⁢σ1,3k2+∂2⁡r2⁢σ2,3k2+∂3⁡σ3,3k2+∂4⁡S3k2⁢sin⁡θ2−cos⁡θ⁢Wsin⁡θ3⁢k2−2⁢r⁢σ2,3k2+cos⁡θ⁢σ3,3sin⁡θ⁢k2=0∂1⁡−r2⁢S1k2+∂2⁡r2⁢S2k2+∂3⁡S3k2+∂4⁡Wk2⁢sin⁡θ2+cos⁡θ⁢S3sin⁡θ⁢k2−2⁢r⁢S2k2=0
Comparing the specific form (43) for the EnergyMomentum loaded from the database of solutions to Einstein's equations with the general form (56), one can ask the formal question of whether there are other forms for the EnergyMomentum satisfying the continuity equations (58).
To answer that question, rewrite this system of equations for the flux density Sμ and stress σμ,ν tensors as a set, and solve it for them
convertvalue,setofequations
−r2⁢S1τk2+2⁢r⁢S2+r2⁢S2rk2+S3θk2+cos⁡θ⁢S3sin⁡θ⁢k2−2⁢r⁢S2k2=0,−r2⁢σ1,1τk2+2⁢r⁢σ1,2+r2⁢σ1,2rk2+σ1,3θk2+S1φk2⁢sin⁡θ2−2⁢r⁢σ1,2k2+cos⁡θ⁢σ1,3sin⁡θ⁢k2=0,−r2⁢σ1,2τk2+2⁢r⁢σ2,2+r2⁢σ2,2rk2+σ2,3θk2+S2φk2⁢sin⁡θ2−r⁢σ1,1k2−r⁢σ2,2k2+cos⁡θ⁢σ2,3sin⁡θ⁢k2=0,−r2⁢σ1,3τk2+2⁢r⁢σ2,3+r2⁢σ2,3rk2+σ3,3θk2+S3φk2⁢sin⁡θ2−cos⁡θ⁢Wsin⁡θ3⁢k2−2⁢r⁢σ2,3k2+cos⁡θ⁢σ3,3sin⁡θ⁢k2=0
This system in fact admits much more general solutions than (43):
pdsolve
S1=S1,S2=S2,S3=∫r2⁢S1τ⁢sin⁡θ−sin⁡θ⁢S2r⁢r2ⅆθ+_F1⁡τ,r,φsin⁡θ,σ1,1=σ1,1,σ1,2=∫−σ1,1τ⁢cos⁡θ2⁢r2−r2⁢σ1,1τ+cos⁡θ⁢σ1,3⁢sin⁡θ−σ1,3θ⁢cos⁡θ2+σ1,3θ+S1φr2⁢sin⁡θ2ⅆr+_F2⁡τ,θ,φ,σ1,3=σ1,3,σ2,2=∫r2⁢_F2τ⁢cos⁡4⁢θ+4⁢∫r2⁢σ1,1τ,τ⁢cos⁡2⁢θ−r2⁢σ1,1τ,τ−σ1,3τ,θ⁢cos⁡2⁢θ+σ1,3τ⁢sin⁡2⁢θ+σ1,3τ,θ+2⁢S1φ,τ2⁢r2ⅆr⁢r2⁢cos⁡2⁢θ−4⁢r2⁢_F2τ⁢cos⁡2⁢θ+r⁢σ1,1⁢cos⁡4⁢θ−4⁢r⁢σ1,1⁢cos⁡2⁢θ−4⁢∫r2⁢σ1,1τ,τ⁢cos⁡2⁢θ−r2⁢σ1,1τ,τ−σ1,3τ,θ⁢cos⁡2⁢θ+σ1,3τ⁢sin⁡2⁢θ+σ1,3τ,θ+2⁢S1φ,τ2⁢r2ⅆr⁢r2+3⁢r2⁢_F2τ+4⁢S2φ⁢cos⁡2⁢θ−_F3θ⁢cos⁡4⁢θ+_F3⁡τ,θ,φ⁢sin⁡4⁢θ−8⁢cos⁡θ⁢∫3⁢r2⁢σ1,3τ⁢sin⁡θ−σ1,3τ⁢r2⁢sin⁡3⁢θ+4⁢r2⁢∫sin⁡θ⁢S2φ,r−sin⁡θ⁢S1φ,τⅆθ−3⁢σ3,3θ⁢sin⁡θ−cos⁡θ⁢σ3,3+σ3,3⁢cos⁡3⁢θ+σ3,3θ⁢sin⁡3⁢θ+4⁢cos⁡θ⁢W−4⁢_F1φ4⁢r2ⅆr+4⁢_F3θ⁢cos⁡2⁢θ−2⁢_F3⁡τ,θ,φ⁢sin⁡2⁢θ+3⁢r⁢σ1,1−4⁢S2φ−8⁢∫σ1,3τ,θ⁢r2⁢cos⁡4⁢θ−4⁢σ1,3τ,θ⁢r2⁢cos⁡2⁢θ−4⁢S2φ,r⁢r2⁢cos⁡2⁢θ+4⁢S1φ,τ⁢r2⁢cos⁡2⁢θ−24⁢r2⁢∫sin⁡θ⁢S2φ,r−sin⁡θ⁢S1φ,τⅆθ⁢cos⁡θ+3⁢σ1,3τ,θ⁢r2+4⁢S2φ,r⁢r2−4⁢S1φ,τ⁢r2−σ3,3θ,θ⁢cos⁡4⁢θ+4⁢σ3,3θ,θ⁢cos⁡2⁢θ+σ3,3θ⁢sin⁡4⁢θ−4⁢σ3,3⁢cos⁡2⁢θ−2⁢σ3,3θ⁢sin⁡2⁢θ+24⁢_F1φ⁢cos⁡θ−8⁢W⁢cos⁡2⁢θ−3⁢σ3,3θ,θ+4⁢σ3,3−16⁢W8⁢r2ⅆr−3⁢_F3θr⁢−4⁢cos⁡2⁢θ+3+cos⁡4⁢θⅆr+_F4⁡τ,θ,φr,σ2,3=∫−σ1,3τ⁢sin⁡θ⁢cos⁡θ2⁢r2+r2⁢σ1,3τ⁢sin⁡θ+σ3,3θ⁢sin⁡θ⁢cos⁡θ2+σ3,3⁢cos⁡θ3+r2⁢∫sin⁡θ⁢S2φ,r−S1φ,τⅆθ−σ3,3θ⁢sin⁡θ−cos⁡θ⁢σ3,3+cos⁡θ⁢W−_F1φr2⁢sin⁡θ3ⅆr+_F3⁡τ,θ,φ,σ3,3=σ3,3
This solution can be verified in different ways, for instance using pdetest showing it cancels the PDE system (59) for Sμ and stress σμ,ν
pdetest,
0
Minimize the number of tensor components according to its symmetries, and relabel, redefine or count the number of independent tensor components
A new keyword in Define and Setup: minimizetensorcomponents, allows for automatically minimizing the number of tensor components taking into account the tensor symmetries. For example, if a 2-tensor in a 4D spacetime is defined a antisymmetric, the number of different tensor components is 6, and the elements of the diagonal are automatically set equal to 0. After setting this keyword to true with Setup, all subsequent definitions of tensors automatically minimize the number of components while using this keyword with Define makes this minimization only happen with the tensors being defined in the call to Define.
Related to this new functionality, 4 new Library routines were added: MinimizeTensorComponents, NumberOfIndependentTensorComponents, RelabelTensorComponents and RedefineTensorComponents
Define an antisymmetric tensor with two indices
DefineFmu,nu,antisymmetric
γμ,Fμ,ν,σμ,∂μ,gμ,ν,δμ,ν,εα,β,μ,ν
Although the system knows that Fμ,ν is antisymmetric,
Fmu,nu + Fnu,mu
Fμ,ν+Fν,μ
Simplify
by default the components of Fμ,ν do not automatically reflect that, it is necessary to use the simplifier of the Physics package, Simplify
F1,2 + F2,1
F1,2+F2,1
Likewise, computing the array form of Fμ,ν we do not see the elements of the diagonal equal to 0, nor the lower-left triangle equal to the upper-right triangle but with a different sign:
TensorArrayFmu,nu
F1,1F1,2F1,3F1,4F2,1F2,2F2,3F2,4F3,1F3,2F3,3F3,4F4,1F4,2F4,3F4,4
This new functionality, here called minimizetensorcomponents, makes the symmetries of the tensor explicitly reflected in its components. There are three ways to use it. First, one can minimize the number of tensor components of a tensor previously defined. For example
Library:-MinimizeTensorComponentsF
0F1,2F1,3F1,4−F1,20F2,3F2,4−F1,3−F2,30F3,4−F1,4−F2,4−F3,40
After this, both (63) and (64) are automatically equal to 0 without having to use Simplify
And the output of TensorArray in (67) becomes equal to (68).
NOTE: after using minimizetensorcomponents in the definition of a tensor, say F, all the keywords implemented for Physics tensors are available for the F:
F
Fμ,ν=0F1,2F1,3F1,4−F1,20F2,3F2,4−F1,3−F2,30F3,4−F1,4−F2,4−F3,40
Ftrace
Fnonzero
Fμ,ν=1,2=F1,2,1,3=F1,3,1,4=F1,4,2,1=−F1,2,2,3=F2,3,2,4=F2,4,3,1=−F1,3,3,2=−F2,3,3,4=F3,4,4,1=−F1,4,4,2=−F2,4,4,3=−F3,4
F~1,mu,matrix
F⁢1μ⁢1μ=0−F1,2−F1,3−F1,4
Alternatively, one can define a tensor, specifying that the symmetries should be taken into account to minimize the number of its components passing the keyword minimizetensorcomponents to Define.
Define a tensor with the symmetries of the Riemann tensor, that is, a tensor of 4 indices that is symmetric with respect to interchanging the positions of the 1st and 2nd pair of indices and antisymmetric with respect to interchanging the position of its 1st and 2nd indices, or 3rd and 4th indices, and minimizing the number of tensor components
DefineRalpha,beta,mu,nu, symmetric=1,2,3,4, antisymmetric = 1,2,3,4,minimizetensorcomponents
γμ,Fμ,ν,σμ,Rμ,ν,α,β,∂μ,gμ,ν,δμ,ν,εα,β,μ,ν
R1,2,3,4 + R2,1,3,4
Ralpha,beta,mu,nu − Rmu,nu,alpha,beta
One can always retrieve the symmetry properties in the abstract notation used by the Define command using the new Library:-GetTensorSymmetryProperties, its output is ordered, first the symmetric then the antisymmetric properties
Library:-GetTensorSymmetryPropertiesR
1,2,3,4,1,2,3,4
After making the symmetries explicit (and also before that), it frequently s useful to know the number of independent components of a given tensor. For this purpose use the new Library:-NumberOfIndependentTensorComponents
Library:-NumberOfIndependentTensorComponentsR
21
and besides the symmetries, in the case of the Riemann tensor after taking into account the first Bianchi identity, this number of components is further reduced to 20.
A third way of using the new minimizetensorcomponents functionality is using Setup, so that every subsequent definition of tensors with symmetries is automatically performed minimizing the number of components.
Setupminimizetensorcomponents = true
minimizetensorcomponents=true
You can now define without having to include the keyword minimizetensorcomponents in the definition of tensors with symmetries
DefineCalpha,beta,antisymmetric
Cμ,ν,γμ,Fμ,ν,σμ,Rμ,ν,α,β,∂μ,gμ,ν,δμ,ν,εα,β,μ,ν
C
Cμ,ν=0C1,2C1,3C1,4−C1,20C2,3C2,4−C1,3−C2,30C3,4−C1,4−C2,4−C3,40
Two new related functionalities are provided via Library:-RelabelTensorComponents and Library:-RedefineTensorComponent, the first one to have the number of tensor components directly reflected in the names of the components, the second one to redefine only one of these components
Library:-RelabelTensorComponentsC
0C__1C__2C__3−C__10C__4C__5−C__2−C__40C__6−C__3−C__5−C__60
Suppose now we want to make one of these components equal to 1, say C__2
Library:-RedefineTensorComponentC1 ,2 = 1
Cμ,ν=01C__2C__3−10C__4C__5−C__2−C__40C__6−C__3−C__5−C__60
New: as part of the developments of Physics bug regardless of loading the Physics package, inert names are now typeset in gray, the standard for inert functions, with copy & paste working
%x
x
2⋅%x
2⁢x
Note that this was already in place in previous releases regarding inert functions but not regarding inert names. Regarding inert functions, since Maple 2016 their typesetting is also in grey with copy & paste working
%fx
f⁡x
Regarding Physics, having the right typeset also for symbols and tensor names is particularly relevant now that one can compute with differential operators as operands of a product.
withPhysics: withVectors:
Setupop=p_,x,y,z,differentialoperators = p_, x,y,z
* Partial match of 'op' against keyword 'quantumoperators'
differentialoperators=p→,x,y,z,quantumoperators=p→,x,y,z
The active and inert representations of the same differential-vectorial operator are
p_ = %p_
p→=p→
Hence, you can:
a) assign a mapping to p_ while represent it using %p_ when you do not want the mapping to be applied.
b) using %p_ has mathematical and clear typesetting (in gray always means inert) making its use more pleasant / easy to read.
interfaceimaginaryunit=i:
Assign a procedure to the differential-vectorial operator p→
Apply both the active and the inert operators to some function of the coordinates
%p_ = p_⋅ fx,y,z
p→⁢f⁡x,y,z=p→⁢f⁡x,y,z
Apply now the differential operators in products: the left-hand side, inert, remains a product, while the right-hand side, becomes a function application, and so (90) gets applied
Library:-ApplyProductsOfDifferentialOperators
p→⁢f⁡x,y,z=−ⅈ⁢ℏ⁢∇f⁡x,y,z
NOTE: the implementation is such that if p is noncommutative, then so is %p and the same holds regarding their possibly differential operator and tensorial character: the inert versions inherit the properties of their active counterparts, and the same regarding their tensorial character: if p is a tensor, so is %p. In addition, inert tensors are also now displayed the same way as their active versions but in gray, improving the readability of tensorial expressions
Load a curved spacetime, for instance Schwarzschild's metric
g_sc
Systems of spacetime Coordinates are: X=r,θ,φ,t
Default differentiation variables for d_, D_ and dAlembertian are: X=r,θ,φ,t
The Schwarzschild metric in coordinates r,θ,φ,t
Parameters: m
gμ,ν=r−r+2⁢m0000−r20000−r2⁢sin⁡θ20000r−2⁢mr
Define a tensor and compute its covariant derivative equating the inert with the active form of it
DefineAmu
Aμ,▿μ,γμ,σμ,Rμ,ν,Rμ,ν,α,β,Cμ,ν,α,β,Xμ,∂μ,gμ,ν,Γμ,ν,α,Gμ,ν,δμ,ν,εα,β,μ,ν
CompactDisplayAX
A⁡X⁢will now be displayed as⁢A
Since Aμ is a tensor, so is %Aμ, and the latter is typeset as the former, only in gray, with copy & paste working, reproducing %Aμ
A~mu = %A~mu
A⁢μ⁢μ=A⁢μ⁢μ
maptype,,Library:-PhysicsType:-Tensor
true=true
Also new, the same holds for the typesetting of inert differential operators, the inert display of the covariant derivative symbol is now the same as the active one only in gray.
%D_mu = D_muAnuX
▿μ⁡Aν=▿μ⁡Aν
Expand the right-hand side and replace the active Christoffel by its inert counterpart %Christoffel
lhs = expand@rhs
▿μ⁡Aν=∂μ⁡Aν−Γ⁢αμ,ν⁢αμ,ν⁢Aα
subsChristoffel=%Christoffel,
Compute the components of the left and right hand sides of this tensorial equation, it is a 4x4 matrix of equations; check one of these components: the readability of the inert symbols entering the equation is now straightforward due to the typesetting of inert tensors
T ≔ TensorArray, simplifier=simplify:
T4,4
∂4⁡A4+−r+2⁢m⁢m⁢A1r3=A4t−Γ⁢14,4⁢14,4⁢A1−Γ⁢24,4⁢24,4⁢A2−Γ⁢34,4⁢34,4⁢A3−Γ⁢44,4⁢44,4⁢A4
These expression are not just typeset but true inert representations of the underlying computations. To transform them into active, use value
A4t+−r+2⁢m⁢m⁢A1r3=A4t+−r+2⁢m⁢m⁢A1r3
Automatic setting of Pauli, Dirac and Gell-Mann algebras
New in Maple 2018, the algebra rules for the Dirac, Pauli and Gell-Mann matrices are automatically set when Physics is loaded. This means expressions can be simplified taking into account these algebra rules, which can also be queried using a new Library:-DefaultAlgebraRules routine that returns the algebras in terms of generic lowercase Latin indices
restart: withPhysics:
The algebra rules for all of the Pauli, Dirac and Gell-Mann matrices, in a 4D spacetime, are given according to the value of the signature by
Setupsu2indices=lowercaselatin_ah, su3indices = lowercaselatin_is
su2indices=lowercaselatin_ah,su3indices=lowercaselatin_is
for algebra in Library:-DefaultAlgebraRules do algebra od;
σa,σb−=2⁢I⁢εa,b,c⁢σc
σa,σb+=2⁢δa,b
γμ,γν+=2⁢gμ,ν
λj,λk−=2⁢I⁢f__su3i,j,k⁢λi
Simplification of products of Dirac matrices work automatically taking the corresponding (3rd) algebra rule into account; for example (see also next section)
Dgammamu Dgamma~lambda Dgamma~nu Dgamma~rho Dgammamu
γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢μ⁢μ
−2⁢γ⁢ρ⁢ρ⁢γ⁢ν⁢ν⁢γ⁢λ⁢λ
Dgammamu Dgamma~lambda Dgamma~nu Dgamma~rho Dgamma~sigma Dgammamu
γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢μ⁢μ
2⁢γ⁢σ⁢σ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ+2⁢γ⁢ρ⁢ρ⁢γ⁢ν⁢ν⁢γ⁢λ⁢λ⁢γ⁢σ⁢σ
The convention for γ5 follows the Landau, Bogoliubov and Tong books on quantum fields, so for the default signature
Setupsignature
signature=- - - +
using the new Library:-Dgamma5ToOtherDgamma routine, we have
Dgamma~5 = Library:-Dgamma5ToOtherDgamma
γ⁢5⁢5=−I⁢γ⁢4⁢4⁢γ⁢1⁢1⁢γ⁢2⁢2⁢γ⁢3⁢3
This new Library:-Dgamma5ToOtherDgamma routine takes into account the possibly Euclidean character of spacetime, also the possible values of the signature: (- - - +), (+ - - -), (+ + + -) and (- + + +), and uses formulas valid for the three representations: standard, chiral and majorana.
The algebra rules now automatically loaded when Physics is loaded can always overwritten. For instance, to represent the algebra of Dirac matrices with an identity matrix on the right-hand side, one can proceed as follows.
First create the identity matrix. To emulate what we do with paper and pencil, where we write I to represent an identity matrix without having to see the actual table 4x4 with the number 1 in the diagonal and a bunch of 0, use the matrix command, not the Matrix one. One way of entering this identity matrix is
𝕀 ≔ matrix4,4,i,j → KroneckerDeltai,j
𝕀≔1000010000100001
Depending on the context, the advantage of matrix versus Matrix is that I is also of type algebraic
type𝕀, algebraic
Consequently, one can operate with it algebraically without displaying its contents (not possible with Matrix)
𝕀
Most commands of the library only work with objects of type algebraic, all these will be able to handle this matrix, and the contents is displayed only on demand, for instance using eval
eval𝕀
1000010000100001
Set now the algebra for Dirac matrices with an I matrix on the right-hand side
%AntiCommutatorDgammamu, Dgammanu = 2*g_mu, nu*𝕀
γμ,γν+=2⁢gμ,ν⁢𝕀
Setupalgebrarules =
algebrarules=γμ,γν+=2⁢gμ,ν⁢𝕀
Verifying
%AntiCommutator = AntiCommutatorDgammamu,Dgammanu
Set now a Dirac spinor (in a week from today, this will be possible directly using Physics:-Setup, but today, here, I do it step-by-step)
For that you can also use {vector, matrix, array} or {Vector, Matrix, Array}, and again, if you use the Upper case commands, you always have the components visible, and cannot compute with these object using commands that require the input to be of type algebraic. So I use matrix, not Matrix, and matrix instead of vector so that the Dirac spinor that is both algebraic and matrix, is also displayed in the usual display as a "column vector"
To reuse the letter Psi which in Maple represents the Psi function, use a local version of it
local Psi
Ψ
Setupanticommutativeprefix = Psi, psi
anticommutativeprefix=Ψ,ψ
Specify the components of the spinor, in any preferred way, for example using ψj
Psi ≔ matrix4,1, psi1, psi2, psi3, psi4
Ψ≔ψ1ψ2ψ3ψ4
Check it out:
Psi
typePsi, algebraic;
Let's see all this working together by multiplying the anticommutator equation by Ψ
⋅ Psi
γμ,γν+⁢Ψ=2⁢gμ,ν⁢𝕀⁢Ψ
To see the matrix form of this equation use the new Library:-RewriteInMatrixForm routine
Library:-RewriteInMatrixForm
γμ,γν+·ψ1ψ2ψ3ψ4=2⁢gμ,ν⁢1000010000100001·ψ1ψ2ψ3ψ4
Or directly rewrite, then perform, in one go, the matrix operations behind (123)
Library:-PerformMatrixOperations
γμ,γν+·ψ1ψ2ψ3ψ4=2⁢ψ12⁢ψ22⁢ψ32⁢ψ4⁢gμ,ν
REMARK: As shown above, in general, the representation using lowercase commands allows you to use `*` or `.` depending on whether you want to represent the operation or perform the operation. For example this represents the operation, as an exact mimicry of what we do with paper and pencil, both regarding input and output
𝕀⁢ ⋅ Psi
𝕀⁢Ψ
And this performs the operation
𝕀⁢ . Psi
ψ1ψ2ψ3ψ4
Or to only displaying the operation
1000010000100001·ψ1ψ2ψ3ψ4
Finally, another way to visualize the equations behind (123) is
γ1,γ1+⁢Ψ=−2⁢𝕀⁢Ψγ1,γ2+⁢Ψ=0γ1,γ3+⁢Ψ=0γ1,γ4+⁢Ψ=0γ2,γ1+⁢Ψ=0γ2,γ2+⁢Ψ=−2⁢𝕀⁢Ψγ2,γ3+⁢Ψ=0γ2,γ4+⁢Ψ=0γ3,γ1+⁢Ψ=0γ3,γ2+⁢Ψ=0γ3,γ3+⁢Ψ=−2⁢𝕀⁢Ψγ3,γ4+⁢Ψ=0γ4,γ1+⁢Ψ=0γ4,γ2+⁢Ψ=0γ4,γ3+⁢Ψ=0γ4,γ4+⁢Ψ=2⁢𝕀⁢Ψ
Or additionally performing the matrix operations of each of the equations in (129) using the new option performmatrixoperations of TensorArray
TensorArray,performmatrixoperations, simplifier=value
−2⁢ψ1−2⁢ψ2−2⁢ψ3−2⁢ψ4=−2⁢ψ1−2⁢ψ2−2⁢ψ3−2⁢ψ40=00=00=00=0−2⁢ψ1−2⁢ψ2−2⁢ψ3−2⁢ψ4=−2⁢ψ1−2⁢ψ2−2⁢ψ3−2⁢ψ40=00=00=00=0−2⁢ψ1−2⁢ψ2−2⁢ψ3−2⁢ψ4=−2⁢ψ1−2⁢ψ2−2⁢ψ3−2⁢ψ40=00=00=00=02⁢ψ12⁢ψ22⁢ψ32⁢ψ4=2⁢ψ12⁢ψ22⁢ψ32⁢ψ4
The computation of traces of products of Dirac matrices was implemented years ago - see Physics,Trace.
The simplification of products of Dirac matrices, however, was not. Now in Maple 2018 it is.
withPhysics:
First of all, when loading Physics, a frequent question is about the signature, the default is (- - - +)
This is important because the convention for the Algebra of Dirac Matrices depends on the signature. With the signatures (- - - +) as well as (+ - - -), the sign of the timelike component is 1
Library:-SignOfTimelikeComponent
1
With the signatures (+ + + -) as well as (- + + +), the sign of the timelike component is -1
Library:-SignOfTimelikeComponent`+ + + -`
−1
The simplification of products of Dirac Matrices, illustrated below with the default signature, works fine with any of these signatures, and works without having to set a representation for the Dirac matrices -- all the results are representation-independent.
Consider now the following five products of Dirac matrices
e0 ≔ Dgammamu2
e0≔γμ⁢γ⁢μ⁢μ
e1 ≔ Dgammamu Dgamma~nu Dgammamu
e1≔γμ⁢γ⁢ν⁢ν⁢γ⁢μ⁢μ
e2 ≔ Dgammamu Dgamma~lambda Dgamma~nu Dgammamu
e2≔γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢μ⁢μ
e3 ≔ Dgammamu Dgamma~lambda Dgamma~nu Dgamma~rho Dgammamu
e3≔γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢μ⁢μ
e4 ≔ Dgammamu Dgamma~lambda Dgamma~nu Dgamma~rho Dgamma~sigma Dgammamu
e4≔γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢μ⁢μ
New: the simplification of these products is now implemented
e0 = Simplifye0
γμ⁢γ⁢μ⁢μ=4
Verify this result performing the underlying matrix operations
T ≔ SumOverRepeatedIndices
T≔γ1⁢γ⁢1⁢1+γ2⁢γ⁢2⁢2+γ3⁢γ⁢3⁢3+γ4⁢γ⁢4⁢4=4
Note that in (140) the right-hand side has no matrix elements. This is standard in particle physics where the computations with Dirac matrices are performed algebraically. For the purpose of actually performing the underlying matrix operations, however, one may want to rewrite the algebra of Dirac matrices including a 4x4 identity matrix. For that purpose, see Algebra of Dirac Matrices with an identity matrix on the right-hand side. For the purpose of this illustration, below we proceed with as shown in (140), interpreting right-hand sides as if they involve an identity matrix.
To verify these results checking the components of the matrices involved we set a representation for the Dirac matrices, for example the standard one
SetupDgamma = standard
* Partial match of 'γ' against keyword 'Dgammarepresentation'
_______________________________________________________
Dgammarepresentation=standard
Verify (140) using the new Library:-PerformMatrixOperations routine
Library:-PerformMatrixOperationsT
4000040000400004=4
The same with the other expressions
e1 = Simplifye1
γμ⁢γ⁢ν⁢ν⁢γ⁢μ⁢μ=−2⁢γ⁢ν⁢ν
SumOverRepeatedIndices
γ1⁢γ⁢ν⁢ν⁢γ⁢1⁢1+γ2⁢γ⁢ν⁢ν⁢γ⁢2⁢2+γ3⁢γ⁢ν⁢ν⁢γ⁢3⁢3+γ4⁢γ⁢ν⁢ν⁢γ⁢4⁢4=−2⁢γ⁢ν⁢ν
T ≔ TensorArray
T≔γ1⁢γ⁢1⁢12+γ2⁢γ⁢1⁢1⁢γ⁢2⁢2+γ3⁢γ⁢1⁢1⁢γ⁢3⁢3+γ4⁢γ⁢1⁢1⁢γ⁢4⁢4=−2⁢γ⁢1⁢1γ1⁢γ⁢2⁢2⁢γ⁢1⁢1+γ2⁢γ⁢2⁢22+γ3⁢γ⁢2⁢2⁢γ⁢3⁢3+γ4⁢γ⁢2⁢2⁢γ⁢4⁢4=−2⁢γ⁢2⁢2γ1⁢γ⁢3⁢3⁢γ⁢1⁢1+γ2⁢γ⁢3⁢3⁢γ⁢2⁢2+γ3⁢γ⁢3⁢32+γ4⁢γ⁢3⁢3⁢γ⁢4⁢4=−2⁢γ⁢3⁢3γ1⁢γ⁢4⁢4⁢γ⁢1⁢1+γ2⁢γ⁢4⁢4⁢γ⁢2⁢2+γ3⁢γ⁢4⁢4⁢γ⁢3⁢3+γ4⁢γ⁢4⁢42=−2⁢γ⁢4⁢4
000−200−2002002000=000−200−20020020000002⁢I00−2⁢I00−2⁢I002⁢I000=0002⁢I00−2⁢I00−2⁢I002⁢I00000−20000220000−200=00−20000220000−200−20000−20000200002=−20000−20000200002
For e2
e2 = Simplifye2
γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢μ⁢μ=4⁢g⁢λ,ν⁢λ,ν
γ1⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢1⁢1+γ2⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢2⁢2+γ3⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢3⁢3+γ4⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢4⁢4=4⁢g⁢λ,ν⁢λ,ν
To make the output simpler, use the new option performmatrixoperations of TensorArray, accomplishing two steps in one go
T ≔ TensorArray,performmatrixoperations
T≔−40000−40000−40000−4=−40000000000000000=00000000000000000=00000000000000000=00000000000000000=0−40000−40000−40000−4=−40000000000000000=00000000000000000=00000000000000000=00000000000000000=0−40000−40000−40000−4=−40000000000000000=00000000000000000=00000000000000000=00000000000000000=04000040000400004=4
For the other two products of Dirac matrices we have
e3 = Simplifye3
γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢μ⁢μ=−2⁢γ⁢ρ⁢ρ⁢γ⁢ν⁢ν⁢γ⁢λ⁢λ
e4 = Simplifye4
γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢μ⁢μ=2⁢γ⁢σ⁢σ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ+2⁢γ⁢ρ⁢ρ⁢γ⁢ν⁢ν⁢γ⁢λ⁢λ⁢γ⁢σ⁢σ
These results can be verified in the same way done for the simplification of e2 and e1, as shown in this page, under Library routines to perform matrix operations in expressions involving spinors with omitted indices
Finally, let's define some tensors and contract their product with these expressions involving products of Dirac matrices.
Example
DefineA,B
A,B,γμ,σμ,∂μ,gμ,ν,εα,β,μ,ν
Contract with e1 and e2 and simplify
Anu⋅e1: % = Simplify%
Aν⁢γμ⁢γ⁢ν⁢ν⁢γ⁢μ⁢μ=−2⁢A⁢ν⁢ν⁢γν
Anu⋅Blambda e2: % = Simplify%
Aν⁢Bλ⁢γμ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢μ⁢μ=4⁢B⁢ν⁢ν⁢Aν
New Physics:-Library routines, RewriteInMatrixForm, and PerformMatrixOperations where added, to rewrite or perform the matrix operations implicit in expressions where the spinor indices are omitted. In some sense, the new Library:-PerformMatrixOperations is a Matrix version (or spinor version) of the TensorArray command, which now also has a new option, performmatrixoperations to additionally perform the matrix or spinor operations in expressions
The simplification of products of Dirac matrices, however, was not. Now it is.
Set a representation for the Dirac matrices, say the standard one
SetupDgamma=standard,math=true, quiet
Dgammarepresentation=standard,mathematicalnotation=true
An Array with the four Dirac matrices are
TensorArrayDgamma~mu
γ⁢1⁢1γ⁢2⁢2γ⁢3⁢3γ⁢4⁢4
The definition of the Dirac matrices is implemented in Maple following the conventions of Landau books ([1] Quantum Electrodynamics, V4), and does not depend on the signature, i.e. the form of these matrices is, using the new Library:-RewriteInMatrixForm
000100100−100−1000000−I00I00I00−I0000010000−1−100001001000010000−10000−1
With the default signature (- - - +), the space part components of γμ change sign when compared with corresponding ones from γ⁢μ⁢μ while the timelike component remains unchanged
TensorArrayDgammamu
γ1γ2γ3γ4
000−100−1001001000000I00−I00−I00I00000−10000110000−1001000010000−10000−1
With this default signature (- - - +), the algebra of the Dirac Matrices, now loaded by default when Physics is loaded, is (see page 80 of [1])
%AntiCommutator = AntiCommutatorDgamma~mu,Dgamma~nu
γ⁢μ⁢μ,γ⁢ν⁢ν+=2⁢g⁢μ,ν⁢μ,ν
You can also display this algebra, with generic indices j, k, using the new Library routine for this purpose
Library:-DefaultAlgebraRules3
Verify the algebra rule by performing all the involved matrix operations
expand
γ⁢ν⁢ν⁢γ⁢μ⁢μ+γ⁢μ⁢μ⁢γ⁢ν⁢ν=2⁢g⁢μ,ν⁢μ,ν
Note that, regarding the spacetime indices, this is a 4x4 matrix, whose elements are in turn 4x4 matrices. Compute first the external 4x4 matrix related to μ and ν
2⁢γ⁢1⁢12=−2γ⁢2⁢2⁢γ⁢1⁢1+γ⁢1⁢1⁢γ⁢2⁢2=0γ⁢3⁢3⁢γ⁢1⁢1+γ⁢1⁢1⁢γ⁢3⁢3=0γ⁢4⁢4⁢γ⁢1⁢1+γ⁢1⁢1⁢γ⁢4⁢4=0γ⁢2⁢2⁢γ⁢1⁢1+γ⁢1⁢1⁢γ⁢2⁢2=02⁢γ⁢2⁢22=−2γ⁢3⁢3⁢γ⁢2⁢2+γ⁢2⁢2⁢γ⁢3⁢3=0γ⁢4⁢4⁢γ⁢2⁢2+γ⁢2⁢2⁢γ⁢4⁢4=0γ⁢3⁢3⁢γ⁢1⁢1+γ⁢1⁢1⁢γ⁢3⁢3=0γ⁢3⁢3⁢γ⁢2⁢2+γ⁢2⁢2⁢γ⁢3⁢3=02⁢γ⁢3⁢32=−2γ⁢4⁢4⁢γ⁢3⁢3+γ⁢3⁢3⁢γ⁢4⁢4=0γ⁢4⁢4⁢γ⁢1⁢1+γ⁢1⁢1⁢γ⁢4⁢4=0γ⁢4⁢4⁢γ⁢2⁢2+γ⁢2⁢2⁢γ⁢4⁢4=0γ⁢4⁢4⁢γ⁢3⁢3+γ⁢3⁢3⁢γ⁢4⁢4=02⁢γ⁢4⁢42=2
Perform now all the matrix operations involved in each of the elements of this 4x4 matrix: you can do this by using the new option performmatrixoperations of TensorArray or using the new Library routine for this purpose
−20000−20000−20000−2=−20000000000000000=00000000000000000=00000000000000000=00000000000000000=0−20000−20000−20000−2=−20000000000000000=00000000000000000=00000000000000000=00000000000000000=0−20000−20000−20000−2=−20000000000000000=00000000000000000=00000000000000000=00000000000000000=02000020000200002=2
By eye everything checks OK. Note as well that in (164) the right-hand sides have no matrix elements. This is standard in particle physics where the computations with Dirac matrices are performed algebraically. For the purpose of actually performing the underlying matrix operations, however, one may want to rewrite this algebra including a 4x4 identity matrix on the right-hand sides. For that purpose, see the Mapleprimes post Algebra of Dirac Matrices with an identity matrix on the right-hand side. For the purpose of this illustration, below we proceed with the algebra as shown in (164), interpreting right-hand sides as if they involve an identity matrix.
T≔γ1⁢γ⁢1⁢13+γ2⁢γ⁢1⁢12⁢γ⁢2⁢2+γ3⁢γ⁢1⁢12⁢γ⁢3⁢3+γ4⁢γ⁢1⁢12⁢γ⁢4⁢4=−4γ1⁢γ⁢1⁢1⁢γ⁢2⁢2⁢γ⁢1⁢1+γ2⁢γ⁢1⁢1⁢γ⁢2⁢22+γ3⁢γ⁢1⁢1⁢γ⁢2⁢2⁢γ⁢3⁢3+γ4⁢γ⁢1⁢1⁢γ⁢2⁢2⁢γ⁢4⁢4=0γ1⁢γ⁢1⁢1⁢γ⁢3⁢3⁢γ⁢1⁢1+γ2⁢γ⁢1⁢1⁢γ⁢3⁢3⁢γ⁢2⁢2+γ3⁢γ⁢1⁢1⁢γ⁢3⁢32+γ4⁢γ⁢1⁢1⁢γ⁢3⁢3⁢γ⁢4⁢4=0γ1⁢γ⁢1⁢1⁢γ⁢4⁢4⁢γ⁢1⁢1+γ2⁢γ⁢1⁢1⁢γ⁢4⁢4⁢γ⁢2⁢2+γ3⁢γ⁢1⁢1⁢γ⁢4⁢4⁢γ⁢3⁢3+γ4⁢γ⁢1⁢1⁢γ⁢4⁢42=0γ1⁢γ⁢2⁢2⁢γ⁢1⁢12+γ2⁢γ⁢2⁢2⁢γ⁢1⁢1⁢γ⁢2⁢2+γ3⁢γ⁢2⁢2⁢γ⁢1⁢1⁢γ⁢3⁢3+γ4⁢γ⁢2⁢2⁢γ⁢1⁢1⁢γ⁢4⁢4=0γ1⁢γ⁢2⁢22⁢γ⁢1⁢1+γ2⁢γ⁢2⁢23+γ3⁢γ⁢2⁢22⁢γ⁢3⁢3+γ4⁢γ⁢2⁢22⁢γ⁢4⁢4=−4γ1⁢γ⁢2⁢2⁢γ⁢3⁢3⁢γ⁢1⁢1+γ2⁢γ⁢2⁢2⁢γ⁢3⁢3⁢γ⁢2⁢2+γ3⁢γ⁢2⁢2⁢γ⁢3⁢32+γ4⁢γ⁢2⁢2⁢γ⁢3⁢3⁢γ⁢4⁢4=0γ1⁢γ⁢2⁢2⁢γ⁢4⁢4⁢γ⁢1⁢1+γ2⁢γ⁢2⁢2⁢γ⁢4⁢4⁢γ⁢2⁢2+γ3⁢γ⁢2⁢2⁢γ⁢4⁢4⁢γ⁢3⁢3+γ4⁢γ⁢2⁢2⁢γ⁢4⁢42=0γ1⁢γ⁢3⁢3⁢γ⁢1⁢12+γ2⁢γ⁢3⁢3⁢γ⁢1⁢1⁢γ⁢2⁢2+γ3⁢γ⁢3⁢3⁢γ⁢1⁢1⁢γ⁢3⁢3+γ4⁢γ⁢3⁢3⁢γ⁢1⁢1⁢γ⁢4⁢4=0γ1⁢γ⁢3⁢3⁢γ⁢2⁢2⁢γ⁢1⁢1+γ2⁢γ⁢3⁢3⁢γ⁢2⁢22+γ3⁢γ⁢3⁢3⁢γ⁢2⁢2⁢γ⁢3⁢3+γ4⁢γ⁢3⁢3⁢γ⁢2⁢2⁢γ⁢4⁢4=0γ1⁢γ⁢3⁢32⁢γ⁢1⁢1+γ2⁢γ⁢3⁢32⁢γ⁢2⁢2+γ3⁢γ⁢3⁢33+γ4⁢γ⁢3⁢32⁢γ⁢4⁢4=−4γ1⁢γ⁢3⁢3⁢γ⁢4⁢4⁢γ⁢1⁢1+γ2⁢γ⁢3⁢3⁢γ⁢4⁢4⁢γ⁢2⁢2+γ3⁢γ⁢3⁢3⁢γ⁢4⁢4⁢γ⁢3⁢3+γ4⁢γ⁢3⁢3⁢γ⁢4⁢42=0γ1⁢γ⁢4⁢4⁢γ⁢1⁢12+γ2⁢γ⁢4⁢4⁢γ⁢1⁢1⁢γ⁢2⁢2+γ3⁢γ⁢4⁢4⁢γ⁢1⁢1⁢γ⁢3⁢3+γ4⁢γ⁢4⁢4⁢γ⁢1⁢1⁢γ⁢4⁢4=0γ1⁢γ⁢4⁢4⁢γ⁢2⁢2⁢γ⁢1⁢1+γ2⁢γ⁢4⁢4⁢γ⁢2⁢22+γ3⁢γ⁢4⁢4⁢γ⁢2⁢2⁢γ⁢3⁢3+γ4⁢γ⁢4⁢4⁢γ⁢2⁢2⁢γ⁢4⁢4=0γ1⁢γ⁢4⁢4⁢γ⁢3⁢3⁢γ⁢1⁢1+γ2⁢γ⁢4⁢4⁢γ⁢3⁢3⁢γ⁢2⁢2+γ3⁢γ⁢4⁢4⁢γ⁢3⁢32+γ4⁢γ⁢4⁢4⁢γ⁢3⁢3⁢γ⁢4⁢4=0γ1⁢γ⁢4⁢42⁢γ⁢1⁢1+γ2⁢γ⁢4⁢42⁢γ⁢2⁢2+γ3⁢γ⁢4⁢42⁢γ⁢3⁢3+γ4⁢γ⁢4⁢43=4
−40000−40000−40000−4=−40000000000000000=00000000000000000=00000000000000000=00000000000000000=0−40000−40000−40000−4=−40000000000000000=00000000000000000=00000000000000000=00000000000000000=0−40000−40000−40000−4=−40000000000000000=00000000000000000=00000000000000000=00000000000000000=04000040000400004=4
For e3 we have
Verify this result,
γ1⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢1⁢1+γ2⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢2⁢2+γ3⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢3⁢3+γ4⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢4⁢4=−2⁢γ⁢ρ⁢ρ⁢γ⁢ν⁢ν⁢γ⁢λ⁢λ
In this case, with three free spacetime indices λ,ν,ρ, the spacetime components form an array 4x4x4 of 64 components, each of which is a matrix equation
For instance, the first element is
T1,1,1
γ1⁢γ⁢1⁢14+γ2⁢γ⁢1⁢13⁢γ⁢2⁢2+γ3⁢γ⁢1⁢13⁢γ⁢3⁢3+γ4⁢γ⁢1⁢13⁢γ⁢4⁢4=−2⁢γ⁢1⁢13
and it checks OK:
Library:-PerformMatrixOperationsT1,1,1
000200200−200−2000=000200200−200−2000
How can you test the 64 components of T all at once?
1. Compute the matrices, without displaying the whole thing, take the elements of the array and remove the indices (i.e. take the right-hand side); call it M
M ≔ maprhs,ArrayElemsLibrary:-PerformMatrixOperationsT:
For instance,
M1
0−2002000000200−20=0−2002000000200−20
Now verify all these matrix equations at once: take the elements of the arrays on each side of the equations and verify that the are the same: we expect for output just true
mapu → evalbmapArrayElems,u,M
The same for e4
γ1⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢1⁢1+γ2⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢2⁢2+γ3⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢3⁢3+γ4⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ⁢γ⁢σ⁢σ⁢γ⁢4⁢4=2⁢γ⁢σ⁢σ⁢γ⁢λ⁢λ⁢γ⁢ν⁢ν⁢γ⁢ρ⁢ρ+2⁢γ⁢ρ⁢ρ⁢γ⁢ν⁢ν⁢γ⁢λ⁢λ⁢γ⁢σ⁢σ
Regarding the spacetime indices this is now an array 4x4x4x4
For instance the first of these 256 matrix equations
T1,1,1,1
γ1⁢γ⁢1⁢15+γ2⁢γ⁢1⁢14⁢γ⁢2⁢2+γ3⁢γ⁢1⁢14⁢γ⁢3⁢3+γ4⁢γ⁢1⁢14⁢γ⁢4⁢4=4⁢γ⁢1⁢14
verifies OK:
4000040000400004=4000040000400004
Now all the 256 matrix equations verified at once as done for e3
A large number of miscellaneous improvements happened for Physics in Maple 2018. For brevity, these improvements are only listed; among the most relevant ones:
There are six new Library routines, DefaultAlgebraRules, Dgamma5ToOtherDgamma, GetDifferentiationVariables, GetRepeatedIndices, IsSymmetricMatrix, RewriteInMatrixForm, all of which are illustrated in the previous sections.
All the tensors of 2 indices automatically defined in the Physics package, as well as those you can define using Define with a defining equation, or indicating its symmetries and using the new option minimizetensorcomponents of the Define command, accept a new keyword, trace to represent their trace.
The rewriting in terms of d/d⁢Xμ of ∂μ⁡... constructions in a Minkowski spacetime can now be computed using convert⁡∂μ⁡...,diff
Change in the design: allow the derivative H′⁡x to proceed also when x is noncommutative by returning unevaluated. In this way one can afterwards define commutation rules such that derivative can be computed.
Make ∂2∂x∂yH⁡x,y=∂2∂y∂xH⁡x,y when x and y are noncommutative but commute between themselves.
Make x and y that belong to one and the same coordinate system always commute, even if x and y are quantum operators.
Make all the coordinates of system Xj set as a quantum operator that commutes with another quantum operator V, also commute with V.
Add a differentiation rule for Bracket
Physics:-TensorArray: add a new keyword performmatrixoperations (illustrated in the previous sections) and, although unusual, if the input is an Array or Matrix of tensorial equations, map over their elements.
Allow to set Xμ, a coordinate system vector, as a quantum operator. With that, automatically, Xμ, is of type noncommutative.
When defining a Commutator algebra between indexed objects, that are afterwards defined as tensors, now results in the same behavior as when first defining the tensors then the algebra rules.
Tensor input like Γ1,j,k,matrix now return a 3x3 matrix when j,k are space indices.
The Coefficients now automatically maps over equations
The Library:-GetTensorSymmetryProperties got entirely rewritten and significantly enhanced, it now detects multiple symmetries and symmetries under exchanges of pairs of indices as it is the case of the symmetries of the Riemann tensor.
Reorder the flow within Setup so that first the notation is set, then coordinates followed by the TensorSimplifier and the realojects, and only then the metric is set, that gets simplified taking all of the previous ones into account. This permits to update coordinates dimension, signature, metric and other things all in one go, a single call to Setup.
There are some new Setup options, including differentialoperators (illustrated in the previous sections) and usecoordinatesastensorindices that permits indexing tensors directly with the coordinates (easier to remember) instead of with the coordinate's positions. Note: when using usecoordinatesastensorindices the tensors can still also be indexed with the coordinate's positions.
Reorder the flow within Define so that first the tensors whose definition is not an equation definition are define, then those that are defined with defining equations. The former definitions can be performed right away and these tensors can now appear on the right-hand sides of other tensor definitions being defined simultaneously with defining equations.
Change in the display of covariant derivatives represented using the D_ command: instead of D we now use 7, an upside down triangle that is slightly different from Nabla, ∇ used in Physics:-Vectors.
Add more types to the Physics:-Library:-PhysicsType package of Physics types, that in Maple 2018 comes with 92 specialized types
Allow geometrical coordinates to be defined as tensors (so they become of type Physics:-Tensor) instead of interrupting with an error due to the coordinates being assigned as it was the case of previous releases.
Make Xμ†=Xμ for the Dagger of the SpaceTimeVector (any coordinate system defined through Setup or Coordinates).
Make Dagger and d/dx commute also when x is Hermitian (of Library:-PhysicsType:-Hermitian).
Implement Dgamma[definition] as the algebra rules satisfied by the Dirac gamma matrices.
Make the error message by Check, for instance when indices appear repeated more than once, to also indicate the actual expression where free and/or repeated indices are found to be incorrect.
The typesetdot and typesetprime Typesetting rules are now automatically enabled when Physics is loaded.
Full revision of the conventions for the Dirac matrices in the different representations and Euclidean space, with Dgamma[5] now following the convention used in the Landau, Bogoliubov and Tong books on Quantum Fields.
Add a new option settetrad to TransformTetrad, analogous to the option setmetric of TranformCoordinates.
TransformTetrads: when computing a canonicalform for a tetrad the starting tetrad is expected to be in null form, or if it is orthonormal it is automatically converted to null for before proceeding with rotations to achieve a canonical form.
Add a new keyword output=listlist to Physics:-Library:-TensorComponent.
More documentation: new help pages showing how to perform with the Physics packages the computations one could perform in the past with the (now deprecated) tensor Maple package and the (non-Maplesoft) GRTensor package.
See Also
Index of New Maple 2018 Features
Computer Algebra for Theoretical Physics
The Physics project
The Physics Updates
Download Help Document