Pascal4QM

458 Reputation

12 Badges

6 years, 19 days

MaplePrimes Activity


These are replies submitted by Pascal4QM

@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]

(1)

Coordinates(X, P)

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

 

{P, X}

(2)

NULL

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}]

(3)

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))

(4)

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))

(5)

Simplify(%)

-(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))

(6)

Check(%, all)

`The products in the given expression check ok.`

 

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

 

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

(7)

``


 

Download PhysicsCommutator_II.mw

@digerdiga It seems to work OK, see the attached. I have define X and P as coordinates, so that Define is not necessary.
 

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]

(1)

Coordinates(X, P)

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

 

{P, X}

(2)

NULL

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}]

(3)

Commutator(Physics:-`*`(Physics:-`^`(X[m], 2), Physics:-`^`(P[n], 2))-Physics:-`*`(Physics:-`*`(Physics:-`*`(X[m], X[n]), P[m]), P[n]), Physics:-`*`(Physics:-`*`(X[k], X[l]), P[l])-Physics:-`*`(Physics:-`^`(X[l], 2), P[k]))

Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[m](X), 2), -(2*I)*Physics:-g_[l, n]*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[n](P), Physics:-SpaceTimeVector[l](P))-(2*I)*Physics:-g_[k, n]*Physics:-`*`(Physics:-SpaceTimeVector[n](P), Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[l](P)))+(2*I)*Physics:-g_[l, m]*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[m](X), Physics:-`^`(Physics:-SpaceTimeVector[n](P), 2))+(2*I)*Physics:-g_[l, n]*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[m](X), 2), I*Physics:-g_[l, n]+2*Physics:-`*`(Physics:-SpaceTimeVector[n](P), Physics:-SpaceTimeVector[l](X)), Physics:-SpaceTimeVector[k](P))-(2*I)*Physics:-g_[k, m]*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[l](X), 2), Physics:-SpaceTimeVector[m](X), Physics:-`^`(Physics:-SpaceTimeVector[n](P), 2))-Physics:-`*`(Physics:-SpaceTimeVector[m](X), Physics:-`*`(Physics:-SpaceTimeVector[n](X), Physics:-`*`(Physics:-SpaceTimeVector[m](P), -I*Physics:-g_[l, n]*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[l](P))-I*Physics:-g_[k, n]*Physics:-`*`(Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[l](P)))+Physics:-`*`(-I*Physics:-g_[l, m]*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[l](P))-I*Physics:-g_[k, m]*Physics:-`*`(Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[l](P)), Physics:-SpaceTimeVector[n](P)))+I*Physics:-g_[l, n]*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[m](P), Physics:-SpaceTimeVector[n](P)))-I*Physics:-g_[l, m]*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[n](X), Physics:-SpaceTimeVector[m](P), Physics:-SpaceTimeVector[n](P))+Physics:-`*`(Physics:-SpaceTimeVector[m](X), Physics:-`*`(Physics:-SpaceTimeVector[n](X), -(2*I)*Physics:-g_[l, n]*Physics:-`*`(Physics:-SpaceTimeVector[m](P), Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[k](P))-(2*I)*Physics:-g_[l, m]*Physics:-`*`(Physics:-SpaceTimeVector[l](X), Physics:-SpaceTimeVector[k](P), Physics:-SpaceTimeVector[n](P)))+I*Physics:-g_[k, n]*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[l](X), 2), Physics:-SpaceTimeVector[m](P), Physics:-SpaceTimeVector[n](P)))+I*Physics:-g_[k, m]*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[l](X), 2), Physics:-SpaceTimeVector[n](X), Physics:-SpaceTimeVector[m](P), Physics:-SpaceTimeVector[n](P))

(4)

Simplify(%)

-Physics:-`*`(Physics:-SpaceTimeVector[c](X), Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[c](P))+I*Physics:-`*`(Physics:-SpaceTimeVector[b](X), Physics:-SpaceTimeVector[b](P), Physics:-SpaceTimeVector[f](X), Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[f](P))-I*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[b](X), 2), Physics:-SpaceTimeVector[f](X), Physics:-SpaceTimeVector[f](P), Physics:-SpaceTimeVector[k](P))-7*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[b](X), 2), Physics:-SpaceTimeVector[k](P))-(2*I)*Physics:-`*`(Physics:-SpaceTimeVector[b](X), Physics:-SpaceTimeVector[b](P), Physics:-`^`(Physics:-SpaceTimeVector[d](X), 2), Physics:-SpaceTimeVector[k](P))+(5*I)*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[b](X), 2), Physics:-SpaceTimeVector[d](P), Physics:-SpaceTimeVector[d](X), Physics:-SpaceTimeVector[k](P))-(2*I)*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[b](X), 2), Physics:-SpaceTimeVector[k](P), Physics:-SpaceTimeVector[j](X), Physics:-SpaceTimeVector[j](P))-I*Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[m](X), Physics:-SpaceTimeVector[s](X), Physics:-SpaceTimeVector[m](P), Physics:-SpaceTimeVector[s](P))-(2*I)*Physics:-`*`(Physics:-`^`(Physics:-SpaceTimeVector[b](X), 2), Physics:-SpaceTimeVector[k](X), Physics:-`^`(Physics:-SpaceTimeVector[j](P), 2))+I*Physics:-`*`(Physics:-SpaceTimeVector[f](X), Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[s2](X), Physics:-SpaceTimeVector[f](P), Physics:-SpaceTimeVector[s2](P))+I*Physics:-`*`(Physics:-SpaceTimeVector[c](X), Physics:-SpaceTimeVector[m](X), Physics:-SpaceTimeVector[c](P), Physics:-SpaceTimeVector[k](X), Physics:-SpaceTimeVector[m](P))

(5)

SumOverRepeatedIndices(%)

-Physics:-`*`(x1, Physics:-SpaceTimeVector[k](X), p1)-Physics:-`*`(x2, Physics:-SpaceTimeVector[k](X), p2)-Physics:-`*`(x3, Physics:-SpaceTimeVector[k](X), p3)+I*(Physics:-`*`(x1, p1, x1, Physics:-SpaceTimeVector[k](X), p1)+Physics:-`*`(x2, p2, x1, Physics:-SpaceTimeVector[k](X), p1)+Physics:-`*`(x3, p3, x1, Physics:-SpaceTimeVector[k](X), p1)+Physics:-`*`(x1, p1, x2, Physics:-SpaceTimeVector[k](X), p2)+Physics:-`*`(x2, p2, x2, Physics:-SpaceTimeVector[k](X), p2)+Physics:-`*`(x3, p3, x2, Physics:-SpaceTimeVector[k](X), p2)+Physics:-`*`(x1, p1, x3, Physics:-SpaceTimeVector[k](X), p3)+Physics:-`*`(x2, p2, x3, Physics:-SpaceTimeVector[k](X), p3)+Physics:-`*`(x3, p3, x3, Physics:-SpaceTimeVector[k](X), p3))-I*(Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), x1, p1, Physics:-SpaceTimeVector[k](P))+Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), x2, p2, Physics:-SpaceTimeVector[k](P))+Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), x3, p3, Physics:-SpaceTimeVector[k](P)))-7*Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P))-(2*I)*(Physics:-`*`(x1, p1, Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P))+Physics:-`*`(x2, p2, Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P))+Physics:-`*`(x3, p3, Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P)))+(5*I)*(Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), p1, x1, Physics:-SpaceTimeVector[k](P))+Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), p2, x2, Physics:-SpaceTimeVector[k](P))+Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), p3, x3, Physics:-SpaceTimeVector[k](P)))-(2*I)*(Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P), x1, p1)+Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P), x2, p2)+Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](P), x3, p3))-I*(Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-`^`(x1, 2), Physics:-`^`(p1, 2))+Physics:-`*`(Physics:-SpaceTimeVector[k](X), x2, x1, p2, p1)+Physics:-`*`(Physics:-SpaceTimeVector[k](X), x3, x1, p3, p1)+Physics:-`*`(Physics:-SpaceTimeVector[k](X), x1, x2, p1, p2)+Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-`^`(x2, 2), Physics:-`^`(p2, 2))+Physics:-`*`(Physics:-SpaceTimeVector[k](X), x3, x2, p3, p2)+Physics:-`*`(Physics:-SpaceTimeVector[k](X), x1, x3, p1, p3)+Physics:-`*`(Physics:-SpaceTimeVector[k](X), x2, x3, p2, p3)+Physics:-`*`(Physics:-SpaceTimeVector[k](X), Physics:-`^`(x3, 2), Physics:-`^`(p3, 2)))-(2*I)*Physics:-`*`(Physics:-`^`(x1, 2)+Physics:-`^`(x2, 2)+Physics:-`^`(x3, 2), Physics:-SpaceTimeVector[k](X), Physics:-`^`(p1, 2)+Physics:-`^`(p2, 2)+Physics:-`^`(p3, 2))+I*(Physics:-`*`(x1, Physics:-SpaceTimeVector[k](X), x1, Physics:-`^`(p1, 2))+Physics:-`*`(x2, Physics:-SpaceTimeVector[k](X), x1, p2, p1)+Physics:-`*`(x3, Physics:-SpaceTimeVector[k](X), x1, p3, p1)+Physics:-`*`(x1, Physics:-SpaceTimeVector[k](X), x2, p1, p2)+Physics:-`*`(x2, Physics:-SpaceTimeVector[k](X), x2, Physics:-`^`(p2, 2))+Physics:-`*`(x3, Physics:-SpaceTimeVector[k](X), x2, p3, p2)+Physics:-`*`(x1, Physics:-SpaceTimeVector[k](X), x3, p1, p3)+Physics:-`*`(x2, Physics:-SpaceTimeVector[k](X), x3, p2, p3)+Physics:-`*`(x3, Physics:-SpaceTimeVector[k](X), x3, Physics:-`^`(p3, 2)))+I*(Physics:-`*`(Physics:-`^`(x1, 2), p1, Physics:-SpaceTimeVector[k](X), p1)+Physics:-`*`(x2, x1, p2, Physics:-SpaceTimeVector[k](X), p1)+Physics:-`*`(x3, x1, p3, Physics:-SpaceTimeVector[k](X), p1)+Physics:-`*`(x1, x2, p1, Physics:-SpaceTimeVector[k](X), p2)+Physics:-`*`(Physics:-`^`(x2, 2), p2, Physics:-SpaceTimeVector[k](X), p2)+Physics:-`*`(x3, x2, p3, Physics:-SpaceTimeVector[k](X), p2)+Physics:-`*`(x1, x3, p1, Physics:-SpaceTimeVector[k](X), p3)+Physics:-`*`(x2, x3, p2, Physics:-SpaceTimeVector[k](X), p3)+Physics:-`*`(Physics:-`^`(x3, 2), p3, Physics:-SpaceTimeVector[k](X), p3))

(6)

NULL


 

Download PhysicsCommutator.mw

@Samir Khan It is nice to see how Maple evolves with new features and improved reliability. Whether you are a student, a teacher, an engineer, or a researcher, many Maple’s feature are just unique. About the debugger, I consider that keeping some effort on this point is strategic. Maple’s debugger do not require an incremental improvement, it needs to be reinvented. As suggested by nm, Matlab’s debugger is a very good model of inspiration for that.


Thanks for this new release!

@Carl Love Thanks, that's interesting, a good solution.

@tomleslie Thanks, this way is easy to automate, it seems that's exacty what I need!

@Kitonum  Yes, thanks, but my idea was rather how to get an automated representation of the 2D integrating surface. Of course, it is always possible to reconstruct it from the integration range given by VectorCalculus:-int. But I would like to know if it is possible to draw it prior to this calculation, in order to check it.

@Kitonum Thank you very much! I can adapt these procedure to exactly what I need. Also, I was not aware of the "foldl" operator, very interesting.

@Kitonum Thanks, works fine, but difficult to generilize to an arbitrary number of nested sums.

Hi,

Regarding the statement :

"It would be great to write an equation that isn't meant to be executed by the kernel.  In other words the equation should only be for display. "

This feature exists, it is the inert form. For instance, enter:

%int(sin(x), x = a .. b)

You will see that it appears not executed. The "%" in front of "int" makes it inert. To my knowledge, there is no limitation, almost anything in Maple can be made inert. To proceed, use the instruction "value".

One can also use quote. Try:

'int(sin(x), x = a .. b)'

It will be displayed unexecuted for once. The next time it is called, it is computed.

 

 

@John Fredsted Yes, M2018.2.1 with the latest physics up-date, v239.

Hi,

You have written D[mu] phi =D[mu] phi + something which is not consitent.

Also, do you intend to use any particular metric?

 

A major debugger improvement. For a comparison, the picture below gives an overview of Matlab’s debugger. It is very easy and convenient to use, leading to fast and accurate development. Its major features are:

- One can add (or remove) a break point by a single click on the left, this is the red circle. There is no instruction to write and to remove aftewards.

- Unlike Maple's debugger which only shows a single line at a time (I guess everyone can remember all the lines of his code), one still keep an overview of all the code surrounding the line of interest.

- To inspect the content of a variable, just bring the pointer on it, and a “tooltip” displays its content.

I think something similar could be implemented in Maple's code edit region.

Also related :

https://www.mapleprimes.com/posts/209233-Why-No-Improvements-Made-To-Maple-Debugger#comment203061

 

@Joe Riel Thanks for this information. I think, there is an important need for a better debugger, so, yes a short demonstration video would be very useful. Besides, what about implementing this debugger in the official release? It would be well suited within “code edit region”, and available to every body. BTW, “code edit region” is a very good tool and has been improved for M2018.

Hi,

I Agree with that! Maple is a software I love, but its debugger is awful. In comparison, it is so easy to develop code for Matlab. I even consider that this poor debugger is a limitation to Maple's development itself, for both users and developers. It seems however that something better exists. I have Windows, but if you have a MAC, you could try:

http://www.mapleprimes.com/posts/130672-Improved-Debugger-For-Maple

 

@Earl Edgardo's posts are very good examples. For instance:

https://www.mapleprimes.com/posts/208437-ACA-2017--Computer-Algebra-In-Theoretical

An example of line elemnt is given in ?Physics,Setup

1 2 3 4 Page 2 of 4