Pascal4QM

453 Reputation

12 Badges

5 years, 343 days

MaplePrimes Activity


These are answers submitted by Pascal4QM

Hi,

The LinearAlgebra algebra package has a trace function.

Either enter:

LinearAlgebra:-Trace(J)

or, load the package :

with(LinearAlgebra):

Trace(J)

Note, there is also a Trace function within the Physics package. In addition to standard Matrix, it can work on special matrices such as the Pauli or the Dirac matrices.

 

Hi,

Functional derivative, that is derivative of a function with respect to another one, is supported within the Physics package. For instance:

restart;
with(Physics):
ee := diff(f(t), t)^2;
                                       2
                             / d      \
                       ee := |--- f(t)|
                             \ dt     /

diff(ee, diff(f(t), t));
                            / d      \
                          2 |--- f(t)|
                            \ dt     /

 

In your code, just add "with(Physics):" after restart, and there will be no error message anymore.

You could also have a look at the Fundiff function. Enter ?Physics:-Fundiff

Hi,

Entering whattype(a) will return "set".

Hi, maybe CodeTools:-ProgramAnalysis:-StaticCallGraph might be helpful. This is new to Maple 2020.

Hi,

The best is probably to represent your matrices symbolically by quantum operators within the Physics package:

with(Physics):

Setup(quantumoperators={A,B,C})

All algebra performed with quantum operators will be non-Abelian. It is possible to do many operations with :Simplify, Expand, Factor, SortProducts...

Hi,

The following return what you expect.

(combine(F^(1/2)*x^(1/2)/m^(1/2)) assuming positive)

Hi,

The Physics Setup properties "differentialoperators" might help you. With that, you can formally define your own differential operator, and trigg it at will. For an example see:

https://www.mapleprimes.com/posts/208710-Quantum-Commutation-Rules-Basics

Note also that Dirac gamma matrices are known by the Physics package, enter help("Physics:-Dgamma")

Hi,

I have the same issue sometime (Windows 10, 64 bits). Open Maple from the starting menu instead of clicking on a file might help. Once Maple is open, you should also close the "Palette", this could help for the next start-up.

The power works as well (almost)

For instance:

e1^2

e1^(1/2)

Will work fine, while

sqrt(e1)

e1^a

Doesn't. Indeed, that's convenient, much more cases could work that way.

Hi,

You shoud modify the setup as follow:

Setup(dimension = 3, metric = Euclidean, spacetimeindices = lowercaselatin, quiet)

Furtheremore, SumOverRepeatedIndices is for tensor, therefore, X and P should be define as such:

Define(X[j], P[k])

Finally, starting M2019, KroneckerDelta is not a tensor anymore. So the commutator should rather be:

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

And it should work as designed.

 

Hi,

I am not used with the DifferentialGeometry package, but, in a general manner, I advise you to switch to the Physics package. It is more general, easier to use, and above all, it is very dynamic and continuously up-dated. Enter ?Physics. Notably, the sections "Mini-Course: Computer Algebra for Physicists" and "A Complete Guide for performing Tensors computations using Physics" are very instructive.

BTW, to avoid people starting with it, ?DifferentialGeometry should probably refer to Physics. Indeed, the DifferentialGeometry package is now mostly superceeded.

Hi,

It is likely that the displayed result with M2018 is incorrect. "Expand" with M2019 gives the correct result. "Simplify" is ambiguous, see the attached mw.
 

restart

with(Physics)

Setup(noncommutativeprefix = {V, W})

[noncommutativeprefix = {V, W}]

(1)

ee := (-1/W-W/V^2)/W

Physics:-`*`(1/W, -1/W-Physics:-`*`(W, 1/Physics:-`^`(V, 2)))

(2)

Expand gives a correct result

Expand(ee)

-1/Physics:-`^`(W, 2)-1/Physics:-`^`(V, 2)

(3)

The result given by simplify might be correct or not

Simplify(ee)

-(Physics:-`^`(V, 2)+Physics:-`^`(W, 2))/(Physics:-`^`(W, 2)*Physics:-`^`(V, 2))

(4)

The point is that the numerator and the denominator might not commute. In the general case, they do not:

numer(-(Physics[`^`](V, 2)+Physics[`^`](W, 2))/(Physics[`^`](W, 2)*Physics[`^`](V, 2))), denom(-(Physics[`^`](V, 2)+Physics[`^`](W, 2))/(Physics[`^`](W, 2)*Physics[`^`](V, 2)))

-Physics:-`^`(V, 2)-Physics:-`^`(W, 2), Physics:-`^`(W, 2)*Physics:-`^`(V, 2)

(5)

Library:-Commute(-Physics[`^`](V, 2)-Physics[`^`](W, 2), Physics[`^`](W, 2)*Physics[`^`](V, 2))

false

(6)

Therefore, there is an ambiguity in the way (4) is read. Is it?

numer(-(Physics[`^`](V, 2)+Physics[`^`](W, 2))/(Physics[`^`](W, 2)*Physics[`^`](V, 2)))/denom(-(Physics[`^`](V, 2)+Physics[`^`](W, 2))/(Physics[`^`](W, 2)*Physics[`^`](V, 2)))

Physics:-`*`(-Physics:-`^`(V, 2)-Physics:-`^`(W, 2), Physics:-`^`(Physics:-`^`(W, 2)*Physics:-`^`(V, 2), -1))

(7)

Or?

numer(-(Physics[`^`](V, 2)+Physics[`^`](W, 2))/(Physics[`^`](W, 2)*Physics[`^`](V, 2)))/denom(-(Physics[`^`](V, 2)+Physics[`^`](W, 2))/(Physics[`^`](W, 2)*Physics[`^`](V, 2)))

Physics:-`*`(Physics:-`^`(Physics:-`^`(W, 2)*Physics:-`^`(V, 2), -1), -Physics:-`^`(V, 2)-Physics:-`^`(W, 2))

(8)

``


 

Download ExpandPhysicsPackage.mw

Hi,

A possible answer you gave:

https://www.mapleprimes.com/questions/222865-How-To-Index-A-Procedure-Fijkxyz

 

Hi,

As a side remark, if you are newly starting with Maple you should have a look at the Physics Package. This is the best option. Enter for instance:

help("Physics:-KillingVectors")

You could also have a look at these two very recent posts:

https://www.mapleprimes.com/posts/210090-A-Complete-Guide-For--Tensor-Computations

https://www.mapleprimes.com/posts/210059-Overview-Of-The-Physics-Updates

 

 

Hi,

The behavior is indeed changing when Physics is loaded, though I cannot say if it should be considered as a bug when Physics is not loaded or loaded (if it is a bug). The syntax you are using is indeed ambiguous. As you need to perform element-wise operations, I suggest using the dedicated operator for that, i.e. "~". It is working both with and without Physics.

restart

A := Array(triangular[upper], 1 .. 3, 1 .. 4, fill = 2)

Array(%id = 18446745879969850542)

(1)

A^n

Array(%id = 18446745879969846206)

(2)

A.A

Array(%id = 18446745879969842830)

(3)

`~`[`.`](A, A)

Array(%id = 18446745879969837174)

(4)

with(Physics)

`~`[`.`](A, A)

Array(%id = 18446745879969855478)

(5)

`~`[`^`](A, n)

Array(%id = 18446745879969851982)

(6)

``


 

Download PhysicsAndArray.mw

 

1 2 3 4 Page 2 of 4