Simplify - 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 : Simplify

Physics[Simplify] - simplify expressions involving objects and operations related to the Physics package

Calling Sequence

Simplify(A)

Simplify(A, kind1, kind2, ...)

Parameters

A

-

any mathematical expression

kind1, kind2, ...

-

(optional) any of algebrarules, indices, noncommutativeproducts, sum, int; the kind of simplification to perform

Description

• 

The Simplify command performs simplifications of expressions involving objects and operations related to the Physics package, including taking into account:

  

- The summation convention for repeated indices, regarding them as dummies, and including the (anti)symmetry properties of the indices of the tensorial objects involved (according to how these objects were defined by the Define command).

  

- Properties of noncommutative products.

  

- (Anti)Commutator algebra rules.

  

- Projectors and KroneckerDelta contracted indices inside sums.

• 

As with the general Maple simplifier, simplify, when you call the Physics[Simplify] command with no extra arguments, all of the simplifications are attempted. When you call it with extra arguments specifying different simplifications, any of algebrarules, bracketrules, indices, noncommutativeproducts, sum, and int, only the specified simplifications are attempted.

• 

You do not need to remember exactly all of the keywords; as with other Physics commands, Simplify will match wrong or partially spelled keywords to the first likely one, and perform the simplification. For example, Simplify(expr, alg) will invoke Simplify(expr, algebrarules).

Examples

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

Summation rule for repeated indices

  

By default, the dimension of the spacetime when you load the Physics package is 4 = 3 + 1, and the signature is `-`.

Setupdimension,signature

dimension=4,signature=- - - +

(2)
  

So the trace of the metric g_ is equal to 4.

g_ν,μ2

gμ,νgμ,νμ,ν

(3)

Simplify

4

(4)
  

The metric is used to 'raise and lower' indices in other tensors, as shown below.

g_ν,μg_ν,ρ

gμ,νδνρνρ

(5)

Simplify

gμ,ρ

(6)
  

Define A as an object having tensorial properties; that is, the summation convention for repeated indices in products should be taken into account.

DefineA

Defined objects with tensor properties

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

(7)
  

So the metric can now have indices contracted with A.

g_ν,μg_ρ,σAν,μ,ρ,σ

Aν,μ,ρ,σgμ,νμ,νgρ,σρ,σ

(8)

Simplify

Aννσσννσσ

(9)
  

The metric is totally symmetric with respect to interchange of positions of its indices, while the LeviCivita symbol, in the Maple worksheet displayed as epsilon, is totally antisymmetric. So the contraction of their respective indices is equal to zero.

g_ν,μLeviCivitaν,μ,σ,ρ

εμ,ν,ρ,σgμ,νμ,ν

(10)

Simplify

0

(11)
  

For the same reason, the contraction of any two of the indices of the LeviCivita symbol is also zero.

LeviCivitaν,ν,ρ,σ

0

(12)
  

As is the product of the LeviCivita symbol, where the same spacetime vector appears two times, contracting different indices of epsilon. To illustrate this case, first Define q to represent this generic tensor.

Defineq

Defined objects with tensor properties

q,Aν,μ,ρ,σ,γμ,σμ,μ,gμ,ν,εα,β,μ,ν

(13)

LeviCivitaν,μ,σ,ρqμqν

εμ,ν,ρ,σqμμqνν

(14)

Simplify

0

(15)
  

When defining an object to have tensorial properties, you can define the symmetry properties of the indices of the object as well. The following Defines B and C as totally symmetric and totally antisymmetric, respectively.

DefineB,symmetric

Defined objects with tensor properties

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

(16)

DefineC,antisymmetric

Defined objects with tensor properties

B,C,Aν,μ,ρ,σ,γμ,σμ,μ,gμ,ν,qνν,εα,β,μ,ν

(17)

Bμ,νLeviCivitaν,μ,σ,ρ

εμ,ν,ρ,σBμ,νμ,ν

(18)

Simplify

0

(19)

DefineB,query

Totally symmetric tensor, structured as name,indices,variables :

B,2,0,0,0

(20)

Cμ,νg_ν,μ

gμ,νCμ,νμ,ν

(21)

Simplify

0

(22)

DefineC,query

Totally antisymmetric tensor, structured as name,indices,variables :

C,2,0,0,0

(23)

Bμ,νCμ,ν

Bμ,νCμ,νμ,ν

(24)

Simplify

0

(25)
  

The number of indices of the LeviCivita symbol depends on the dimension of spacetime. For any dimension and signature, the contracted product of two LeviCivita symbols can be expressed as a sum of products involving the metric g_. Note the use of Check to tell which indices are repeated (contracted) and which are free at any point.

LeviCivitaν,μ,α,βLeviCivitaμ,σ,ρ,τ

εα,β,μ,νεμρ,σ,τμρ,σ,τ

(26)

Check,indices,all

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

μ,α,β,ν,ρ,σ,τ

(27)

Simplify

gα,ρgβ,σ+gα,σgβ,ρgν,τgα,σgβ,τgν,ρ+gα,τgβ,σgν,ρgα,τgβ,ρgν,σ+gα,ρgβ,τgν,σ

(28)

LeviCivitaν,μ,σ,ρLeviCivitaν,μ,α,β

εα,β,μ,νεμ,νρ,σμ,νρ,σ

(29)

Check,indices,all

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

μ,ν,α,β,ρ,σ

(30)

Simplify

2gα,ρgβ,σ2gα,σgβ,ρ

(31)

LeviCivitaν,μ,α,σLeviCivitaν,μ,α,β

εα,μ,ν,σεαβμ,ναβμ,ν

(32)

Check,indices,all

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

α,μ,ν,β,σ

(33)

Simplify

6gβ,σ

(34)

LeviCivitaν,μ,α,β2

εα,β,μ,νεα,β,μ,να,β,μ,ν

(35)

Check,indices,all

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

α,β,μ,ν,

(36)

Simplify

−24

(37)
  

Note that the results above are different if the dimension or signature of spacetime are different from 4 and `-`, respectively.

  

During normal computations, a frequent occurrence is when two products have tensors with the same contracted indices, but in each product the contracted indices are represented by different letters, thus obscuring the fact that the two products are mathematically equal.

DefineF,quiet

F,Aν,μ,ρ,σ,Bμ,νμ,ν,Cμ,ν,γμ,σμ,μ,gμ,ν,qνν,εα,β,μ,ν

(38)

Fμ,νCν,ρ+Fμ,αCα,ρ

Cα,ρFμαμα+Cν,ρFμνμν

(39)

Check,indices,all

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

α,ν,μ,ρ

(40)

Simplify

2Cα,ρFμαμα

(41)
  

The following example would be a little trickier to tell.

DefineAμ,Cμ,redo,quiet

Aμ,Bμ,νμ,ν,Cμ,γμ,Fμαμα,σμ,μ,gμ,ν,qνν,εα,β,μ,ν

(42)

Definequery,A,C

Tensors structured as name,indices,variables:

A,1,0,0,0,C,1,0,0,0

(43)

LeviCivitaν,μ,α,σLeviCivitaν,μ,α,βAβCσAσCβ

AβCσAσCβεα,μ,νσα,μ,νσεα,β,μ,να,β,μ,ν

(44)

Simplify

0

(45)

Sums, KroneckerDelta, and Projectors

  

Expressions involving sums with KroneckerDelta indices contracted or with Projectors in the summand, and integrals involving Dirac functions, are simplifiable by using Simplify.

  

Consider a basis, labeled A, whose dimension is M+1.

Setupbasisdim=A=0..M

* Partial match of 'basisdim' against keyword 'quantumbasisdimension'

_______________________________________________________

quantumbasisdimension=A=0..M

(46)
  

The projector onto this basis is:

ProjectorKetA,j

j=0MAjAj

(47)
  

So this expression,

SumBracketBraΨ,n,KetA,jBracketBraA,j,KetΨ,m,j=0..M

j=0MΨn|AjAj|Ψm

(48)
  

where you see the projector inserted in the Bracket, can be simplified to:

Simplify

δm,n

(49)
  

Expressions involving Sums with KroneckerDelta in the summand, provided that the indices in KroneckerDelta are inside the summation range (you can use assuming to enforce that), are also simplifiable.

SumSumSumSumconjugatean,iai,mKroneckerDeltai,jKroneckerDeltam,n,j=0..M,i=0..M,n=0..M,m=0..M

m=0Mn=0Mi=0Mj=0Man,i&conjugate0;ai,mδi,jδm,n

(50)

Simplify

m=0Mi=0Mam,i&conjugate0;ai,m

(51)
  

In the following example, both simplifications are used together.

SumSumSumSumconjugatean,iai,mBracketBraΨ,n,KetA,jBracketBraA,j,KetΨ,m,j=0..M,i=0..M,n=0..M,m=0..M

m=0Mn=0Mi=0Mj=0Man,i&conjugate0;ai,mΨn|AjAj|Ψm

(52)

Simplify

m=0Mi=0Mam,i&conjugate0;ai,m

(53)

Noncommutative products and (Anti)Commutator algebras

  

Two different kinds of simplifications are available: a normalization of products involving noncommutative operands some of which commute between themselves (that have Commutator equal to zero), and a simplification taking into account (Anti)Commutator rules (that have (Anti)Commutator not equal to zero). These simplifications are frequently required, for example, when deriving the Commutator algebra of problems involving angular momentum or Annihilation/Creation operators.

  

1. Consider the angular momentum operators |L|, Lx,Ly, and Lz in quantum mechanics. Verify that the Commutator of |L|^2 with any of the components of L is equal to zero (see for instance Chapter VI of the reference, below). For that purpose, a 3-D vector-quantum-operator representation of L is constructed with the Vectors package (vectorpostfix identifier is '_'), setting L, Lx,Ly,Lz, r, and p, as well as their components, as quantum operators.

withPhysics:-Vectors

&x,`+`,`.`,Assume,ChangeBasis,ChangeCoordinates,CompactDisplay,Component,Curl,DirectionalDiff,Divergence,Gradient,Identify,Laplacian,,Norm,ParametrizeCurve,ParametrizeSurface,ParametrizeVolume,Setup,Simplify,`^`,diff,int

(54)

Setupquantumoperators=L_,Lx,Ly,Lz,p_,px,py,pz,r_,x,y,z

quantumoperators=L,Lx,Ly,Lz,p,px,py,pz,r,x,y,z

(55)
  

So for |L|^2 and L itself in terms of the vector operators r and p, you have:

LLL_·L_

LLL·L

(56)

L_r_&xp_

Lr×p

(57)
  

where

r_x_i+y_j+z_k

rix+jy+kz

(58)

p_px_i+py_j+pz_k

pipx+jpy+kpz

(59)
  

The Commutator rules for the components Li are a consequence of the Commutator rules for the components of r and p. These rules can be set by using the Setup command, entering all of the commutators between any two of {x,y,z,px,py,pz}, as in Setupalgebrarules={%Commutatorx,px=I,%Commutatorx,py=0,%Commutatorx,y=0,...}. A convenient alternative for situations such as this is to create an indexing procedure for a Matrix. For example,

Ca,i,b,j%CommutatorComponenta,i,Componentb,j

Ca,i,b,jai,bj

(60)

algebrai,jCr_,i,p_,j=IKroneckerDeltai,j,Cr_,i,r_,j=0,Cp_,i,p_,j=0

algebrai,jCr,i,p,j=Iδi,j,Cr,i,r,j=0,Cp,i,p,j=0

(61)
  

The commutators are then generated by the Matrix constructor, and the whole Matrix can be passed to Setup.

Matrix3,3,algebra

(62)

Setup

algebrarules=px,py=0,px,pz=0,py,pz=0,x,px=I,x,py=0,x,pz=0,x,y=0,x,z=0,y,px=0,y,py=I,y,pz=0,y,z=0,z,px=0,z,py=0,z,pz=I

(63)
  

The components of L are:

LxComponentL_,1

Lxypzzpy

(64)

LyComponentL_,2

Lyzpxxpz

(65)

LzComponentL_,3

Lzxpyypx

(66)
  

To verify that |L|^2=LL commutes with each Li,

%CommutatorLL,Lx

ypzzpy2+zpxxpz2+xpyypx2,ypzzpy

(67)

value

0

(68)

CommutatorLL,Ly

0

(69)

CommutatorLL,Lz

0

(70)
• 

Depending on the case, an expansion of the Commutator is sometimes necessary to verify its value is 0, or to take the commutator rules into account in all subexpressions use Simplify.

  

2. Using a quantum-operator-tensor notation for the components of L, show that [Li,Lj]=Iepsilon[i,j,k]Lk (see the exercises of Chap VI in Cohen-Tannoudji). For this purpose, set the dimension of spacetime to 3, and its signature to Euclidean. To follow textbook notation, also use lowercaselatin letters for space tensor indices (see Setup).

Setupdimension=3,signature=`+`,spacetimeindices=lowercaselatin_is,spaceindices=none,quiet

dimension=3,signature=+ + +,spaceindices=none,spacetimeindices=lowercaselatin_is

(71)
  

Define r and p as tensors in this 3-D Euclidean space to be able to Simplify the result by using Einstein's summation convention for repeated (tensor) indices.

Definer,p

Defined objects with tensor properties

p,r,γi,σi,i,gi,j,εi,j,k

(72)
  

Now set the related Commutator rules defining the algebra in tensor notation; in doing so, erase also previous settings (by using the redo option of Setup) for quantum operators and algebra rules (not necessary here, but sometimes desired).

Setupredo,quantumoperators=L,p,r,algebrarules=%Commutatorpi,pj=0,%Commutatorri,pj=Ikd_i,j,%Commutatorri,rj=0

algebrarules=pi,pj=0,ri,pj=Iδi,j,ri,rj=0,quantumoperators=L,p,r

(73)
  

Verify how this algebra of Commutators works.

%Commutatorrj,pk

rj,pk

(74)

value

Iδj,k

(75)

Commutatorrjpk,rmpm

Iδk,mrjpm+Iδj,mrmpk

(76)
  

Enter expressions for the tensor components of L that enter the commutator Li,Lj, to verify that it is equal to Iepsilon[i,j,k]Lk. In doing so, use the default abbreviation ε for the LeviCivita pseudo-tensor.

Liep_i,m,nrmpn

Liεi,m,nrmpn

(77)

Ljsubsi=j,Li

Ljεj,m,nrmpn

(78)
  

Compute the Commutator.

ansCommutatorLi,Lj

ansεi,m,nεj,k,lIδk,nrmpl+Iδl,mrkpn

(79)
  

The above is indeed Lk, but is missing some simplification of the contracted indices of the LeviCivita and KroneckerDelta tensors, and the indices of the quantum operators r,p involved in the noncommutative products.

Simplifyans

−Irjpiripj

(80)

See Also

&x, Bra, Bracket, Check, Component, Define, g_, Ket, KroneckerDelta, LeviCivita, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Projector, Setup, Vectors

References

  

Cohen-Tannoudji, C.; Diu, B.; and Laloe, F. Quantum Mechanics. Paris, France: Hermann, 1977.