## 13633 Reputation

18 years, 320 days

## It is fixed in today's update...

Hi Fred

This issue is now fixed; the fix available within today's update in the usual Maplesoft's Physics R&D (updates) webpage. I am in Brazil giving a mini-course on "computer algebra for physicits" - on return I will add to the zip a new Maple 18 PhysicsUpdates.mw worksheet to tell the things that have been updated already.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Use = instead of :=...

Hi
This is explained in the help page for ?Physics,Define, see the 4th paragraph. In brief, use = instead of an assignment :=, then pass that equation as an argument to Define. Also, to avoid the possible ambiguous meaning for KroneckerDelta[i,j] when the spacetime metric is of Minkowsky type, use the metric itself, g_[i,j] instead. So your input/output would look like

 >
 >
 (1)
 >
 (2)

Now you can use indices with L;  this is the covariant component of L where all the indices are equal to 1

 >
 (3)

This other one has three indices contravariant

 >
 (4)

The mixed covariant, contravariant

 >
 (5)

You can also compute without attributing values to the indices while taking into account the symmetries under permutation of the indices that are implicit in the definition (1)

 >
 (6)

Swap for instance the first two indices: you receive the same expression

 >
 (7)

And the same if in addition you swap the positions in the second pair of indices

 >
 (8)

All the covariant nonzero components

 >
 (9)

These are the five different values found in this set

 >
 (10)
 >
 (11)

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

## Bosonic and fermionic operators...

Hi
You indicate bosonic and fermionic operators, respectively noncommutative and anticommutative, using the Physics:-Setup command (see ?Physics,Setup). Any operator set, say as in Setup(operator = A), is assumed to be noncommutative. If in addition this operator is constructed with an anticommutative prefix, that you set, say as in Setup(anticommutativeprefix = Q), so for example if you enter Setup(operator = Q), then Q is a fermionic (anticommutative) operator. You can construct annihilation and creation operators to increase the occupation numbers of bosonic and fermionic quantum states by using the Annihilation and Creation operators. Details about all this are found in the help pages ?Physics,Example (section on Quantum Mechanics), ?Physics,Conventions (section on Space of quantum states and Dirac notation) and ?Physics,Annihilation. For projectos onto bosonic and fermionic states see ?Physics,Projector.

Regarding your other question, tensors can have their indices covariant, these are displayed as subscripts, or contravariant, displayed as superscripts.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Easier using Physics...

Hi

Although you could do these computations using DifferentialGeometry, I believe in cases like this one it is simpler using the tensor capabilities of the Physics package.

Independent of that, there is an issue with your post about the Divergence of a Tensor. You show a tensor 'tau' defined as an equation with a matrix on the right-hand side, but you do not show the indices of tau: is this the all contravariant tau, as in  or the all covariant  or just the "physical" components frequently denotated  that are not covariant nor contravariant? For the relationship between convariant, contravariant and "physical" components, see for instance A Primer on Tensor Calculus, page 12, formulas (32) and (33).

Here I will assume that you are describing

 >

Set the dimension to 3 and work with the coordiantes you indicated

 >
 (1)

To set the metric, the simplest way is to indicate the line element

 >
 (2)
 >
 (3)

Visual check on the metric

 >
 (4)

Define now the stress tensor

 >
 (5)

And that is all. You do not need to define anything else, basis, Christoffel symbols, nothing.

Just compute the (covariant) divergence using standard tensorial notation.

Moreover: to avoid repetitive display of (r,theta,z) everywhere, use PDEtools:-declare

 >
 (6)
 >
 (7)

The components of this Divergence are

 >
 (8)

If what you need is this expression in terms of the "physical components" , from the formulas (32) and (33) of the reference mentioned in the first paragraph, you have:

 >
 (9)
 >
 (10)
 >
 (11)
 >
 (12)

And this is the result you show, that you were expecting.

_________________________________________________________________________

Details

Note the compact display of derivatives indexed, and the functionality of the components of  omited (this is what PDEtools:-declare does). But is only a display trick.

The actual Maple objects are behind this display. If you want to see them in standard Maple notation, use show

 >
 (13)

Also, in (12) you see  and also . If you want the symmetry of the stress tensor - that you indicated when you defined the tensor - to be taken into account, use Physics:-Simplify  (not simplify)

 >
 (14)

If you prefer for the symmetry properties to be taken into account automatically, among other ways you can directly define the tensor as a matrix with the appropriate symmetry, for example:

 >
 (15)
 >
 (16)

Define now a tensor Tau with this equation (see Physics:-Define , the paragraph about defining using tensorial equations)

 >
 (17)

You can now compute taking the symmetry into account automatically

 >
 (18)
 >
 (19)

By the way you may want to compute with this object  itself, as a tensor of 1 index. You can do that the same way, defining a tensor whose components are the components of this divergence, as in

 >
 (20)
 >
 (21)

Now you have direct access to the covariant OR contravariant components using indices. For example, the 2nd covariant and contravariant components are different

 >
 (22)
 >
 (23)
 >
 (24)

NOTE: the computations above are performed using the newest Physics library, available for download at Maplesoft's Physics Research & Development webpage

 >
 >

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

## simplify/siderels...

Hi

There is a technique in Maple, not very well know, which however permits eliminations as the one you say indicating your preferred variables. Suppose for that purpose that you do not assign c := a+b. Instead you only want a + b + 2 be rewritten as c + 2, and let's state the task as "I want to simplfy a + b + 2 taking into account c = a + b and removing a and b". Here it is:

The details are explained in ?simplify,siderels. In my opinion, and despite some nuances of its syntax, this is one of the most versatile simplifications available in the Maple system.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## It works as designed - and can be improv...

Hi Alejandro, others

Regarding Diff -> diff, PDEtools:-dchange works as designed. When I wrote this command (exactly 22 years ago ...) and also by the end of 1999 there was evidence of problems when you did not do Diff -> diff, mainly related to incorrect uses of Diff, that would not be detected if you do not activate these inert derivatives, making the whole 'change of variables' process go astray.

Along the years, mainly while designing `assuming` and the handling of inert functions, another approach proved to be more useful: just spend additional computational cycles, as much as you need, verifying - with reasonable probability - that ill-defined situations are not present, then proceed without activating anything. This always implies on a slow down but it is negligible. PDEtools:-dchange never got updated regarding this; when I saw this post a couple of days ago it passed through my mind to just do it.

By now I am busy with the  Virtual User Summit (Feb/27) and next month with a mini-course on Computer algebra for physicists in Brazil. After that I will give a look at this. If possible, I will implement it and put it available on the Maplesoft R&D page for DEs and Mathematical functions. I will then post here again.

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

## answered there, here is it:...

In brief: a) use Physics:-Gtaylor, not taylor and b) Before proceeding, update your Physics package with the latest version, available for download at the Maplesoft Maple Physics: Research & Development webpage.

In details: Physics is a relatively new package. The taylor command is from before Physics, and uses ``*` `and ``^`` operators that assume commutativity. An important number of developments happen every year towards making the Maple library more aware of the presence of non commutative objects within algebraic expressions, so that their products, powers, simplification, expansion and combination rules, etc happen as expected. A relevant command in this process is Physics:-Check that will tell you, among other things, whether products of non-commutative objects are ill-formed; i.e. expressed using a commutative ``*`` operator. Try it with the output of taylor (not Physics:-Gtaylor) and you will see.

Regarding updating Physics: bug fixes and new Physics and Physics-related developments are integrated into the R&D version of the package every week.

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

## It is already of that form...

Hi

Following Mac Dude's advise (you need to write r(phi), not r), dsolve(ode) returns to you an integral that is already an elliptic integral. You may recognize it by eye, or if you are not familiar with elliptic integrals call value over the output of dsolve (as in value(%)) and you see that the output, rather large in length, involves the EllipticF function. Having said that this is an elliptic integral not of Jacobi but of inverse-Jacobi type: EllipticF(z,k) = InverseJacobiSN(z,k).

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

## The Physics package...

Hi

Thanks Carl. I gave a look at your worksheet (html first link). In Maple there is a Physics package, that includes noncommutative products, powers, differentiation, series expansion, and also an implementation of Campbell-Baker-Hausdorff formula in that, when [A,[A,B]] <> 0 or [B,[A,B]] <> 0, the expansion of exponentials does not proceed, otherwise it proceeds, etc.

So at first sight I'd say that what I see in your html link can be reproduced in Maple naturally. If not, please post here the issue so that we can give it a look.

In case you go ahead and implement the contents of your html page using Maple's Physics, I also suggest you to first download the most up-to-date Physics for Maple 17 at the Maple Physics: Research & Development webpage.

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

## missing info and current Maple...

Hi Dude

In order to reproduce a problem it is necessary the actual input lines. The standard way of doing that is to copy and paste, or better: attach a worksheet where the problem is shown (you attach a worksheet by clicking the green arrow you see in the toolbar when editing your post). In particular, what you describe looks more like a 1D versus 2D input issue, only observable within a worksheet.

Besides that, you know, Maple changes in significant ways at every release and, particularly so, the Physics package. Since Maple 15 Physics duplicated its size two times, for Maple 16 then again for Maple 17, and currently relies on non-Physics features that didn't exist in Maple 15. Unfortunately this makes non obvious how to help you even if you had posted the actual input lines to reproduce the problem.

Having said that, if the problem you are observing, that motivated your post, is in the Physics package and is reproducible in Maple 17, chances are that it will get fixed next day and you will be able to download the fix directly from the Maplesoft Physics: Research & Development webpage, where Physics is updated regularly with the latest developments.

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

## busy till the end of January...

Hi
I'm sorry but am overloaded till the end of January - this is a special time of the year, closing a new Maple release. Then I will give a look and post here my take on your question.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## … Maple 17?...

If you only have access to Maple 12, I suggest you to give a look at the documentation of GRTensor.

If you have acces to current Maple (17), using the Physics package, just enter

> with(Physics);
> Setup(metric = arbitrary);

And that is all. The metric, g_[mu,nu], depends on 10 arbitrary functions of four variables (x,y,z,t), and the Christoffel, Ricci, Rieman, etc. general relativity tensors all got automatically defined on background when you entered the Setup command.

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

## print/foo are not traceable...

Hi Carl

print/foo are not traceable - they can easily (not always though) enter an infinite loop invoking themselves to print on the screen the debug output. What you can do is to stopat them. Or you can also redefine them inserting an option trace, then diminish the prettyprint level in order to avoid possible infinite loops, then run. By the way if you have any questions regarding the routine itself please feel free to ask - I wrote it.

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

## assume(theta, scalar) and Setup(real=the...

Hi John

There are three situations: the anticommutative variables can be taken as a) real "numbers"; b) complex "numbers"; c) operators.

Dagger is supposed to perform the operation in all cases, what changes is what it should returns.

For c) it works as you see it working today, this is the default mode.

For b) we needed a way to specify that the object is a scalar, then  would return . This can now be done if you

For a) we already have the new Setup(realobjects = {...}) where {...} can contain anything, including anticommutative variables, and so  returns  - this also already works. If you  and also  you can work as in classical real field theory.

Example: (you need to download the updated Physics.mla from Maple Physics: Research & Development)

 >
 >
 (1)

So the default case is case c)

 >
 (2)
 >
 (3)
 >
 (4)

Suppose now that your anticommutative variables

 >
 (5)

are all scalars. For that purpose, explicitly assume all the elements of G to be scalars; this is case b)

 >

For readability let's displayed assumed variables without a trailing tilde:

 >

Dagger now returns using conjugate

 >
 (6)
 >
 (7)

And that is what you can use in classical field theory.

Suppose furthermore that you want to compute as in case a) so with all these objects taken as real. You can either 'assume additionally (see assume )' or use the new Setup option to indicate real objects in your theory, as in

 >
 (8)

So for case a)

 >
 (9)
 >
 (10)
 >
 (11)

In any case, the same way realobjects has advantages with regards to , I'll see to add another Setup option, scalarobjects, with the same advantages, and eventually generalize the approach furthermore to include other more frequent assumptions.

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

## Dagger <> conjugate...

Hi John,

There is a distinction between Dagger and conjugate when you operate over a product of matrices, as well as when you operate over a product of anticommutative (Grassmaniann) objects. So, for instance, conjugate returns what you received, by design, and Dagger returns what I believe you were expecting from conjugate:

 >
 (1)

Having said that, whether to treat a Grasmanniann object itself as a scalar, and so to have Dagger(theta) -> conjugate(theta), is a different issue; debatable, I think. The current implementation allows for anticommutative objects that are also not scalars. A distinction between the two cases - anticommutative scalar and not-scalar - may be useful ..

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

 First 46 47 48 49 50 51 52 Last Page 48 of 56
﻿