448 Reputation

12 Badges

5 years, 304 days

MaplePrimes Activity

These are replies submitted by Pascal4QM

I think Standard Model (SM) is a beautiful development. It is nice to see that Maple is at the state of the art in Physics. This will be useful to many. For those not directly requiring SM, I am sure it has been the opportunity for many improvements in the surrounding.

@eager0626 Could you please post a worksheet. Also I am using Maple 2021.2 with the lastest Physics up-date:


Using diff in the Physics framework might help. Once physics is loaded, z and conjugate(z) are considered as indepent variable allowing many derivative computation. The reason is that this is needed for functional derivative to recover equations from a given Lagrangian.

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/ .


This workaround is of potential interest to some people. It is then welcomed. Thanks to Edgardo for the huge effort in developing the Physics package at the cutting edge of CAS technology.

@Carl Love Thanks, that’s good to be aware of these potential issues.

@mmcdara I tried it in code edit region. There is a warning suggesting to declare `` as a local variable. If done so, the warning disapear, so yes, it is seems it is considered as a variable.

@mmcdara Interesting, thanks. Indeed, when working with a large number of input and output, with this solution, there is less writing and need to count. The interpretation is simpler as well (especially when used with Matlab).

@Rouben Rostamian  All good, thanks!

@tomleslie However, it seems to not be general

test:= proc():
   return a,b,c:
end proc:

                          B, C := b, c

                             B := b

A,C := test()[1,3];
Error, invalid subscript selector


@tomleslie Hi, thanks, good solution!


That's a very nice post, which will be useful to many people, congratulations!

You could try to slightly modify the initialization as follows (of course, that’s just a matter of preferences).

interface(imaginaryunit = i):
CompactDisplay((E__field_, B__flux_, H__field_, D__flux_)(x, y, z, t));

In addition, Setup(mathematicalnotation = true) is not required anymore, as it is the default for recent releases.

To get (4.4.11) from (4.4.10), entering "(4.4.10) . (4.4.10)" with a dot as the scalar product gives an equivalent result.


@Carl Love Impressive, thanks!

@acer Thanks! That's exactly what I need.

@digerdiga Coordinates(X, P) automatically defines X and P as tensor, so that Define is not necessary anymore. But you could still used it instead, if you prefer.

@digerdiga Except for the macro not used, it seems OK as well:

restart; with(Physics); Setup(dimension = 3, metric = Euclidean, spacetimeindices = lowercaselatin, quiet)

[dimension = 3, metric = {(1, 1) = 1, (2, 2) = 1, (3, 3) = 1}, spacetimeindices = lowercaselatin]


Coordinates(X, P)

`Systems of spacetime coordinates are:`*{P = (p1, p2, p3), X = (x1, x2, x3)}


{P, X}



Setup(quantumop = {P, X}, algebrarule = {%Commutator(X[j], P[k]) = I*g_[j, k]}, %Commutator(X[j], X[k]) = 0, %Commutator(P[j], P[k]) = 0)

`* Partial match of  '`*quantumop*`' against keyword '`*quantumoperators*`' `


`* Partial match of  '`*algebrarule*`' against keyword '`*algebrarules*`' `




[algebrarules = {%Commutator(Physics:-SpaceTimeVector[j](X), Physics:-SpaceTimeVector[k](P)) = I*Physics:-g_[j, k]}, quantumoperators = {p1, p2, p3, x1, x2, x3}]


L2 := P[j]^2*X[k]^2-P[j]*P[k]*X[j]*X[k]

Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[k](X), 2), Physics:-`^`(Physics:-SpaceTimeVector[j](P), 2))-Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[j](X), Physics:-SpaceTimeVector[k](P), Physics:-SpaceTimeVector[j](P))


Commutator(L2, X[j])

-(2*I)*Physics:-g_[a, j]*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[k](X), 2), Physics:-SpaceTimeVector[a](P))-Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[a](X), -I*Physics:-g_[a, j]*Physics:-SpaceTimeVector[k](P)-I*Physics:-g_[j, k]*Physics:-SpaceTimeVector[a](P))



-(2*I)*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[k](X), 2), Physics:-SpaceTimeVector[j](P))+I*Physics:-`*`(Physics:-SpaceTimeVector[j](X), Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[k](P))+I*Physics:-`*`(Physics:-SpaceTimeVector[a](X), Physics:-SpaceTimeVector[j](X), Physics:-SpaceTimeVector[a](P))


Check(%, all)

`The products in the given expression check ok.`


`The repeated indices per term are: `[{`...`}, {`...`}, `...`]*`, the free indices are: `*{`...`}


[{k}, {k}, {a}], {j}





1 2 3 4 Page 1 of 4