Physics for Maple 16 - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : Updates : Physics for Maple 16

Updates to Physics in Maple 16

  

The Physics package of Maple 16 includes 17 new commands, extended its functionality in Vector and Tensor Analysis, General Relativity and Quantum Fields, and brings with it the largest number of developments since its introduction in Maple 11, underscoring Maple's goal of having a state-of-the-art environment for algebraic computations in Physics.

  

In addition, a vast number of changes were introduced towards making the computational experience as natural as possible, resembling the paper-and-pencil way of doing computations and with textbook-quality display of results.

  

Tensors in Special and General Relativity (Examples)

– 

Maple's Physics introduces contravariant indices in a simple way: in your input, prefix contravariant indices with ~; in the output they are displayed as superscripts, without the ~.

– 

In a tensorial expression, you can enter any pair of contracted indices as one covariant, the other contravariant, not being relevant which one is of which kind, so you can also enter both covariant or both contravariant and the system will automatically rewrite them as one covariant and the other contravariant.

– 

A complete set of General Relativity tensors got added to Physics, mainly D_, representing the covariant derivative, Christoffel, LeviCivita in curvilinear coordinates, Einstein, Ricci, Riemann and Weyl, all displayed on the screen with standard physics textbook notation.

– 

You can compute with these tensors algebraically, as done with paper and pencil, automatically taking into account their symmetry properties, and Checking tensor indices in expressions, differentiating or Simplifying them using Einstein's sum rule for repeated indices.

– 

A set of working tools for General Relativity got added, including TransformCoordinates, and TensorArray, to respectively perform transformations of coordinates in an arbitrary tensorial expression, and create a tensor array to compute each of its tensorial components, SumOverRepeatedIndices, to expand the summation in expressions written using Einstein's sum rule for repeated indices and SubstituteTensorIndices to substitute covariant and/or contravariant indices in tensorial expressions.

– 

You can now use the Physics `.` product operator instead of * in order to "multiply and simplify" - in one step - contracted products of tensors. This permits simplifying only the product sub-expressions you want while keeping the remaining products expressed using *.

– 

A set of convert routines permits rewriting expressions in terms of Christoffel symbols, or derivatives of the metric or expand covariant derivatives.

– 

The d_ indexed differential operator got extended to work also without indices, the same way as the new covariant D_, in order to compute differentials.

– 

When working in curvilinear coordinates, the LeviCivita tensor can optionally be set to galilean or nongalilean, with its display automatically changing from ε to Ε.

– 

The new general relativity tensors update the values of their components automatically, on the fly, according to the changes you introduce in the spacetime metric. When the indices are integer numbers these tensors automatically return the corresponding value taking into account the indices' character (covariant/contravariant); or return the whole set of nonzero values if requested.

– 

When all but two of the indices of the relativity tensors are numeric (covariant or contravariant), you can see the corresponding 2 x 2 matrix by passing the keyword matrix as an additional index. When no indices are passed, all the new tensors return an Array with all their covariant components; in the case of tensors of 2 indices the corresponding Matrix is returned/displayed.

– 

It is now possible to set the spacetime metric as desired, or directly from a database of metrics having special properties known in the literature. The metric can be entered with Setup, as a matrix, or as a set with its nonzero components, or directly as the line element; or simpler: pass the corresponding database keyword directly to the spacetime metric g_ command.

– 

By passing a portion of a metric keyword directly to the metric g_ it is possible to list all the database' metrics matches in order to refine a search and choose the desired one.

– 

To represent spacetime coordinate it is now possible to use any desired list of names, including predefined cartesian, cylindrical and spherical lists as in the Physics:-Vectors subpackage, and with t representing the time. You can work with many systems of coordinates at the same time.

– 

In galilean or nongalilean systems of references, spacetime tensors can simultaneously have spacetime and/or only space indices.

– 

A new MetricSearch assistant in the DifferentialGeometry package permits searching a database of solutions to the Einstein equations.

  

New commands for working with expressions involving anticommutative variables and functions (Examples )

– 

Gtaylor computes Taylor series with respect to anticommutative variables of expressions involving anticommutative variables

– 

ToFieldComponents and ToSuperfields bring into the worksheet the core functionality that was missing in order to implement supersymmetry and supermultiplets (an implementation of supersymmetry itself, however, is not yet present in M16).

– 

PerformOnAnticommutativeSystem permits reusing some parts of the existing Maple library originally written to handle problems with only commutative variables (that are not part of the Physics), in order to tackle the corresponding generalized problems involving anticommutative variables.

– 

Normal is equivalent to a generalization of normal to work on expressions simultaneously involving commutative, anticommutative and noncommutative variables

– 

Coefficients computes the coefficients of variables or functions, in algebraic expressions involving anticommutative and noncommutative objects.

– 

GrassmannParity returns 0, 1 or undefined according to whether the given object is commutative, anticommutative or noncommutative.

– 

Most of the symmetry commands of PDEtools were extended to handle anticommutative variables, including all of the PDEtools:-Library, so that all that functionality can now be used in Physics problems together with Physics commands.

  

Vector Analysis

– 

All the vector analysis routines of Physics:-Vectors can now compute with unit vectors and geometrical coordinates that have functional dependency, as in θt or the unit vector ρt, enlarging the mathematical representation capabilities.

– 

The knowledge about relationships between cartesian, cylindrical and spherical coordinates formerly coded in Physics:-Vectors:-VectorDiff got incremented, then merged into Physics:-diff, so that now there is a unified differentiation command able to perform differentiation automatically taking into account physics or geometrical contexts.

Examples

Tensors in Special and General Relativity

withPhysics

`*`,`.`,Annihilation,AntiCommutator,Antisymmetrize,Assume,Bra,Bracket,Check,Christoffel,Coefficients,Commutator,CompactDisplay,Coordinates,Creation,D_,Dagger,Decompose,Define,Dγ,DiracConjugate,Einstein,EnergyMomentum,Expand,ExteriorDerivative,Factor,FeynmanDiagrams,FeynmanIntegral,Fundiff,Geodesics,GrassmannParity,Gtaylor,Intc,Inverse,Ket,KillingVectors,KroneckerDelta,LagrangeEquations,LeviCivita,Library,LieBracket,LieDerivative,Normal,NumericalRelativity,Parameters,PerformOnAnticommutativeSystem,Projector,Psigma,Redefine,Ricci,Riemann,Setup,Simplify,SortProducts,SpaceTimeVector,StandardModel,Substitute,SubstituteTensor,SubstituteTensorIndices,SumOverRepeatedIndices,Symmetrize,TensorArray,Tetrads,ThreePlusOne,ToContravariant,ToCovariant,ToFieldComponents,ToSuperfields,Trace,TransformCoordinates,Vectors,Weyl,`^`,dAlembertian,d_,diff,g_,gamma_

(1)

Setupmathematicalnotation=true

mathematicalnotation=true

(2)
• 

When you load Physics the spacetime is set to Minkowski type. To see the current spacetime metric, enter it without indices

g_

gμ,ν=

(3)
• 

For algebraic computing with tensors, Maple 16 introduces contravariant indices in a simple way: to indicate that an index is contravariant, prefix it with ~ (tilde)

g_μ,ν,g_μ,~nu,g_~mu,~nu

gμ,ν,δμνμν,gμ,νμ,ν

(4)
  

Define some spacetime tensors for exploration

DefineA,B

Defined objects with tensor properties

A,B,γμ,σμ,μ,gμ,ν,εα,β,μ,ν

(5)
• 

For all the tensors defined, the Physics commands will use the Einstein sum rule for repeated indices when manipulating them (simplification, differentiation, etc.). You can enter any pair of contracted indices one covariant and the other contravariant, not being relevant which one is of which kind, so you can also enter both covariant or both contravariant and the system will automatically rewrite them as one covariant and the other contravariant.

g_μ,ν2

gμ,νgμ,νμ,ν

(6)

g_α,μAμg_α,νBν,σ,σ

Bν,σσν,σσgα,μgα,να,νAμμ

(7)
  

In this way you don't need to focus your attention on the covariant/contravariant character of repeated indices when entering expressions. To check and determine the repeated and free indices use Check

Check,all

The repeated indices per term are: ...,...,..., the free indices are: ...

α,μ,ν,σ,

(8)
  

To expand the summation over repeated indices implied in Einstein's summation convention, taking into account the covariant and contravariant character of the indices, use SumOverRepeatedIndices

SumOverRepeatedIndices

B1,111,11+B1,221,22+B1,331,33+B1,441,44A11+B2,112,11+B2,222,22+B2,332,33+B2,442,44A22+B3,113,11+B3,223,22+B3,333,33+B3,443,44A33+B4,114,11+B4,224,22+B4,334,33+B4,444,44A44

(9)
• 

The simplification and differentiation of tensorial expressions automatically use Einstein's summation rule

diff,Aρ

Bν,σσν,σσgα,μgα,να,νgμ,ρμ,ρ

(10)

Simplify

Bρσσρσσ

(11)
  

Besides its use in quantum mechanics, the Physics `.` operator is now also a handy shortcut to "multiply and simplify" contracted indices in one step. This is useful when handling expressions where you want the contraction to be simplified right away or only in some places. Recalling that multiplication is left associative, you may need to put parenthesis to get what you want. For example, replace in (8) only the third `*` by `.`

g_α,μAμg_α,ν·Bν,σ,σ

Bα,σσα,σσAμgα,μα,μ

(12)
• 

Set the spacetime metric to be the Schwarzschild in spherical coordinates: you can now do that in various manners (see Setup and g_), the simplest of which is to pass part of the identifying keyword directly to the metric tensor g_

g_sc

_______________________________________________________

Systems of spacetime coordinates are:X=r,θ,φ,t

Default differentiation variables for d_, D_ and dAlembertian are:X=r,θ,φ,t

Setting lowercaselatin_is letters to represent space indices

The Schwarzschild metric in coordinates r,θ,φ,t

Parameters: m

Signature: - - - +

_______________________________________________________

gμ,ν=

(13)
  

To see the corresponding line element pass the keyword line_element; the differentials are expressed using d_

g_line_element

rⅆr22mrr2ⅆθ2r2sinθ2ⅆφ2+r2mⅆt2r

(14)
  

A coordinate transformation taking the metric g_ to a conformal euclidean form, i.e. with line element proportional to ρ2+ρ2θ2+sinθ2φ2

TRr=1+2m4ρ2ρ

TRr=1+m2ρ2ρ

(15)

TransformCoordinatesTR,g_μ,ν,ρ,θ,φ,t

(16)
  

When the tensorial expression being transformed is the spacetime metric, you can optionally request the output to be the corresponding line element; the differentials of the coordinates are expressed using d_

TransformCoordinatesTR,g_μ,ν,ρ,θ,φ,t,output=line_element

2ρ+m4ⅆρ2+sinθ2ⅆφ2+ⅆθ2ρ216ρ4+m2ρ2ⅆt22ρ+m2

(17)
  

TransformCoordinates does not set the metric to the result of the transformation; you can do that by passing its output to Setup.

• 

The general relativity tensors automatically update their value when you set the metric. The contraction of all the indices of the Riemann tensor for the Schwarzschild metric

Riemannα,β,μ,ν·Riemannα,β,μ,ν

48m2r6

(18)
  

The indices of these tensors are automatically sorted according to their symmetry properties when computing with them algebraically, this facilitates zero recognition

Riemannμ,μ,β,α

0

(19)

Riemannν,μ,β,αRiemannα,β,ν,μ

2Rα,β,μ,ν

(20)
  

Besides algebraic computations, it is possible to check the value of all or subsets of the tensor's components in a visually. For example, for Γ2,21 and Γ__1,2,2

Christoffel~1,2,2

2mr

(21)

Christoffel1,2,2

r

(22)
  

The 2 x 2 matrix corresponding to Γα,β1 is displayed when you pass the keyword matrix as an extra index

Christoffel~1,α,μ,matrix

Γ1α,μ1α,μ=

(23)
  

Compare with the matrix for Γ__1,α,β (so the first index is covariant and then not prefixed with ~)

Christoffel1,α,μ,matrix

Γ1,α,μ=

(24)
  

The nonzero components of Γα,βμ

Christoffel~mu,α,β,nonzero

Γμα,βμα,β=1,1,1=mr2mr,1,2,2=2mr,1,3,3=2mrsinθ2,1,4,4=2m2+rmr3,2,1,2=1r,2,2,1=1r,2,3,3=sin2θ2,3,1,3=1r,3,2,3=cotθ,3,3,1=1r,3,3,2=cotθ,4,1,4=mr2mr,4,4,1=mr2mr

(25)
  

For the all covariant Γ__μ,α,β you can pass all the indices covariant, or simpler: pass the keyword nonzero alone

Christoffelnonzero

Γα,μ,ν=1,1,1=m2mr2,1,2,2=r,1,3,3=rsinθ2,1,4,4=mr2,2,1,2=r,2,2,1=r,2,3,3=r2sinθcosθ,3,1,3=rsinθ2,3,2,3=r2sinθcosθ,3,3,1=rsinθ2,3,3,2=r2sinθcosθ,4,1,4=mr2,4,4,1=mr2

(26)
  

In a Schwarzschild spacetime, the Ricci tensor has all its components equal to zero. To see the matrix form, either pass the keyword matrix, or simpler: pass no indices

Ricci

Rμ,ν=

(27)
  

The Ricci tensor is defined in terms of the Riemann tensor as Rμ,ν=Rμ,α,να You can see how the four Riemann matrices add to form the Ricci matrix; for this purpose give values to the 1st and 3rd indices and pass the extra keyword matrix. This is the first matrix

Riemann~1,β,1,ν,matrix

R1β,1,ν1β,1,ν=

(28)
  

To add the four of them use +

Riemann~1,β,1,ν,matrix+Riemann~2,β,2,ν,matrix+Riemann~3,β,3,ν,matrix+Riemann~4,β,4,ν,matrix

R1β,1,ν1β,1,ν+R2β,2,ν2β,2,ν+R3β,3,ν3β,3,ν+R4β,4,ν4β,4,ν=

(29)

simplify

R1β,1,ν1β,1,ν+R2β,2,ν2β,2,ν+R3β,3,ν3β,3,ν+R4β,4,ν4β,4,ν=

(30)
  

Alternatively, to save entering all the terms being added (4n where n is the number of contracted indices), you can expand the implicit sum using SumOverRepeatedIndices, optionally indicating the simplifier

SumOverRepeatedIndicesRiemann~alpha,β,α,ν,matrix,simplifier=simplify

R1β,1,ν1β,1,ν+R2β,2,ν2β,2,ν+R3β,3,ν3β,3,ν+R4β,4,ν4β,4,ν=

(31)
  

The Riemann scalars S1=148Rα,β,μ,νRα,β,μ,νiRα,β,μ,νR*α,β,μ,ν and S2=196Rα,β,μ,νRα,β,ρ,βRρ,βμ,ν+iRα,β,μ,νRα,β,ρ,βR*ρ,βμ,ν for the current metric

Riemannscalars

S1=m2r6,S2=m3r9

(32)
• 

Rewrite the Riemann tensor with all its indices covariant in terms of Christoffel symbols and their derivatives and construct a tensor-array for the resulting tensorial expression; in view of the presence of trigonometric functions, use the simplifier option

Riemannμ,ν,α,β

Rα,β,μ,ν

(33)

convert,Christoffel

gα,λμΓλβ,νλβ,ννΓλβ,μλβ,μ+Γλμ,υλμ,υΓυβ,νυβ,νΓλν,υλν,υΓυβ,μυβ,μ

(34)

RTensorArray,simplifier=simplify@normal

  

Verify the result comparing R, constructed with the definition of Riemann in terms of Christoffel symbols, with the Riemann tensor itself

R1,3,1,3

sinθ2m2mr

(35)

Riemann1,3,1,3

sinθ2m2mr

(36)
  

Compare all the nonzero values of the two arrays: for Riemann, pass the option nonzero, for R use ArrayElems; the nonzero components are same:

Riemannnonzero

Rα,β,μ,ν=1,2,1,2=m2mr,1,2,2,1=m2mr,1,3,1,3=sinθ2m2mr,1,3,3,1=sinθ2m2mr,1,4,1,4=2mr3,1,4,4,1=2mr3,2,1,1,2=m2mr,2,1,2,1=m2mr,2,3,2,3=2rsinθ2m,2,3,3,2=2rsinθ2m,2,4,2,4=2mrmr2,2,4,4,2=2m2+rmr2,3,1,1,3=sinθ2m2mr,3,1,3,1=sinθ2m2mr,3,2,2,3=2rsinθ2m,3,2,3,2=2rsinθ2m,3,4,3,4=sinθ22mrmr2,3,4,4,3=sinθ22mrmr2,4,1,1,4=2mr3,4,1,4,1=2mr3,4,2,2,4=2m2+rmr2,4,2,4,2=2mrmr2,4,3,3,4=sinθ22mrmr2,4,3,4,3=sinθ22mrmr2

(37)

ArrayElemsR

1,2,1,2=m2mr,1,2,2,1=m2mr,1,3,1,3=sinθ2m2mr,1,3,3,1=sinθ2m2mr,1,4,1,4=2mr3,1,4,4,1=2mr3,2,1,1,2=m2mr,2,1,2,1=m2mr,2,3,2,3=2rsinθ2m,2,3,3,2=2rsinθ2m,2,4,2,4=2mrmr2,2,4,4,2=2m2+rmr2,3,1,1,3=sinθ2m2mr,3,1,3,1=sinθ2m2mr,3,2,2,3=2rsinθ2m,3,2,3,2=2rsinθ2m,3,4,3,4=sinθ22mrmr2,3,4,4,3=sinθ22mrmr2,4,1,1,4=2mr3,4,1,4,1=2mr3,4,2,2,4=2m2+rmr2,4,2,4,2=2mrmr2,4,3,3,4=sinθ22mrmr2,4,3,4,3=sinθ22mrmr2

(38)

evalbrhs=

true

(39)
• 

The covariant derivative of AνX 

D_μAνX

μAνX

(40)

expand

μAνXΓαμ,ναμ,νAαX

(41)
  

The divergence of AμX

D_μAμX

μAμμX

(42)

expand

2AμμXμrr+μθcosθAμμXsinθ+μAμμX

(43)

Simplify

2AμμXμrr+μθcosθAμμXsinθ+μAμμX

(44)
  

The covariant derivative for a tensor with mixed indices; in some cases expand will expand not just the covariant derivative; you can be more selective using convert; to avoid redundant display of the functionality of B use PDEtools:-declare

PDEtools:-declareBX

Br,θ,φ,twill now be displayed asB

(45)

D_μB~alpha,β,~nuX

μBαβναβν

(46)

convert,d_

μBαβναβνΓκβ,μκβ,μBακνακν+Γακ,μακ,μBκβνκβν+Γνκ,μνκ,μBαβκαβκ

(47)
• 

This expression can be rewritten in different ways. For example, rewrite Christoffel in terms of g_ and its derivatives, expand, then revert back the transformatione12

expandconvert,g_

μBαβναβνgκ,λκ,λBακνακνμgβ,λ2gκ,λκ,λBακνακνβgλ,μ2+gκ,λκ,λBακνακνλgβ,μ2+gα,λα,λBκβνκβνμgκ,λ2+gα,λα,λBκβνκβνκgλ,μ2gα,λα,λBκβνκβνλgκ,μ2+gλ,νλ,νBαβκαβκμgκ,λ2+gλ,νλ,νBαβκαβκκgλ,μ2gλ,νλ,νBαβκαβκλgκ,μ2

(48)

convert,Christoffel

μBαβναβνgκ,λκ,λBακνακνΓλ,β,μ+Γβ,λ,μ2gκ,λκ,λBακνακνΓμ,β,λ+Γλ,β,μ2+gκ,λκ,λBακνακνΓμ,β,λ+Γβ,λ,μ2+gα,λα,λBκβνκβνΓλ,κ,μ+Γκ,λ,μ2+gα,λα,λBκβνκβνΓμ,κ,λ+Γλ,κ,μ2gα,λα,λBκβνκβνΓμ,κ,λ+Γκ,λ,μ2+gλ,νλ,νBαβκαβκΓλ,κ,μ+Γκ,λ,μ2+gλ,νλ,νBαβκαβκΓμ,κ,λ+Γλ,κ,μ2gλ,νλ,νBαβκαβκΓμ,κ,λ+Γκ,λ,μ2

(49)

Simplify

ΓαμκαμκBκ,βνκ,βνΓκβ,μκβ,μBακνακν+ΓνμκνμκBαβ,καβ,κ+μBαβναβν

(50)

New commands for working with anticommutative variables and functions

  

Set first theta and Q as identifiers to work with type/anticommutative variables and functions (see Setup)

Setupanticommutativepre=Q,θ

* Partial match of 'anticommutativepre' against keyword 'anticommutativeprefix'

_______________________________________________________

anticommutativeprefix=Q,θ

(51)

aθ1θ2+b

aθ1θ2+b

(52)
  

The taylor series with respect to θ1 of a polynomial in θ1 of degree 1 is the polynomial itself; it can be computed with the new Gtaylor command

Gtaylor,θ1

aθ1θ2+b

(53)
  

The coefficients of θ1 entering this series can be computed with the new Coefficients

Coefficients,θ1

b,aθ2

(54)
  

The series expansion of a mathematical function

expxθ

ⅇxθ

(55)

Gtaylor,θ

xθ+1

(56)
  

The expansion of an arbitrary function

Fx,y,θ1,θ2

Fx,y,θ1,θ2

(57)

Gtaylor,θ1

Fx,y,0,θ2+D3Fx,y,0,θ2θ1

(58)
  

Compare with the exact expansion performed with the new ToFieldComponents

ToFieldComponents,useonly

* Partial match of 'useonly' against keyword 'useonlycommutativefunctions'

_F1x,y+_F2x,y_λ1θ1+_F3x,y_λ2θ2+_F4x,yθ1θ2

(59)
  

Computing the Coefficients helps comparing more precisely

Coefficients=,θ1,0

Fx,y,0,θ2=_F1x,y+_F3x,y_λ2θ2

(60)

Coefficients=,θ1,1

D3Fx,y,0,θ2=_F2x,y_λ1+_F4x,yθ2

(61)
  

ToFieldComponents keeps track of the expansions it performs, so there is memory of the superfield behind the field components introduced, so that it can be reconstructed from these components - the command for that purpose is ToSuperfields

ToSuperfields

Fx,y,θ1,θ2

(62)
  

ToFieldComponents and ToSuperfields provide core functionality for working with supersymmetric theories. Another new command, extending to anticommutative variables some of the existing Maple functionality for commutative variables is PerformOnAnticommutativeSystem

  

Consider this partial differential equation for the anticommutative function Q of commutative and anticommutative variables x,θ

diffQx,y,θ,x,θ=0

Qx,θ=0

(63)
  

Its solution using pdsolve, originally written to handle problems in a commutative domain

PerformOnAnticommutativeSystempdsolve,

Qx,y,θ=_F5x,y_λ3+f__7yθ

(64)
  

Note the presence of the anticommutative arbitrary constant _lambda2, introduced by dsolve when solving intermediate ordinary differential equations. In fact both dsolve and pdsolve in Maple 16 have this approach calling PerformOnAnticommutativeSystem coded within them so they can tackle the problem directly:

pdsolve

Qx,y,θ=f__8x,y_λ3+f__7yθ

(65)
  

Various commands of the PDEtools package are in Maple 16 handling anticommutative variables by means of passing the problem to PerformOnAnticommutativeSystem.

See Also

Index of New Maple 16 Features

Physics