Physics

Maple provides a state-of-the-art environment for algebraic computations in physics, with emphasis on ensuring the computational experience is as natural as possible. The theme of the Physics project for Maple 18 has been the consolidation and integration of the Physics package with the rest of the Maple library, making it even easier to combine standard Maple commands and techniques with Physics-specific computations. With more than 500 enhancements throughout the entire package to increase robustness and versatility, an extension of its typesetting capabilities to support even more standard notation, as well 17 new Physics:-Library commands to support further explorations and extensions, Maple 18 extends the range of physics-related algebraic formulations that can be done in a natural way inside Maple. The impact of these changes is across the board, from vector analysis to quantum mechanics, relativity and field theory.

As part of its commitment to providing the best possible environment for algebraic computations in physics, Maplesoft has launched a Maple Physics: Research and Development web site, where users can 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 18.

See All Examples >


Simplify

 

Simplification is perhaps the most common operation performed in a computer algebra system. In Physics, this typically entails simplifying tensorial expressions, or expressions involving noncommutative operators that satisfy certain commutator/anticommutator rules, or sums and integrals involving quantum operators and Dirac delta functions in the summands and integrands. Relevant enhancements were introduced in Maple 18 for all these cases.

Examples

> restart; 1; with(Physics); -1; Setup(mathematicalnotation = true); 1
 
[mathematicalnotation = true] (1)
 

Simplification of sums when the summand is linear in KroneckerDeltas: 

> Sum(`+`(`*`(sqrt(`+`(n, 1)), `*`(KroneckerDelta[m, `+`(n, 1)])), `*`(sqrt(n), `*`(KroneckerDelta[m, `+`(n, `-`(1))]))), n = 0 .. infinity)

Sum(`+`(`*`(`^`(`+`(n, 1), `/`(1, 2)), `*`(Physics:-KroneckerDelta[m, `+`(n, 1)])), `*`(`^`(n, `/`(1, 2)), `*`(Physics:-KroneckerDelta[m, `+`(n, `-`(1))]))), n = 0 .. infinity) (2)
 
> Simplify(Sum(`+`(`*`(`^`(`+`(n, 1), `/`(1, 2)), `*`(Physics:-KroneckerDelta[m, `+`(n, 1)])), `*`(`^`(n, `/`(1, 2)), `*`(Physics:-KroneckerDelta[m, `+`(n, `-`(1))]))), n = 0 .. infinity))
 
`+`(`*`(`^`(m, `/`(1, 2))), `*`(`^`(`+`(m, 1), `/`(1, 2)))) (3)
 

Simplification of tensorial expressions. To facilitate typing, set the spacetime indices to be lowercaselatin: 

> Setup(spacetimeindices = lowercaselatin)
 
[spacetimeindices = lowercaselatin] (4)
 

Define a tensor F[a]; -1 

> Define(F[a])
 
`Defined objects with tensor properties`
 

{Physics:-Dgamma[mu], F[a], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu]} (5)
 

 

The following tensorial expression, 

> `+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
`+`(`-`(`*`(1010921950548, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(`^`(F[j], 2), `*`(F[a], `*`(F[b], `*`(F[c])))))))), `-`(`*`(2023081095744, `*`(`^`(F[f], 2), `*`(`^`(F[d], 2), `*`(F[a], `*`(F[b], `*...
 

`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`...
(6)
 

has various terms with contracted indices. In each term, {a,b,c} are free indices: 

> Check(`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f], `...
 
`*`(`The repeated indices per term are: `[{`...`}, {`...`}, `...`], `*`(`; the free indices are: `, `*`({`...`})))
 

[{d, f, j}, {d, f}, {d, e, f, h, i, j, l, n}, {d, e, f, h, i, j, k}, {e, h}, {h, i, n}, {e, h, i, n}, {d, e, g, h, i, k, m}, {d}, {g, h}, {d, e, i, n}, {d, e}, {h}, {d, e, j}, {g, h, k}, {h, n}], {a, ...
[{d, f, j}, {d, f}, {d, e, f, h, i, j, l, n}, {d, e, f, h, i, j, k}, {e, h}, {h, i, n}, {e, h, i, n}, {d, e, g, h, i, k, m}, {d}, {g, h}, {d, e, i, n}, {d, e}, {h}, {d, e, j}, {g, h, k}, {h, n}], {a, ...
(7)
 

Taking into account Einstein's sum rule for contracted (repeated) indices, the symmetry properties of g[i, j] and delta[i, j], this tensorial expression is equal to zero: 

> Simplify(`+`(`-`(`*`(1010921950548, `*`(F[d], `*`(F[`~d`], `*`(F[f], `*`(F[`~f`], `*`(F[j], `*`(F[`~j`], `*`(F[a], `*`(F[b], `*`(F[c]))))))))))), `-`(`*`(2023081095744, `*`(F[d], `*`(F[`~d`], `*`(F[f]...
 
0 (8)
 

The simplification of integrals and sums involving quantum operators that satisfy algebra rules is now more powerful, both in the continuous and discrete case. Consider a field, psi, and its expansion in terms in a basis of functions, phi using operators, a and , that satisfy: 

> Setup(op = {a, psi}, algebrarules = {%Commutator(a(n), %Dagger(a(p))) = Dirac(`+`(n, `-`(p))), %Commutator(a(n), a(p)) = 0})
 
`* Partial match of  'op' against keyword 'quantumoperators'`
 

Typesetting:-mprintslash([[algebrarules = {Typesetting:-mcomplete(Typesetting:-msub(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (9)
 

The expansion of terms psi and `#msup(mi(is given by: 

> psi(r) = Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity)
 
Typesetting:-mprintslash([psi(r) = Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity)], [psi(r) = Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity)]) (10)
 
> subs({n = p, r = s}, Dagger(psi(r) = Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity)))
 
Typesetting:-mprintslash([Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (11)
 

The commutator [psi(r), `#msup(mi( is equal to: 

> Commutator(psi(r) = Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity), Physics:-Dagger(psi(s)) = Int(`*`(conjugate(phi(p, s)), `*`(Physics:-Dagger(a(p)))), p = `+`(`-`(infinity)) .. i...
 
Typesetting:-mprintslash([Typesetting:-msub(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (12)
 
> expand(Physics:-Commutator(psi(r), Physics:-Dagger(psi(s))) = Physics:-Commutator(Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity), Int(`*`(conjugate(phi(p, s)), `*`(Physics:-Dagger(...
 
Typesetting:-mprintslash([`+`(Physics:-`*`(psi(r), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (13)
 

The products of integrals on the right-hand side can both be combined into double integrals, then recombined into a single integral and simplified taking into account the algebra rule stated:  

> Simplify(`+`(Physics:-`*`(psi(r), Physics:-Dagger(psi(s))), `-`(Physics:-`*`(Physics:-Dagger(psi(s)), psi(r)))) = `+`(Physics:-`*`(Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity), I...
 
Typesetting:-mprintslash([`+`(Physics:-`*`(psi(r), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (14)
 

The step involving only the combination of the integrals can now also be performed separately: 

> combine(`+`(Physics:-`*`(psi(r), Physics:-Dagger(psi(s))), `-`(Physics:-`*`(Physics:-Dagger(psi(s)), psi(r)))) = `+`(Physics:-`*`(Int(`*`(phi(n, r), `*`(a(n))), n = `+`(`-`(infinity)) .. infinity), In...
 
Typesetting:-mprintslash([`+`(Physics:-`*`(psi(r), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (15)
 

The extended capabilities in Simplify regarding integration also work in the discrete case, over sums. Redo the algebra rule now considering the same relations but in the discrete case. 

> Setup(redo, quantumoperators = {a, psi}, algebrarules = {%Commutator(a[n], a[p]) = 0, %Commutator(a[n], %Dagger(a[p])) = KroneckerDelta[n, p]}, spacetimeindices = greek)
Setup(redo, quantumoperators = {a, psi}, algebrarules = {%Commutator(a[n], a[p]) = 0, %Commutator(a[n], %Dagger(a[p])) = KroneckerDelta[n, p]}, spacetimeindices = greek)
 
Typesetting:-mprintslash([[algebrarules = {Typesetting:-mcomplete(Typesetting:-msub(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-msub(Typesetting:-mi( (16)
 


The following sum can now be simplified by combining the sums and taking into account the new (discrete) algebra rules, or just performing the combination step: 

> psi(r) = Sum(`*`(phi[n](r), `*`(a[n])), n = `+`(`-`(infinity)) .. infinity)
 
psi(r) = Sum(`*`(phi[n](r), `*`(a[n])), n = `+`(`-`(infinity)) .. infinity) (17)
 
> subs({n = p, r = s}, Dagger(psi(r) = Sum(`*`(phi[n](r), `*`(a[n])), n = `+`(`-`(infinity)) .. infinity)))
 
Typesetting:-mprintslash([Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (18)
 
> expand(Commutator(psi(r) = Sum(`*`(phi[n](r), `*`(a[n])), n = `+`(`-`(infinity)) .. infinity), Physics:-Dagger(psi(s)) = Sum(`*`(conjugate(phi[p](s)), `*`(Physics:-Dagger(a[p]))), p = `+`(`-`(infinity...
 
Typesetting:-mprintslash([`+`(Physics:-`*`(psi(r), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (19)
 
> Simplify(`+`(Physics:-`*`(psi(r), Physics:-Dagger(psi(s))), `-`(Physics:-`*`(Physics:-Dagger(psi(s)), psi(r)))) = `+`(Physics:-`*`(Sum(`*`(phi[n](r), `*`(a[n])), n = `+`(`-`(infinity)) .. infinity), S...
 
Typesetting:-mprintslash([`+`(Physics:-`*`(psi(r), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (20)
 
> combine(`+`(Physics:-`*`(psi(r), Physics:-Dagger(psi(s))), `-`(Physics:-`*`(Physics:-Dagger(psi(s)), psi(r)))) = `+`(Physics:-`*`(Sum(`*`(phi[n](r), `*`(a[n])), n = `+`(`-`(infinity)) .. infinity), Su...
 
Typesetting:-mprintslash([`+`(Physics:-`*`(psi(r), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mi( (21)
 

Improvements in the simplification of annihilation and the creation of fermionic operators, as well as the related occupation number operator: 

> Setup(anticommutativeprefix = psi)
 
[anticommutativeprefix = {_lambda, psi}] (22)
 
> am := Annihilation(psi, notation = explicit)
 
(23)
 
> ap := Creation(psi, notation = explicit)
 
(24)
 

The related occupation number operator: 

> N := Typesetting:-delayDotProduct(ap, am)
 
(25)
 

Consider the application of these fermionic operators to a related state vector: 

> Ket(psi, 1)
 
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (26)
 
> Typesetting:-delayDotProduct(am, Physics:-Ket(psi, 1))
 
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (27)
 
> Typesetting:-delayDotProduct(am, Physics:-Ket(psi, 0))
 
0 (28)
 

Increasing the occupation number, 

> Typesetting:-delayDotProduct(ap, Physics:-Ket(psi, 0))
 
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (29)
 
> Typesetting:-delayDotProduct(ap, Physics:-Ket(psi, 1))
 
0 (30)
 

In other words, powers of annihilation and creation fermionic operators are equal to zero: 

> `*`(`^`(am, 2))
 
Physics:-`^`(`#msup(mi( (31)
 
> Simplify(`*`(`^`(am, 2)))
 
0 (32)
 
> Simplify(`*`(`^`(ap, 2)))
 
0 (33)
 

The occupation number operator is also idempotent: 

> `*`(`*`(N, N), `*`(N)) = N
 
(34)
 

These expressions can now be simplified: 

> Simplify(%)
 
(35)
 

The simplification of vectorial expressions was also enhanced. For example: 

> with(Vectors); -1
 
>
 
Typesetting:-mprintslash([`.`(B0_, Physics:-Vectors:-`&x`(v_, `+`(B0_, B1_)))], [Physics:-Vectors:-`.`(B0_, Physics:-Vectors:-`&x`(v_, `+`(B0_, B1_)))]) (36)
 
> Simplify(Physics:-Vectors:-`.`(B0_, Physics:-Vectors:-`&x`(v_, `+`(B0_, B1_))))
 
Typesetting:-mprintslash([`.`(B0_, Physics:-Vectors:-`&x`(v_, B1_))], [Physics:-Vectors:-`.`(B0_, Physics:-Vectors:-`&x`(v_, B1_))]) (37)


See All Examples >