Education

Teaching and learning about math, Maple and MapleSim


 

In a previous Mapleprimes question related to Dirac Matrices, I was asked how to represent the algebra of Dirac matrices with an identity matrix on the right-hand side of  %AntiCommutator(Physics:-Dgamma[j], Physics:-Dgamma[k]) = 2*g[j, k]. Since this is a hot-topic in general, in that, making it work, involves easy and useful functionality however somewhat hidden, not known in general, it passed through my mind that this may be of interest in general. (To reproduce the computations below you need to update your Physics library with the one distributed at the Maplesoft R&D Physics webpage.)

 

restart

with(Physics)

 

First of all, this shows the default algebra rules loaded when you load the Physics package, for the Pauli  and Dirac  matrices

Library:-DefaultAlgebraRules()

%Commutator(Physics:-Psigma[j], Physics:-Psigma[k]) = (2*I)*(Physics:-Psigma[1]*Physics:-LeviCivita[4, j, k, `~1`]+Physics:-Psigma[2]*Physics:-LeviCivita[4, j, k, `~2`]+Physics:-Psigma[3]*Physics:-LeviCivita[4, j, k, `~3`]), %AntiCommutator(Physics:-Psigma[j], Physics:-Psigma[k]) = 2*Physics:-KroneckerDelta[j, k], %AntiCommutator(Physics:-Dgamma[j], Physics:-Dgamma[k]) = 2*Physics:-g_[j, k]

(1)

Now, you can always overwrite these algebra rules.

 

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 2x2 with the number 1 in the diagonal and a bunch of 0, I will use the old matrix command, not the new Matrix (see more comments on this at the end). One way of entering this identity matrix is

`𝕀` := matrix(4, 4, proc (i, j) options operator, arrow; KroneckerDelta[i, j] end proc)

array( 1 .. 4, 1 .. 4, [( 4, 1 ) = (0), ( 1, 2 ) = (0), ( 2, 3 ) = (0), ( 1, 3 ) = (0), ( 2, 2 ) = (1), ( 4, 2 ) = (0), ( 3, 4 ) = (0), ( 1, 4 ) = (0), ( 3, 1 ) = (0), ( 4, 4 ) = (1), ( 3, 2 ) = (0), ( 1, 1 ) = (1), ( 2, 1 ) = (0), ( 4, 3 ) = (0), ( 3, 3 ) = (1), ( 2, 4 ) = (0)  ] )

(2)

The most important advantage of the old matrix command is that I is of type algebraic and, consequently, this is the important thing, one can operate with it algebraically and its contents are not displayed:

type(`𝕀`, algebraic)

true

(3)

`𝕀`

`𝕀`

(4)

And so, most commands of the Maple library, that only work with objects of type algebraic, will handle the task. The contents are displayed only on demand, for instance using eval

eval(`𝕀`)

array( 1 .. 4, 1 .. 4, [( 4, 1 ) = (0), ( 1, 2 ) = (0), ( 2, 3 ) = (0), ( 1, 3 ) = (0), ( 2, 2 ) = (1), ( 4, 2 ) = (0), ( 3, 4 ) = (0), ( 1, 4 ) = (0), ( 3, 1 ) = (0), ( 4, 4 ) = (1), ( 3, 2 ) = (0), ( 1, 1 ) = (1), ( 2, 1 ) = (0), ( 4, 3 ) = (0), ( 3, 3 ) = (1), ( 2, 4 ) = (0)  ] )

(5)

Returning to the topic at hands: set now the algebra the way you want, with an I matrix on the right-hand side, and without seeing a bunch of 0 and 1

%AntiCommutator(Dgamma[mu], Dgamma[nu]) = 2*g_[mu, nu]*`𝕀`

%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]) = 2*Physics:-g_[mu, nu]*`𝕀`

(6)

Setup(algebrarules = (%AntiCommutator(Physics[Dgamma][mu], Physics[Dgamma][nu]) = 2*Physics[g_][mu, nu]*`𝕀`))

[algebrarules = {%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]) = 2*Physics:-g_[mu, nu]*`𝕀`}]

(7)

And that is all.

 

Check it out

(%AntiCommutator = AntiCommutator)(Dgamma[mu], Dgamma[nu])

%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]) = 2*Physics:-g_[mu, nu]*`𝕀`

(8)

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)

 

Again you can 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 the object normally since they are not 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"

 

_local(Psi)

Setup(anticommutativeprefix = {Psi, psi})

[anticommutativeprefix = {_lambda, psi, :-Psi}]

(9)

In addition, following your question, in this example I explicitly specify the components of the spinor, in any preferred way, for example here I use psi[j]

Psi := matrix(4, 1, [psi[1], psi[2], psi[3], psi[4]])

array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] )

(10)

Check it out:

Psi

Psi

(11)

type(Psi, algebraic)

true

(12)

Let's see all this working together by multiplying the anticommutator equation by Psi

(%AntiCommutator(Physics[Dgamma][mu], Physics[Dgamma][nu]) = 2*Physics[g_][mu, nu]*`𝕀`)*Psi

Physics:-`*`(%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]), Psi) = 2*Physics:-g_[mu, nu]*Physics:-`*`(`𝕀`, Psi)

(13)

Suppose now that you want to see the matrix form of this equation

Library:-RewriteInMatrixForm(Physics[`*`](%AntiCommutator(Physics[Dgamma][mu], Physics[Dgamma][nu]), Psi) = 2*Physics[g_][mu, nu]*Physics[`*`](`𝕀`, Psi))

Physics:-`.`(%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]), array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] )) = 2*Physics:-g_[mu, nu]*Physics:-`.`(array( 1 .. 4, 1 .. 4, [( 4, 1 ) = (0), ( 1, 2 ) = (0), ( 2, 3 ) = (0), ( 1, 3 ) = (0), ( 2, 2 ) = (1), ( 4, 2 ) = (0), ( 3, 4 ) = (0), ( 1, 4 ) = (0), ( 3, 1 ) = (0), ( 4, 4 ) = (1), ( 3, 2 ) = (0), ( 1, 1 ) = (1), ( 2, 1 ) = (0), ( 4, 3 ) = (0), ( 3, 3 ) = (1), ( 2, 4 ) = (0)  ] ), array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] ))

(14)

The above has the matricial operations delayed; unleash them

%

Physics:-`.`(%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]), array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] )) = 2*Physics:-g_[mu, nu]*(array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] ))

(15)

Or directly perform in one go the matrix operations behind (13)

Library:-PerformMatrixOperations(Physics[`*`](%AntiCommutator(Physics[Dgamma][mu], Physics[Dgamma][nu]), Psi) = 2*Physics[g_][mu, nu]*Physics[`*`](`𝕀`, Psi))

Physics:-`.`(%AntiCommutator(Physics:-Dgamma[mu], Physics:-Dgamma[nu]), array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] )) = 2*Physics:-g_[mu, nu]*(array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] ))

(16)

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

Physics:-`*`(`𝕀`, Psi)

(17)

And this performs the operation

`𝕀`.Psi

array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] )

(18)

Or to only displaying the operation

Library:-RewriteInMatrixForm(Physics[`*`](`𝕀`, Psi))

Physics:-`.`(array( 1 .. 4, 1 .. 4, [( 4, 1 ) = (0), ( 1, 2 ) = (0), ( 2, 3 ) = (0), ( 1, 3 ) = (0), ( 2, 2 ) = (1), ( 4, 2 ) = (0), ( 3, 4 ) = (0), ( 1, 4 ) = (0), ( 3, 1 ) = (0), ( 4, 4 ) = (1), ( 3, 2 ) = (0), ( 1, 1 ) = (1), ( 2, 1 ) = (0), ( 4, 3 ) = (0), ( 3, 3 ) = (1), ( 2, 4 ) = (0)  ] ), array( 1 .. 4, 1 .. 1, [( 4, 1 ) = (psi[4]), ( 3, 1 ) = (psi[3]), ( 1, 1 ) = (psi[1]), ( 2, 1 ) = (psi[2])  ] ))

(19)

And to perform all these matricial operations within an algebraic expression,

Library:-PerformMatrixOperations(Physics[`*`](`𝕀`, Psi))

Matrix(%id = 18446744079185513758)

(20)

``

 


 

Download DiracAlgebraWithIdentityMatrix.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft


 

Quantum Commutation Rules Basics

 

Pascal Szriftgiser1 and Edgardo S. Cheb-Terrab2 

(1) Laboratoire PhLAM, UMR CNRS 8523, Université Lille 1, F-59655, France

(2) Maplesoft

NULL

NULL

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

 

p[n] = -i*`ℏ`*`∂`[n]

These two exercises illustrate how to have full control of the computational process by using different elements of the Maple language, including inert representations of abstract vectorial differential operators, Hermitian operators, algebra rules, etc.

 

These exercises also illustrate a new feature of the Physics package, introduced in Maple 2017, that is getting refined (the computation below requires the Maplesoft updates of the Physics package) which is the ability to perform computations algebraically, using the product operator, but with differential operators, and transform the products into the application of the operators only when we want that, as we do with paper and pencil.

 

%Commutator(g(x, y, z), p_) = I*`ℏ`*Nabla(F(X))

 

restart; with(Physics); with(Physics[Vectors]); interface(imaginaryunit = 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

 

Setup(mathematicalnotation = true, differentialoperators = {[p_, [x, y, z]]}, hermitianoperators = {p, x, y, z}, algebrarules = {%Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, z) = 0}, quiet)

[algebrarules = {%Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, z) = 0}, differentialoperators = {[p_, [x, y, z]]}, hermitianoperators = {p, x, y, z}, mathematicalnotation = true]

(1.1)

Assuming F(X) is a smooth function, the idea is to apply the commutator %Commutator(F(X), p_) to an arbitrary ket of the Hilbert space Ket(psi, x, y, z), perform the operation explicitly after setting a differential operator representation for `#mover(mi("p",mathcolor = "olive"),mo("→"))`, and from there get the commutation rule between F(X) and `#mover(mi("p",mathcolor = "olive"),mo("→"))`.

 

Start introducing the commutator, to proceed with full control of the operations we use the inert form %Commutator

alias(X = (x, y, z))

CompactDisplay(F(X))

` F`(X)*`will now be displayed as`*F

(1.2)

%Commutator(F(X), p_)*Ket(psi, X)

Physics:-`*`(%Commutator(F(X), p_), Physics:-Ket(psi, x, y, z))

(1.3)

For illustration purposes only (not necessary), expand this commutator

Physics[`*`](%Commutator(F(X), p_), Physics[Ket](psi, x, y, z)) = expand(Physics[`*`](%Commutator(F(X), p_), Physics[Ket](psi, x, y, z)))

Physics:-`*`(%Commutator(F(X), p_), Physics:-Ket(psi, x, y, z)) = Physics:-`*`(F(X), p_, Physics:-Ket(psi, x, y, z))-Physics:-`*`(p_, F(X), Physics:-Ket(psi, x, y, z))

(1.4)

Note that  `#mover(mi("p",mathcolor = "olive"),mo("→"))`, F(X) and the ket Ket(psi, 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 `#mover(mi("p",mathcolor = "olive"),mo("→"))`. 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:

Physics[`*`](%Commutator(F(X), p_), Physics[Ket](psi, x, y, z)) = Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](%Commutator(F(X), p_), Physics[Ket](psi, x, y, z)))

Physics:-`*`(%Commutator(F(X), p_), Physics:-Ket(psi, x, y, z)) = Physics:-`*`(F(X), p_(Physics:-Ket(psi, x, y, z)))-p_(Physics:-`*`(F(X), Physics:-Ket(psi, x, y, z)))

(1.5)

Note that, in `#mover(mi("p",mathcolor = "olive"),mo("→"))`(F(X)*Ket(psi, x, y, z)), the application of `#mover(mi("p",mathcolor = "olive"),mo("→"))` is not expanded: at this point nothing is known about  `#mover(mi("p",mathcolor = "olive"),mo("→"))` , it is not necessarily a linear operator. In the Quantum Mechanics problem at hands, however, it is. So give now the operator  `#mover(mi("p",mathcolor = "olive"),mo("→"))` an explicit representation as a linear vectorial differential operator (we use the inert form %Nabla, %Nabla, to be able to proceed with full control one step at a time)

p_ := proc (f) options operator, arrow; -I*`ℏ`*%Nabla(f) end proc

proc (f) options operator, arrow; -Physics:-`*`(Physics:-`*`(I, `ℏ`), %Nabla(f)) end proc

(1.6)

The expression (1.5) becomes

Physics[`*`](%Commutator(F(X), p_), Physics[Ket](psi, x, y, z)) = Physics[`*`](F(X), p_(Physics[Ket](psi, x, y, z)))-p_(Physics[`*`](F(X), Physics[Ket](psi, x, y, z)))

Physics:-`*`(%Commutator(F(X), p_), Physics:-Ket(psi, x, y, z)) = -I*`ℏ`*Physics:-`*`(F(X), %Nabla(Physics:-Ket(psi, x, y, z)))+I*`ℏ`*%Nabla(Physics:-`*`(F(X), Physics:-Ket(psi, x, y, z)))

(1.7)

Activate now the inert operator VectorCalculus[Nabla] and simplify taking into account the algebra rules for the coordinate operators {%Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, z) = 0}

Simplify(value(Physics[`*`](%Commutator(F(X), p_), Physics[Ket](psi, x, y, z)) = -I*`ℏ`*Physics[`*`](F(X), %Nabla(Physics[Ket](psi, x, y, z)))+I*`ℏ`*%Nabla(Physics[`*`](F(X), Physics[Ket](psi, x, y, z)))))

Physics:-`*`(Physics:-Commutator(F(X), p_), Physics:-Ket(psi, x, y, z)) = I*`ℏ`*_i*Physics:-`*`(diff(F(X), x), Physics:-Ket(psi, x, y, z))+I*`ℏ`*_j*Physics:-`*`(diff(F(X), y), Physics:-Ket(psi, x, y, z))+I*`ℏ`*_k*Physics:-`*`(diff(F(X), z), Physics:-Ket(psi, x, y, z))

(1.8)

To make explicit the gradient in disguise on the right-hand side, factor out the arbitrary ket Ket(psi, x, y, z)

Factor(Physics[`*`](Physics[Commutator](F(X), p_), Physics[Ket](psi, x, y, z)) = I*`ℏ`*_i*Physics[`*`](diff(F(X), x), Physics[Ket](psi, x, y, z))+I*`ℏ`*_j*Physics[`*`](diff(F(X), y), Physics[Ket](psi, x, y, z))+I*`ℏ`*_k*Physics[`*`](diff(F(X), z), Physics[Ket](psi, x, y, z)))

Physics:-`*`(Physics:-Commutator(F(X), p_), Physics:-Ket(psi, x, y, z)) = I*`ℏ`*Physics:-`*`((diff(F(X), y))*_j+(diff(F(X), z))*_k+(diff(F(X), x))*_i, Physics:-Ket(psi, x, y, z))

(1.9)

Combine now the expanded gradient into its inert (not-expanded) form

subs((Gradient = %Gradient)(F(X)), Physics[`*`](Physics[Commutator](F(X), p_), Physics[Ket](psi, x, y, z)) = I*`ℏ`*Physics[`*`]((diff(F(X), y))*_j+(diff(F(X), z))*_k+(diff(F(X), x))*_i, Physics[Ket](psi, x, y, z)))

Physics:-`*`(Physics:-Commutator(F(X), p_), Physics:-Ket(psi, x, y, z)) = I*`ℏ`*Physics:-`*`(%Gradient(F(X)), Physics:-Ket(psi, x, y, z))

(1.10)

Since (1.10) is true for allKet(psi, 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 `#mover(mi("p",mathcolor = "olive"),mo("→"))`

(Physics[`*`](Physics[Commutator](F(X), p_), Ket(psi, x, y, z)) = I*`ℏ`*Physics[`*`](%Gradient(F(X)), Ket(psi, x, y, z)))*Inverse(Ket(psi, x, y, z))

Physics:-Commutator(F(X), p_) = I*`ℏ`*%Gradient(F(X))

(1.11)

Tensor notation, "[`X__m`,P[n]][-]=i `ℏ` g[m,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; with(Physics); interface(imaginaryunit = i)

Setup(mathematicalnotation = true, coordinates = cartesian, spaceindices = lowercaselatin, algebrarules = {%Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, z) = 0}, hermitianoperators = {P, X, p}, differentialoperators = {[P[m], [x, y, z]]}, quiet)

[algebrarules = {%Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, z) = 0}, coordinatesystems = {X}, differentialoperators = {[P[m], [x, y, z]]}, hermitianoperators = {P, p, t, x, y, z}, mathematicalnotation = true, spaceindices = lowercaselatin]

(2.1)

Define now the tensor P[m]

Define(P[m], quiet)

{Physics:-Dgamma[mu], P[m], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2.2)

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

Commutator(X[m], P[n])*Ket(psi, x, y, z)

Physics:-`*`(Physics:-Commutator(Physics:-SpaceTimeVector[m](X), P[n]), Physics:-Ket(psi, x, y, z))

(2.3)

Expand first (not necessary) to see how the operator P[n] is going to be applied

Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)) = expand(Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)))

Physics:-`*`(Physics:-Commutator(Physics:-SpaceTimeVector[m](X), P[n]), Physics:-Ket(psi, x, y, z)) = Physics:-`*`(Physics:-SpaceTimeVector[m](X), P[n], Physics:-Ket(psi, x, y, z))-Physics:-`*`(P[n], Physics:-SpaceTimeVector[m](X), Physics:-Ket(psi, x, y, z))

(2.4)

Now expand and directly apply in one ago the differential operator P[n]

Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)) = Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)))

Physics:-`*`(Physics:-Commutator(Physics:-SpaceTimeVector[m](X), P[n]), Physics:-Ket(psi, x, y, z)) = Physics:-`*`(Physics:-SpaceTimeVector[m](X), P[n](Physics:-Ket(psi, x, y, z)))-P[n](Physics:-`*`(Physics:-SpaceTimeVector[m](X), Physics:-Ket(psi, x, y, z)))

(2.5)

Introducing the explicit differential operator representation for P[n], here again using the inert %d_[n] to keep control of the computations step by step

P[n] := proc (f) options operator, arrow; -I*`ℏ`*%d_[n](f) end proc

proc (f) options operator, arrow; -Physics:-`*`(Physics:-`*`(I, `ℏ`), %d_[n](f)) end proc

(2.6)

The expanded and applied commutator (2.5) becomes

Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)) = Physics[`*`](Physics[SpaceTimeVector][m](X), P[n](Ket(psi, x, y, z)))-P[n](Physics[`*`](Physics[SpaceTimeVector][m](X), Ket(psi, x, y, z)))

Physics:-`*`(Physics:-Commutator(Physics:-SpaceTimeVector[m](X), P[n]), Physics:-Ket(psi, x, y, z)) = -I*`ℏ`*Physics:-`*`(Physics:-SpaceTimeVector[m](X), %d_[n](Physics:-Ket(psi, x, y, z)))+I*`ℏ`*%d_[n](Physics:-`*`(Physics:-SpaceTimeVector[m](X), Physics:-Ket(psi, x, y, z)))

(2.7)

Activate now the inert operators %d_[n] and simplify taking into account Einstein's rule for repeated indices

Simplify(value(Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)) = -I*`ℏ`*Physics[`*`](Physics[SpaceTimeVector][m](X), %d_[n](Ket(psi, x, y, z)))+I*`ℏ`*%d_[n](Physics[`*`](Physics[SpaceTimeVector][m](X), Ket(psi, x, y, z)))))

Physics:-`*`(Physics:-Commutator(Physics:-SpaceTimeVector[m](X), P[n]), Physics:-Ket(psi, x, y, z)) = I*`ℏ`*Physics:-g_[m, n]*Physics:-Ket(psi, x, y, z)

(2.8)

Since the ket Ket(psi, 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 hwo it automatically expands the commutator

Coefficients(Physics[`*`](Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]), Ket(psi, x, y, z)) = I*`ℏ`*Physics[g_][m, n]*Ket(psi, x, y, z), Ket(psi, x, y, z))

Physics:-`*`(Physics:-SpaceTimeVector[m](X), P[n])-Physics:-`*`(P[n], Physics:-SpaceTimeVector[m](X)) = I*`ℏ`*Physics:-g_[m, n]

(2.9)

One can undo this (frequently undesired) expansion of the commutator by sorting the products on the left-hand side using the commutator between X[m] and P[n]

Library:-SortProducts(Physics[`*`](Physics[SpaceTimeVector][m](X), P[n])-Physics[`*`](P[n], Physics[SpaceTimeVector][m](X)) = I*`ℏ`*Physics[g_][m, n], [P[n], X[m]], usecommutator)

Physics:-Commutator(Physics:-SpaceTimeVector[m](X), P[n]) = I*`ℏ`*Physics:-g_[m, n]

(2.10)

And that is the result we wanted to compute.

 

Additionally, to see this rule in matrix form,

TensorArray(-(Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]) = I*`ℏ`*Physics[g_][m, n]))

Matrix(%id = 18446744078261558678)

(2.11)

In the above, we use equation (2.10) multiplied by -1 to avoid a minus sign in all the elements of (2.11), 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 `#mover(mi("p",mathcolor = "olive"),mo("→"))` , redefine the tensor P[n] explicitly indicating its Cartesian components

Define(P[m] = [p__x, p__y, p__z], quiet)

{Physics:-Dgamma[mu], P[m], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2.12)

TensorArray(-(Physics[Commutator](Physics[SpaceTimeVector][m](X), P[n]) = I*`ℏ`*Physics[g_][m, n]))

Matrix(%id = 18446744078575996430)

(2.13)

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 = {%Commutator(x, p__x) = I*`ℏ`, %Commutator(x, p__y) = 0, %Commutator(x, p__z) = 0, %Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, p__x) = 0, %Commutator(y, p__y) = I*`ℏ`, %Commutator(y, p__z) = 0, %Commutator(y, z) = 0, %Commutator(z, p__x) = 0, %Commutator(z, p__y) = 0, %Commutator(z, p__z) = I*`ℏ`}]

(2.14)

For example, from herein computations are performed taking into account that

(%Commutator = Commutator)(x, p__x)

%Commutator(x, p__x) = I*`ℏ`

(2.15)

NULL

NULL


 

Download DifferentialOperatorCommutatorRules.mw

 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

I am pleased to announce that a new release of Maple T.A., our online testing and assessment system, is now available. Maple T.A. 2017 includes significant enhancements to learning management system integration, as well as security, performance, and other improvements. These same improvements are also available in a new version of the  Maple T.A. MAA Placement Test Suite.  For more information, see What’s New in Maple T.A. 

 

This presentation is about magnetic traps for neutral particles, first achieved for cold neutrons and nowadays widely used in cold-atom physics. The level is that of undergraduate electrodynamics and tensor calculus courses. Tackling this topic within a computer algebra worksheet as shown below illustrates well the kind of advanced computations that can be done today with the Physics package. A new feature minimizetensorcomponents and related functionality is used along the presentation, that requires the updated Physics library distributed at the Maplesoft R&D Physics webpage.
 

 

Magnetic traps in cold-atom physics

 

Pascal Szriftgiser1 and Edgardo S. Cheb-Terrab2 

(1) Laboratoire PhLAM, UMR CNRS 8523, Université Lille 1, F-59655, France

(2) Maplesoft

 

We consider a device constructed with a set of electrical wires fed with constant electrical currents. Those wires can have an arbitrary complex shape. The device is operated in a regime such that, in some region of interest, the moving particles experience a magnetic field that varies slowly compared to the Larmor spin precession frequency. In this region, the effective potential is proportional to the modulus of the field: LinearAlgebra[Norm](`#mover(mi("B"),mo("→"))`(x, y, z)), this potential has a minimum and, close to this minimum, the device behaves as a magnetic trap.

 

 

 

Figure 1: Schematic representation of a Ioffe-Pritchard magnetic trap. It is made of four infinite rods and two coils.

_________________________________________

 

Following [1], we show that:

 

  

a) For a time-independent magnetic field  `#mover(mi("B"),mo("→"))`(x, y, z) in vacuum, up to order two in the relative coordinates X__i = [x, y, z] around some point of interest, the coefficients of orders 1 and 2 in this expansion, `v__i,j` and `c__i,j,k` , respectively the gradient and curvature, contain only 5 and 7 independent components.

  

b) All stationary points of LinearAlgebra[Norm](`#mover(mi("B"),mo("→"))`(x, y, z))^2 (nonzero minima and saddle points) are confined to a curved surface defined by det(`∂`[j](B[i])) = 0.

  

c) The effective potential, proportional to LinearAlgebra[Norm](`#mover(mi("B"),mo("→"))`(x, y, z)), has no maximum, only a minimum.

 

Finally, we draw the stationary condition surface for the case of the widely used Ioffe-Pritchard magnetic trap.

  

 

  

Reference

  

[1] R. Gerritsma and R. J. C. Spreeuw, Topological constraints on magnetostatic traps,  Phys. Rev. A 74, 043405 (2006)

  

 

The independent components of `v__i,j` and `c__i,j,k` entering B[i] = u[i]+v[i, j]*X[j]+(1/2)*c[i, j, k]*X[j]*X[k]

   

The stationary points are within the surface det(`∂`[j](B[i])) = 0

   

U = LinearAlgebra[Norm](`#mover(mi("B",fontweight = "bold"),mo("→",fontweight = "bold"))`)^2 has only minima, no maxima

   

Drawing the Ioffe-Pritchard Magnetic Trap

   


 

Download MagneticTraps.mw  or in pdf format with the sections open: MagneticTraps.pdf

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Much of this topic is developed using traditional techniques. Maple modernizes and optimizes solutions by displaying the necessary operators and simple commands to solve large problems. Using the conditions of equilibrium for both moment and force we find the forces and moments of reactions for any type of structure. In spanish.

Equlibrium.mw

https://www.youtube.com/watch?v=7zC8pGC4F2c

Lenin Araujo Castillo

Ambassador of Maple

Since 2002, the Texas A&M Math Department has sponsored a Summer Educational Enrichment in Math (SEE-Math) Program for gifted middle school students entering the 6th, 7th or 8th grade under the direction of Philip Yasskin and David Manuel.  Students spend two weeks exploring ideas from algebra, geometry, graph theory, topology, and other mathematical topics. 

The program’s primary goal is to help students find excitement in the discovery of mathematics and science concepts, and to provide them with the knowledge and confidence to continue their studies in math and science related fields. “I love working with the bright young kids who come to SEE-Math, they keep me young,” said Yasskin, one of the programs directors.


Maplesoft has been a sponsor of SEE-Math for many years and are happy to see the students explore math at this young age. Research into the importance of early math skills shows that children who are taught math early and learn the basics at a young age are set up for a lifetime of achievement in all aspects of their academic performance.  Every year, Maplesoft commits time, funds and people to various organizations to enhance the quality of math-based learning and discovery and to encourage students to strengthen their math skills.

One of the major activities of the SEE-Math program, and something the students really enjoy doing, is creating computer animations in Maple. The kids are divided into 3 groups; the Euler group is mostly made up of 6th graders with a few younger, the Fibonacci group is mostly 6th and 7th graders, and the Gauss group is 7th and 8th graders.

 Here are the 2017 first place winners from each group and their animations:

Euler Group - Nigel M "Buckets"

Fibonacci Group - Gabriel M "Skillz"

Gauss Group - Michael C - "Newton's Castle"

 

 

To learn more about this program visit: http://see-math.math.tamu.edu/2017/

Good book to start studying maple for engineering.

 


 

restart; with(plots)

Australopithecus := [[75, 25], [97, 30], [93, 40], [93, 45], [83, 50], [80, 55], [79, 60], [81, 73], [74, 76], [68, 81], [60, 82], [50, 83], [40, 80], [30, 71], [25, 60], [24, 50], [25, 37], [15, 33], [10, 30], [45, 10], [55, 16], [65, 10], [80, 8], [93, 14], [96, 24]]:

man := [[95, 39], [113, 40], [111, 47], [118, 53], [113, 62], [109, 72], [112, 88], [112, 95], [107, 112], [99, 117], [85, 122], [72, 122], [49, 117], [36, 104], [31, 78], [39, 52], [43, 43], [44, 34], [39, 16], [73, 3], [81, 17], [98, 14], [105, 17], [104, 26], [111, 33]]:

morph := proc (poly1, poly2, t) if nops(poly1) <> nops(poly2) then ERROR("mensaje.") end if; [seq([(1-t)*op(1, op(k, poly1))+t*op(1, op(k, poly2)), (1-t)*op(2, op(k, poly1))+t*op(2, op(k, poly2))], k = 1 .. nops(poly1))] end proc:

display([seq(polygonplot(morph(Australopithecus, man, (1/20)*k), scaling = constrained), k = 0 .. 19)], insequence = true, axes = none);

 

NULL


 

Download Australopithecus_updated.mw

http://www.gatewaycoalition.org/includes/display_project.aspx?ID=279&maincatid=105&subcatid=1019&thirdcatid=0

Lenin Araujo Castillo

Ambassador of Maple

In this application you can visualize the impulse generated by a constant and variable force for the interaction of a particle with an object in a state of rest or movement. It is also the calculation of the momentum-momentum equation by entering the mass of the particle to solve initial and final velocities respectively according to the case study. Engineering students can quickly display the calculations and then their interpretation. In spanish.

Plot_of_equation_impulse-momentum.mw

Lenin Araujo Castillo

Ambassador of Maple

While many of us in North America were getting re-acquainted with the Fall routine, Maplesoft was involved in a major event, the Maple T.A. and Möbius User Summit. In the past, the Summit has alternated locations between Europe and North America, but following the success of last year’s Summit in Vienna, Austria, we recently broke new ground and expanded the reach of the event to include more countries around the world in order to localize the themes and to meet the growing demand from educators to take learning online.

The first event, organized by Cybernet, took place in China. The second of five events on the calendar took place in London, England. Held from September 7-8, this installment was a major stop in the tour, drawing many residents of the UK to hear talks from some of our strongest proponents of Möbius in Europe. The London Summit drew several delegates from the UK alone, many of whom were completely new contacts for us! Other attendees came from as far away as Russia, Pakistan, Sri Lanka, and Australia, as well as some from Sweden, Denmark, Italy and the Netherlands. The turnout was brilliant!

Make progress or make excuses

The bulk of the London Summit was divided into three driving themes: Showcasing the Successful Delivery of Online Education; Best Practices for Digital Testing and Assessment; and Creating Engaging and Interactive Online STEM Content. Each theme consisted of 3 user presentations delivered by representatives from renowned institutions like University of Manchester, University of Birmingham, London Imperial College, University of Waterloo, Chalmers University of Technology, and more.

Maplesoft Application Engineer Surak Perera may have inadvertently set the tone for the day when he kicked off theme 1 with a quote from Tony Robbins: Make progress, or make excuses. One thing’s for sure – excuses were nowhere to be found at One Moorgate Place. The audience was captivated and engaged, and wasted no time bouncing questions and ideas off of our presenters. In fact, they were so eager to learn from our Maple T.A. and Möbius users that Jonny Zivku, Maple T.A. Product Manager, had to interject several times in order to keep the schedule moving! Each presentation reinforced the ability of Maple T.A. and Möbius to be used for diverse purposes such as distance education or analyzing incoming students, and in a range of subjects including multidisciplinary engineering cohorts, or simply core mathematics. Each presenter demonstrated that these tools can take you as far as the user’s mind is willing to be stretched.




 

Evening Reception

As heads were getting full and bellies were getting empty, the group left the luxuries of modern day and stepped back into what must have felt like a scene from Downton Abbey in the Main Reception Room of the venue. On the menu was the most culturally appropriate dish: fish and chips! Oh, and don’t forget the tea and wine!

There was no better way to wrap up the Summit than with Steve Furino’s interactive presentation and open discussion “Collecting Data about Collecting Data.” Small group discussion enabled the attendees to reconcile their inspiration from Day 1 with the practicality of putting it into practice once they return to their schools.

Overall, the London Summit was a smashing hit. The centralized location drew attendees who had a lot of common experiences which made for optimal discussion. The final question posted was the most revealing of everyone’s experience: where will the Summit be next year?

While that’s not yet decided, the Toronto Summit – the next stop in the Summit Series – is just a fortnight away (November 2-3). So for now, we’re saying “Cheers” to jolly good times in London, and “Can I get a double-double, eh” to Toronto!

Until then, you can experience the London Summit as if you were there with the full presentation proceedings and videos. They’re now available on our website!

 I accidentally stumbled on this problem in the list of tasks for mathematical olympiads. I quote its text in Russian-English translation:

"The floor in the drawing room of Baron Munchausen is paved with the identical square stone plates.
 Baron claims that his new carpet (made of one piece of a material ) covers exactly 24 plates and
 at the same time each vertical and each horizontal row of plates in the living room contains 
exactly 4 plates covered with carpet. Is not the Baron deceiving?"

At first glance this seems impossible, but in fact the Baron is right. Several examples can be obtained simply by hand, for example

                                        or        

 

The problem is to find all solutions. This post is dedicated to this problem.

We put in correspondence to each such carpet a matrix of zeros and ones, such that in each row and in each column there are exactly 2 zeros and 4 ones. The problem to generate all such the matrices was already discussed here and Carl found a very effective solution. I propose another solution (based on the method of branches and boundaries), it is less effective, but more universal. I've used this method several times, for example here and here.
There will be a lot of such matrices (total 67950), so we will impose natural limitations. We require that the carpet be a simply connected set that has as its boundary a simple polygon (non-self-intersecting).

Below we give a complete solution to the problem.


restart;
R:=combinat:-permute([0,0,1,1,1,1]);
# All lists of two zeros and four units

# In the procedure OneStep, the matrices are presented as lists of lists. The procedure adds one row to each matrix so that in each column there are no more than 2 zeros and not more than 4 ones

OneStep:=proc(L::listlist)
local m, k, l, r, a, L1;
m:=nops(L[1]); k:=0;
for l in L do
for r in R do
a:=[op(l),r];
if `and`(seq(add(a[..,j])<=4, j=1..6)) and `and`(seq(m-add(a[..,j])<=2, j=1..6)) then k:=k+1; L1[k]:=a fi;
od; od;
convert(L1, list);
end proc:

# M is a list of all matrices, each of which has exactly 2 zeros and 4 units in each row and column

L:=map(t->[t], R):
M:=(OneStep@@5)(L):
nops(M);

                                            67950

M1:=map(Matrix, M):

# From the list of M1 we delete those matrices that contain <1,0;0,1> and <0,1;1,0> submatrices. This means that the boundaries of the corresponding carpets will be simple non-self-intersecting curves

k:=0:
for m in M1 do
s:=1;
for i from 2 to 6 do
for j from 2 to 6 do
if (m[i,j]=0 and m[i-1,j-1]=0 and m[i,j-1]=1 and m[i-1,j]=1) or (m[i,j]=1 and m[i-1,j-1]=1 and m[i,j-1]=0 and m[i-1,j]=0) then s:=0; break fi;
od: if s=0 then break fi; od:
if s=1 then k:=k+1; M2[k]:=m fi;
od:
M2:=convert(M2, list):
nops(M2);

                                             394

# We find the list T of all segments from which the boundary consists

T:='T':
n:=0:
for m in M2 do
k:=0: S:='S':
for i from 1 to 6 do
for j from 1 to 6 do
if m[i,j]=1 then
if j=1 or (j>1 and m[i,j-1]=0) then k:=k+1; S[k]:={[j-1/2,7-i-1/2],[j-1/2,7-i+1/2]} fi;
if i=1 or (i>1 and m[i-1,j]=0) then k:=k+1; S[k]:={[j-1/2,7-i+1/2],[j+1/2,7-i+1/2]} fi;
if j=6 or (j<6 and m[i,j+1]=0) then k:=k+1; S[k]:={[j+1/2,7-i+1/2],[j+1/2,7-i-1/2]} fi;
if i=6 or (i<6 and m[i+1,j]=0) then k:=k+1; S[k]:={[j+1/2,7-i-1/2],[j-1/2,7-i-1/2]} fi; 
fi;
od: od:
n:=n+1; T[n]:=[m,convert(S,set)];
od:
T:=convert(T, list):

# Choose carpets with a connected border

C:='C': k:=0:
for t in T do
a:=t[2]; v:=op~(a);
G:=GraphTheory:-Graph([$1..nops(v)], subs([seq(v[i]=i,i=1..nops(v))],a));
if GraphTheory:-IsConnected(G) then k:=k+1; C[k]:=t fi;
od:
C:=convert(C,list):
nops(C);
                                             
 208

# Sort the list of border segments so that they go one by one and form a polygon

k:=0: P:='P':
for c in C do
a:=c[2]: v:=op~(a);
G1:=GraphTheory:-Graph([$1..nops(v)], subs([seq(v[i]=i,i=1..nops(v))],a));
GraphTheory:-IsEulerian(G1,'U');
U; s:=[op(U)];
k:=k+1; P[k]:=[seq(v[i],i=s[1..-2])];
od:
P:=convert(P, list):

# We apply AreIsometric procedure from here to remove solutions that coincide under a rotation or reflection

P1:=[ListTools:-Categorize( AreIsometric, P)]:
nops(P1);

                                                 28


We get 28 unique solutions to this problem.

Visualization of all these solutions:

interface(rtablesize=100):
E1:=seq(plottools:-line([1/2,i],[13/2,i], color=red),i=1/2..13/2,1):
E2:=seq(plottools:-line([i,1/2],[i,13/2], color=red),i=1/2..13/2,1):
F:=plottools:-polygon([[1/2,1/2],[1/2,13/2],[13/2,13/2],[13/2,1/2]], color=yellow):
plots:-display(Matrix(4,7,[seq(plots:-display(plottools:-polygon(p,color=red),F, E1,E2), p=[seq(i[1],i=P1)])]), scaling=constrained, axes=none, size=[800,700]);

 

 

Carpet1.mw

The code was edited.

 

 

Using the syntax in Maple we develop the energy with conservation equations here we are applying the commands int, factor, solve among others. We also integrate vector functions through the scalar product and finally we calculate conservative fields applying the rotational to a field of force. Exclusive for engineering students. In spanish.

Work_of_a_Force.mw

Lenin Araujo castillo

Ambassafor of Maple

And the Nobel prize in physics 2017 went for work in General Relativity ! Actually, experimental work involving sophisticated detectors and Numerical Relativity, one of the branches of GR. The prize was awarded to Rainer Weiss (85 years old, 1/2 of the prize), Barry Barish (81 years old, 1/4 of the prize) and Kip Thorne (77 years old, 1/4 of the prize) who have "shaken the world again" with their work on Ligo experiment, which was able to detect ripples in the fabric of spacetime.

General Relativity continues to be at the center of work in theoretical and experimental physics. I take this opportunity to note that, in Maple 2017, among the several improvements in the Physics package regarding General Relativity, there is a new package, Physics:-ThreePlusOne, all dedicated to the symbolic manipulations necessary to formulate problems in Numerical Relativity.

The GR functionality implemented in Physics, Physics:-Tetrads and Physics:-ThreePlusOne is unique in computer algebra systems and reflects the Maplesoft intention, for several years now, to provide the very best possible computer algebra environment for Physics, regarding current research activity as well as related education in advanced mathematical-physics methods.

For what is going on in theoretical physics nowadays and its connection with General Relativity, in very short: the unification of gravity with the other forces, check for instance this map from Aug/2015 (by the way a very nice summary for whoever is interested):

It is also interesting the article behind this map of topics as well as this brilliant and accessible presentation by Nima Arkani-Hamed (Princeton):  Quantum Mechanics and Spacetime in the 21st Century, given in the Perimeter Institute for Theoretical Physics (Waterloo), November 2014. 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Group of exercises solved using Maple scientific software, with the necessary considerations of some basic commands: evalf and convert that will show the solutions with the user-defined digits and the angular measurement in sexagesimal degrees. Important use of the law of the triangle through of vector position applied to vectors in vector spaces, vector force and vector moment for engineering students. In spanish.

Exercises_of_vectors_forces_and_moment_with_Maple.mw

Videotutorial:

https://www.youtube.com/watch?v=DxpO0gc5GCA

Lenin Araujo Castillo

Ambassador of Maple

# Riemann hypothesis is false! (simple proof)
 

restart;
assume( s>0, s<1/2, t>0 );
coulditbe(abs(Zeta(s+I*t))=0);

                              true

# Q.E.D.

Unfortunately coulditbe(Zeta(s+I*t)=0) returns FAIL, but our assertion is already demonstrated!

The moral: the assume facility deserves a much more careful implementation.

The development of the calculation of moments using force vectors is clearly observed by taking a point and also a line. Different exercises are solved with the help of Maple syntax. We can also visualize the vector behavior in the different configurations of the position vector. Applications designed exclusively for engineering students. In Spanish.

Moment_of_a_force_using_vectors_updated.mw

Lenin Araujo Castillo

Ambassador of Maple

1 2 3 4 5 6 7 Last Page 1 of 38