ecterrab

14630 Reputation

24 Badges

20 years, 147 days

MaplePrimes Activity


These are answers submitted by ecterrab

Hi Age

First please update your Physics with the one provided in the Maplesoft R&D Physics webpage. Tetrads were implemented recently - you many know, nowadays developments in this package are posted on this R&D Physics page around the clock. The documentation is not ready, but the zip that contains the update also contains one worksheet, called NullVectors.mw, that provides, through examples, most of the information you are asking.

I summarize here the novelties:

  • You can set tetrad indices different from spacetime indices, which is equivalent to work with the same tensors in two frames at the same time: the global one, frequently called the 'coordinates' frame, or spacetime frame, and a local one, frequently called local inertial frame (when it is orthonormal, so that the tetrad metric is Minkowski) or the NP (Newman-Penrose, i.e. the tetrad connection is constructed with the NP null vectors);
  • Eight new tensors were added to the package, these are:
    1) the tetrad connection e_[a, mu] (also called vierbein), that maps the tensor components in one frame (global or local) to the tensor components in the other frame;
    2) the tetrad metric eta_[a, b] (if orthonormal, it is of Minkowski type, but you can set it to whatever you want provided it is symmetric, use Setup(tetradmetric = ...); it works the same way as Setup(metric = ...) but sets eta_ instead of g_)
    3) the Ricci rotation coefficients gamma_[a, b, c] (the automatic computation of its components is not in place yet but, coincidentally, I am working on this today and will probably have it in place and uploaded to the R&D Physics webpage by the end of the day);
    4) another related tensor shown in Landau's "The classical theory of fields" book as (98.10) in page 293, this is lambda_[a, b, c] constructed with linear combinations of gamma_[a,b,c]
    5) the four null vectors of the tetrad formalism l_[mu], n_[mu], m_[mu] and mb_[mu], within a new subpackage Physics:-Tetrads.
  • You can work with the vectors 1), 2), 3) and 4) right away, just Setup(tetradindices=lowercaselatin) or to any other kind of letter you prefer. Try for instance e_[], or Setup(tetradmetric = NP) or etc.
  • You can work with the NP null vectors right away; for this, try e_[nullvectors], and you get stuff ready for Define(%) and from there all works as expected.
  • Or, you can enter with(Physics:-Tetrads) and now you have all related automatically set, and the vectors mentioned in 5) automatically defined, and this definition will automatically follow any changes you do in the metric.

There is more, but the above is the gist. As said the implementation is new, 1/2 of it introduced in September, the rest introduced a week or two ago. Things may change but by now the design is stable and working very well. Anyway some parts of the development, as for instance the simplification of contracted tetrad indices, require more work.

Together with these developments I plan to have in place the Weyl scalars (the same way we can now compute the Riemann invariants), so that the Petrov classification is also in place automatically; i.e. you just indicate the line element for your spacetime and everything, even the Petrov classification, is automatically available without you having to indicate anything else.

Note as well that these things mentioned above can be computed using the DifferentialGeometry package, although things are not automatically available after just indicating the metric so you need to go in steps. But it is possible, just not so straighforward and not with input and output using tensor-indicial notation as is the case of the Physics package and frequently seen in Physics textbooks.

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

Download AddContravariantComponents.mw

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

Hi Age

For summing over repeated indices, so a case where you have mu and ~mu present in the same expression, the command you are looking for is called SumOverRepeatedIndices, one of the commands of the Physics package. For summing over ~mu only, you can use add or sum, for example:

> add(g_[~mu, 2], ~mu=1..2)

does what you want. The key thing is that ~mu is just a symbol; so, it can also be used as a summation dummy withn add or sum.

Depending on the manipulation you want to do with indices you may also want to give a look at SubstituteTensorIndices.

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

@rit 

Please give a look at the help pages for Physics,Ricci and for DifferentialGeometry,Tensor,RicciTensor. You will see that you need to set the metric of spacetime. This is shown in the Examples sections of these pages. The coordinates you see set in the Physics pages is equivalent to the DGsetup command in the DifferentialGeometry page. Likewise, setting the metric (equations 6 and 7 of the Physics page) is equivalent to setting the Connection in the DifferentialGeometry page (equations 2.2 and in another example in 2.7). Once you have set the metric you can calculate everything about this tensor as explained in these two help pages.

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

Hi

I believe that the command you are looking for is PDEtools:-dsubs - it performs differential substitutions into expressions.

A more sophisticated operation can be performe with PDEtools:-casesplit, as in 'simplify differential equations taking into account other differential equations'; this is in the end what you are doing with you are performing differential substitutions, although the range of problems you can tackle with PDEtoosl:-casesplit, mainly in the PDE case, is bigger than the kind of substitutions you mentioned.

Anyway both commands do what you ask very well.

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

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

Note also that if you use eval instead of subs, you actually don't need to use simplify or Simplify or anything else: the expression automatically cancels upon evaluation of the commutators.

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

Hi NOh

The issue is known. You can fix this and related (so called premature evaluation) problems by redefining sum as in:

 

To see an explanation of what this does check please the help page ?Updates,Maple18,Physics, the section on "New Enhanced Modes in Physics Setup", item 4.

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

Hi Andriy

> with(Physics):

> Setup(op = A):

> type(A^5, '`^`'(Library:-PhysicsType:-ExtendedQuantumOperator, posint));

                          true

So:
* Note that after having loaded Physics, `^` is the same as Physics:-`^`, and different from :-`^`
* To have the type working properly you need to quote the function call (otherwise, Physics:-`^` gets executed over commutative objects, and so it returns in terms of the commutative :-`^`, not Physics:-`^`, and the match you are expecting doesn't happen)
* Note you do not need to load the Library to have the Physics types working, just invoke them as you see in the above using the long form.

If you want to have this type working with a symbolic power too - say n with assumptions - it also works. Use type/satisfies. For instance as in

> assume(n, posint)

> type(A^n, '`^`'(Library:-PhysicsType:-ExtendedQuantumOperator, satisfies(n -> is(n,posint))));

                               true

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

Hi

Instead of 'assume', I would use 'assuming' (for details please see the help page for assuming), but independent of that, here is how you can achieve what you want, in somehow different forms. I am performing the operation on a single exponential just to pass the idea, you can also play around with the different simplifiers:

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

Hi Soren

Good catch again, this one is now also fixed. Somewhere in the internal routines the code was performing A^(-1) . Ket by first performing A . Ket and looking for a result proportional to a Ket, all correct, but missing the case A . Ket = 0, that would take you to the error 0^(-1) you expected and didn't receive, receiving instead the operation A^(-1) . Ket uncomputed.

The fix is available to everyone in the usual place, the Maplesoft R&D Physics webpage.

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

Hi Tucker

Differentiating with respect to a Matrix, or tensor function, works fine, just use tensor notation, and it works regardless of whether you have set the dimension. Here is how you do it. By the way I run the following using the latest version of Physics, that you can update (I recommend this) from the Maplesoft R&D Physics webpage.

 

restart; with(Physics)

The use of tensor notation here is just to represent matrix operations, so this is tensors in an Euclidean geometry (no relativity around), and according to what you say the dimension of this space is 6, so

Setup(metric = Euclidean, dimension = 6, quiet)

Define now three tensors, as you did, and R is not necessary but I will use it to refer to the result

Define(s, A, R)

`Defined objects with tensor properties`

 

{A, R, s, Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, kappa, lambda, mu, nu]}

(1)

Your computation, in tensor notation, is thus written by rewriting Transpose(s).A.s

s[mu]*A[mu, nu]*s[nu]

s[mu]*A[mu, nu]*s[nu]

(2)

You want now to differentiate (2) with respect to s. Just go ahead as you did, only using tensor notation, so also for the differentiation variable

R[rho] = Diff(s[mu]*A[mu, nu]*s[nu], s[rho])

R[rho] = Diff(s[mu]*A[mu, nu]*s[nu], s[rho])

(3)

Now: you used Diff, and here me too to follow you, but Diff, like %diff, are inert representations for the derivative, they do not actually compute anything, they only represent the operation. So to actually compute this derivative, either use diff instead, or apply value to the result above, both work the same way. For example

value(R[rho] = Diff(s[mu]*A[mu, nu]*s[nu], s[rho]))

R[rho] = A[mu, nu]*Physics:-g_[mu, rho]*s[nu]+A[mu, nu]*Physics:-g_[nu, rho]*s[mu]

(4)

And this is the answer to your question. This result, however, can still be simplified. Recalling: for tensors, Maple uses the sum rule for repeated indices, so:

Simplify(R[rho] = A[mu, nu]*s[mu]*Physics[g_][nu, rho]+A[mu, nu]*s[nu]*Physics[g_][mu, rho])

R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu]

(5)

You may also want to see the actual components of this tensorial derivative just computed. You can do that in three ways. First, use Physics:-TensorArray , as in

TensorArray(R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu])

Array(%id = 18446744078499257750)

(6)

Note the dimensions of his array

"ArrayDims(?)"

1 .. 6

(7)

Or you may prefer to use Library:-TensorComponents, as in

Library:-TensorComponents(R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu])

[R[1] = 2*A[1, 1]*s[1]+A[1, 2]*s[2]+A[1, 3]*s[3]+A[1, 4]*s[4]+A[1, 5]*s[5]+A[1, 6]*s[6]+A[2, 1]*s[2]+A[3, 1]*s[3]+A[4, 1]*s[4]+A[5, 1]*s[5]+A[6, 1]*s[6], R[2] = A[1, 2]*s[1]+A[2, 1]*s[1]+2*A[2, 2]*s[2]+A[2, 3]*s[3]+A[2, 4]*s[4]+A[2, 5]*s[5]+A[2, 6]*s[6]+A[3, 2]*s[3]+A[4, 2]*s[4]+A[5, 2]*s[5]+A[6, 2]*s[6], R[3] = A[1, 3]*s[1]+A[2, 3]*s[2]+A[3, 1]*s[1]+A[3, 2]*s[2]+2*A[3, 3]*s[3]+A[3, 4]*s[4]+A[3, 5]*s[5]+A[3, 6]*s[6]+A[4, 3]*s[4]+A[5, 3]*s[5]+A[6, 3]*s[6], R[4] = A[1, 4]*s[1]+A[2, 4]*s[2]+A[3, 4]*s[3]+A[4, 1]*s[1]+A[4, 2]*s[2]+A[4, 3]*s[3]+2*A[4, 4]*s[4]+A[4, 5]*s[5]+A[4, 6]*s[6]+A[5, 4]*s[5]+A[6, 4]*s[6], R[5] = A[1, 5]*s[1]+A[2, 5]*s[2]+A[3, 5]*s[3]+A[4, 5]*s[4]+A[5, 1]*s[1]+A[5, 2]*s[2]+A[5, 3]*s[3]+A[5, 4]*s[4]+2*A[5, 5]*s[5]+A[5, 6]*s[6]+A[6, 5]*s[6], R[6] = A[1, 6]*s[1]+A[2, 6]*s[2]+A[3, 6]*s[3]+A[4, 6]*s[4]+A[5, 6]*s[5]+A[6, 1]*s[1]+A[6, 2]*s[2]+A[6, 3]*s[3]+A[6, 4]*s[4]+A[6, 5]*s[5]+2*A[6, 6]*s[6]]

(8)

The above is a list with 6 equations. Finally you can also define this tensorial result (5) itself as a tensor, in order to use R[mu] to refer to each of the components, as follows:

Define(R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu])

`Defined objects with tensor properties`

 

{A[mu, nu], Physics:-Dgamma[mu], Physics:-Psigma[mu], R[rho], Physics:-d_[mu], Physics:-g_[mu, nu], s[mu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, kappa, lambda, mu, nu]}

(9)

R[1]

2*A[1, 1]*s[1]+A[1, 2]*s[2]+A[1, 3]*s[3]+A[1, 4]*s[4]+A[1, 5]*s[5]+A[1, 6]*s[6]+A[2, 1]*s[2]+A[3, 1]*s[3]+A[4, 1]*s[4]+A[5, 1]*s[5]+A[6, 1]*s[6]

(10)

R[2]

A[1, 2]*s[1]+A[2, 1]*s[1]+2*A[2, 2]*s[2]+A[2, 3]*s[3]+A[2, 4]*s[4]+A[2, 5]*s[5]+A[2, 6]*s[6]+A[3, 2]*s[3]+A[4, 2]*s[4]+A[5, 2]*s[5]+A[6, 2]*s[6]

(11)

The same computation can be done in an arbitrary metric, not an Euclidean one. For that purpose, in the first line, enter Setup(metric = arbitrary, dimension = 6) (that is, 'arbitrary' instead of 'Euclidean') and in the left-hand side of (3) use R[`~rho`] instead of R[rho] so that left and right hand sides both have the free index contravariant, and rerun the worksheet.

NULL

 

Download Differentiate_with_respect_ot_a_tensor.mw

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

Hi Sören

This was indeed a problem in a computation running under assumptions (mainly that occupation numbers are actually positive integers). It is fixed now. You can download the fix as usual from Maplesoft's R&D Physics webpage. By the way I am curious about your computation ... this somehow symmetric combination of a1 and a2, a negative power of quantum operator applied to Kets, etc. You described partly the problem, but could you tell some more about it? (E.g. what terms you wanted to pick or what comes next?) Thanks.

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

Hi

Try normal(eq3) and you receive 

-omega[0]^2*X[0] = -omega[0]^2*X[0]

At the same time the system sees diff(x(t),t,t) around, but the numerator of the above does not depen on it. The problem you are presenting to dsolve is then ill posed. It is not actually an ODE but an algebraic equation of the form A = A.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi NOh,

No you cannot. In this moment, LinearAlgebra, and various other commands, still compute assuming a commutative domain. The introduction of noncommutative *algebraic* objects is new with the Physics package, and is extending through the library.

If however you could post a woksheet showing the matrix, I can probably show you how you use the existing tools for handling noncommutative products in order to compute the eigenvalues and eigenvectors, and perhaps use this conversation as a base to prepare a new Physics:-Library:-Command with this relevant functionality.

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

First 45 46 47 48 49 50 51 Last Page 47 of 60