ecterrab

12714 Reputation

24 Badges

17 years, 263 days

MaplePrimes Activity


These are answers submitted by ecterrab

You can choose among the three representations used in the literature (standard, chiral or Majorana), but no, you cannot redefine the Dirac matrices (would stop being the Dirac matrices). Their definition is standard in the literature and shown on the help page for Dgamma. The definition is similar to what you show but the two Pauli matrices have opposite signs (not as you indicate).

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

`tools/CartesianProduct`, originally written as `PDEtools/CartesianProduct` is an internal routine used in PDEtools (symmetry methods) that implements Cartesian products recursively, with a few options. Today I'd write it a bit more compactly but, as is, implements the concept pretty well. You can see the program entering showstat(`tools/CartesianProduct`)

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

At the end, you have a link to download the worksheet whose contents follow.

Download: For_mapleprimes_(reviewed).mw

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


There was indeed a weakness in the code: when computing the dot product within a sum, in one place the range of the dummy summation index was not taken into account, resulting in less simplification. The problem is fixed and the fix distributed for everybody using Maple 2022 within the Maplesoft Physics Updates v.1186 and higher. To install it, input Physics:-Version(latest) and follow instructions.

 

This is what we get now

with(Physics)

H := sum(Ket(e, n).Bra(e, n+1)+Ket(e, n+1).Bra(e, n), n = 1 .. d)

sum(Physics:-`*`(Physics:-Ket(e, n), Physics:-Bra(e, n+1))+Physics:-`*`(Physics:-Ket(e, n+1), Physics:-Bra(e, n)), n = 1 .. d)

(1)

H.H

sum(sum(Physics:-KroneckerDelta[n, n__1+1]*Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n+1))+Physics:-KroneckerDelta[n__1, n+1]*Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n)), n = 1 .. d)+Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n__1+1))+Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n__1)), n__1 = 1 .. d)

(2)

Note that the inner sum does not span all terms: the last two, with no KroneckerDelta are out of it. Expand this sum to understand this result better

expand(sum(sum(Physics[KroneckerDelta][n, n__1+1]*Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n+1))+Physics[KroneckerDelta][n__1, n+1]*Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n)), n = 1 .. d)+Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n__1+1))+Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n__1)), n__1 = 1 .. d))

sum(sum(Physics:-KroneckerDelta[n, n__1+1]*Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n+1)), n = 1 .. d), n__1 = 1 .. d)+sum(Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n__1)), n__1 = 1 .. d)+sum(sum(Physics:-KroneckerDelta[n__1, n+1]*Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n)), n = 1 .. d), n__1 = 1 .. d)+sum(Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n__1+1)), n__1 = 1 .. d)

(3)

Take the first sum

op(1, sum(sum(Physics[KroneckerDelta][n, n__1+1]*Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n+1)), n = 1 .. d), n__1 = 1 .. d)+sum(Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n__1)), n__1 = 1 .. d)+sum(sum(Physics[KroneckerDelta][n__1, n+1]*Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n)), n = 1 .. d), n__1 = 1 .. d)+sum(Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n__1+1)), n__1 = 1 .. d))

sum(sum(Physics:-KroneckerDelta[n, n__1+1]*Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n+1)), n = 1 .. d), n__1 = 1 .. d)

(4)

Simplify(sum(sum(Physics[KroneckerDelta][n, n__1+1]*Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n+1)), n = 1 .. d), n__1 = 1 .. d))

sum(sum(Physics:-KroneckerDelta[n, n__1+1]*Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n+1)), n = 1 .. d), n__1 = 1 .. d)

(5)

Why is this KroneckerDelta not simplified? Because for n__1 = d, we have that delta[n, n__1+1] = 0, since n <= d cannot be equal to `#msub(mi("n"),mi("1"))`+1 = d+1. So, we cannot remove the sum over n making delta[n, n__1+1]*Bra(e, n+1) = Bra(e, n+2)

 We can still do the simplification of delta[n, n__1+1] and one sum if the upper summation limit of the other sum is d-1, that is: split the external sum "(&sum;)=(&sum;)+ term with `n__1`=d", where the later is equal to zero because delta[n, d+1] = 0, so just replacing "(&sum;)=(&sum;)" is correct. Doing that here, manually, we get

Physics:-KroneckerDelta[n, n__1+1]

(6)

subsop([2, 2, 2] = d-1, sum(sum(Physics[KroneckerDelta][n, n__1+1]*Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n+1)), n = 1 .. d), n__1 = 1 .. d))

sum(sum(Physics:-KroneckerDelta[n, n__1+1]*Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n+1)), n = 1 .. d), n__1 = 1 .. d-1)

(7)

Simplify(sum(sum(Physics[KroneckerDelta][n, n__1+1]*Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n+1)), n = 1 .. d), n__1 = 1 .. d-1))

sum(Physics:-`*`(Physics:-Ket(e, n__1), Physics:-Bra(e, n__1+2)), n__1 = 1 .. d-1)

(8)

The same applies to the other double sum in (3),

op(3, sum(sum(Physics[KroneckerDelta][n, n__1+1]*Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n+1)), n = 1 .. d), n__1 = 1 .. d)+sum(Physics[`*`](Physics[Ket](e, n__1), Physics[Bra](e, n__1)), n__1 = 1 .. d)+sum(sum(Physics[KroneckerDelta][n__1, n+1]*Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n)), n = 1 .. d), n__1 = 1 .. d)+sum(Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n__1+1)), n__1 = 1 .. d))

sum(sum(Physics:-KroneckerDelta[n__1, n+1]*Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n)), n = 1 .. d), n__1 = 1 .. d)

(9)

Simplify(%)

sum(sum(Physics:-KroneckerDelta[n__1, n+1]*Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n)), n = 1 .. d), n__1 = 1 .. d)

(10)

subsop([1, 2, 2, 2] = d-1, sum(sum(Physics[KroneckerDelta][n__1, n+1]*Physics[`*`](Physics[Ket](e, n__1+1), Physics[Bra](e, n)), n = 1 .. d), n__1 = 1 .. d))

sum(sum(Physics:-KroneckerDelta[n__1, n+1]*Physics:-`*`(Physics:-Ket(e, n__1+1), Physics:-Bra(e, n)), n = 1 .. d-1), n__1 = 1 .. d)

(11)

Simplify(%)

sum(Physics:-`*`(Physics:-Ket(e, n+2), Physics:-Bra(e, n)), n = 1 .. d-1)

(12)

``

NULL


Download hopping_(reviewed).mw

Edgardo S. Cheb-Terrab

Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

For a couple of days, there are Maple 2021 and Maple 2022. The corresponding Maplesoft Physics Updates are not the same

  • If you try to install the Updates for Maple 2022 in Maple 2021, it won't work as expected: the Updates for Maple 2022 do not contain the fixes for Maple 2021 because they are already in the Maple library 2022. More critical: the Physics Updates for Maple 2022 rely on things that only exist in Maple 2022.

So, each Maple release has its window of versions of the Physics Updates. How do you know about these windows?

  • By visiting the official Maplesoft Physics Updates webpage. There you read that the latest version for Maple 2021 is v.1181. And that for Maple 2022, we are already in v.1183.
  • By opening the distributed file Physics Updates.mla itself, where you read the same information, going back to the window of Updates for Maple 2018.

With the above in mind, now on your post, @michalkvasnicka. What @tomleslie says is correct:

  • In Maple 2022, Physics:-Version(latest) installs the latest version for Maple 2022. Good.
  • In a previous Maple release, the Physics Updates.mla says that to install the latest for that release you need to enter Physics:-Version(n), where n for each Maple release is shown there on the webpage.

So everything is working as expected. The MapleCloud installer refuses to install the Physics Updates of Maple 2022 in Maple 2021. Your expectation of installing the Updates for Maple 2022 in Maple 2021 - although natural to some point - is not correct.

From this conversation, what can be improved? 

It would be better if, in a previous Maple release (e.g., 2021), when you input Physics:-Version(latest) it installs the latest for that previous Maple release instead of attempting to install "the absolute latest", which is always programmed for the current - not a previous - Maple release. I am coding this improvement now, but it won't work retroactively, only from here on to the subsequent releases.

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

Solving an ODE involves a myriad of different computational steps. Think of them as bricks of a wall. You immediately realize that many of those bricks are useful to solve other ODEs, or even the same one again.

There is a significant amount of code in dsolve that aims at "remembering" those bricks of computations, so that they can be reused without wasting time. That approach is a mimicry of what you do with paper and pencil and is a fantastic thing within dsolve. That also explains the obvious: the second time you tackle the same ODE, dsolve is much faster.

Now how about you want to "not save computational time". Instead, you prefer to recompute again every single thing. As the author of dsolve, I can tell you I definitely not recommend that. Why waste time recomputing again every step if you can remember the result you got the first time? Your answer seems to be "to see again user information about the steps performed to tackle the ODE".

If that is what you want, here is a solution: input PDEtools:-Library:-Forget( ) before "calling dsolve or pdsolve again" and the results for the most relevant previously computed steps are discarded; you will see again the previous user level information.

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

Hi @nm

A fix for this "lack of 'c' in the case of an empty matrix" in Maple 2021 is distributed within the Maplesoft Physics Updates v.1168; to install, input Physics:-Version(latest) and follow instructions.

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

Hi
The error interruption is unexpected, and a fix to that for Maple 2021 is distributed within the Maplesoft Physics Updates v.1167; to install it suffices to input Physics:-Version(latest) and follow instructions.

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

See the Physics package, the spacetime metric help page ?g_, and more general ?Physics,Tensors. The answers to your questions are all there.

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

restart

with(Physics)

Setup(spacetime)

[spacetimeindices = greek]

(1)

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1142 and is the same as the version installed in this computer, created 2022, February 12, 11:16 hours Pacific Time.`

(2)

Define(t[mu])

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], t[mu], Physics:-LeviCivita[alpha, beta, mu, nu]}

(3)

NULL

SumOverRepeatedIndices(t[mu]*t[`~mu`])

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(4)

NULL

SumOverRepeatedIndices(t[mu]*t[`~mu`])

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(5)

NULL

SumOverRepeatedIndices(t[mu]*t[`~&mu;`])

t[mu]*t[`~&mu;`]

(6)

When you see things like this, try lprint

lprint(%)

t[mu]*t[`~&mu;`]

 

The following works, because, if the covariant index is A, the contravariant index is ~A (here, A = `&mu;`)

t[`&mu;`]*t[`~&mu;`]

t[`&mu;`]*t[`~&mu;`]

(7)

SumOverRepeatedIndices(%)

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(8)

For the same reason, this works

t[`mu`]*t[`~mu`]

t[mu]*t[`~mu`]

(9)

SumOverRepeatedIndices(%)

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(10)

And yet for the same reason this does not work

t[`&mu;`]*t[`~mu`]

t[`&mu;`]*t[`~mu`]

(11)

SumOverRepeatedIndices(%)

t[`&mu;`]*t[`~mu`]

(12)

Likewise neither t[mu] * t[`~&mu;`], your example, could work. You need to be aware: that shortcut to enter indices that you are using, depending on how you use it for contravariant indices, it results in a different thing, displayed the same way (~mu and `~&mu;`)

NULL

 

Download greek-index_(reviewed).mw

Edgardo S. Cheb-Terrab

 

Physics, Differential Equations and Mathematical Functions, Maplesoft

I think FunctionAdvisor(plot, Zeta) is the simplest and most comprehensive way of plotting the Zeta function. The plots you will see are not random but follow the NIST (Digital Library of Mathematical Functions), a somehow modern version of the Abramowitz and Stegun book.

Another very convenient way to visualize specific cases of the Zeta function is using plots:-plotcompare with the expression_plot optional argument, e.g. plotcompare(Zeta(z^2/3), expression_plot).

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

Hi
The command that works in general to compute equations of motion (or field equations in the case of field theory, quantum or not) is Physics:-Fundiff, to perform functional differentiation. Take a look, please, at its help page (?Fundiff).

Beyond Fundiff's help page, more examples of computing motion/field equations using Fundiff are found in the help page ?Physics,Examples.

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

with(PDEtools) 

PDEtools:-declare(y(x), prime = x)

`derivatives with respect to`*x*`of functions of one variable will now be displayed with '`

(1)

Now set a label, Y, to represent y(x) and its derivatives using indexed notation, using PDEtools:-diff_table

Y := diff_table(y(x))


Example:

Y[x, x]+Y[] = f(x)

diff(diff(y(x), x), x)+y(x) = f(x)

(2)

show

diff(diff(y(x), x), x)+y(x) = f(x)

(3)

NULL

To also input using prime notation, there is the Typesetting package, as indicated by acer. If, in addition, you have installed the lasted Maplesoft Physics Updates for Maple 2021.2, you can in addition use dot notation for time derivatives together with all the above.

Download Input_using_indexed_notation_for_derivatives.mw

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

 

This problem has a rather simple solution using PDEtools:-Solve , which has a whole set of routines to handle things like this.

r := x*(diff(theta(t), t))^2+y*(diff(`&varphi;`(t), t))^2

g := (4*(f+T))*(diff(theta(t), t))^2+u*(diff(`&varphi;`(t), t))^2

All you need to do is to ask for a solution independent of certain variables, in you example: t

PDEtools:-Solve(r = g, {x, y}, independentof = t)

{x = 4*f+4*T, y = u}

(1)

This is the example you called more complicated. PDEtools:-Solve works fine as well, whether you load Physics or not

with(Physics)

r := x*(diff(theta(t), t))^2+y*(diff(`&varphi;`(t), t))^2+z*(diff(theta(t), t, t))+w*(diff(`&varphi;`(t), t, t))

g := (4*(f+T))*(diff(theta(t), t))^2+u*(diff(`&varphi;`(t), t))^2+(f+9)*(diff(theta(t), t, t))+4*s*(diff(`&varphi;`(t), t, t))

PDEtools:-Solve(r = g, {w, x, y, z}, independentof = t)

{w = 4*s, x = 4*f+4*T, y = u, z = f+9}

(2)

NULL


Download PDEtools_Solve_independentof.mw

Edgardo S. Cheb-Terrab

Physics, Differential Equations and Mathematical Functions, Maplesoft

Thanks @nm for reporting the problem; the fix is available to everybody by installing the Maplesoft Physics Updates v.1128 or newer.

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

4 5 6 7 8 9 10 Last Page 6 of 52