## 13538 Reputation

18 years, 286 days

## new: am^2 = 0 ap^2 = 0 for fermionic am ...

Hi Andriy

In the first reply it is shown how to perform to the end the computation you wanted to perform. In the second one I mentioned the implementation, in the downloadable update of Physics, of the simplification N^k = N, where N = ap . am and ap, am respectively represent criation, annihilation fermionic operators. Besides that, in the update of Physics posted today (dowloadable from the Maple Physics: Research & Development updates page) the simplification am^2 = 0 and ap^2 = 0 is also implemented, completing what has been discussed in this thread. Recalling, in connection with one of your questions, Andriy, these new simplifications are performed not using simplify but using Simplify, the command of the Physics package (see ?Physics,Simplify).

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Change variables...

 >
 >
 (1)

The transformation you posted:

 >
 (2)

Rewrite your transformation with x, y and  on the left-hand sides

 >
 (3)

Change variables

 >
 (4)

 >
 (5)

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Yes by setting an algebra for powers of ...

Hi Peterm,

 >
 >
 (1)

Set your algebra as an algebra for powers of noncommutative operators, only two rules: one for Commutators, the other one for AntiCommutators, both rules respectively mapping into two functions f and g

 >
 (2)

Check it

 >
 (3)
 >
 (4)

That is the most important part. You can now write f and g to accomplish the task in different ways.

Here is one way, starting with g

 >

For f you need also to take care of cyclic permutations of  to get the correct sign; express first f  in terms of a procedure s, then concentrate on s

 >

This is one possible way to code s

 >

Check it out

 >
 (5)
 >
 (6)
 >
 (7)

All is in place. So now:

 >
 (8)
 >
 (9)
 >
 (10)
 >
 (11)
 >
 (12)
 >
 (13)
 >
 (14)
 >
 (15)

All this is reproducible in Maple 17, but anyway it is a good idea to update your Physics library - you can download it from the Maplesoft "Maple Physics: Research & Development" updates page. I will see next week to have things in place so that you can achieve the same results without having to write these f and g functions - say tackling this problem succesfully in a more natural way, similar to the one you tried.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## How to do it with current or previous Ph...

I just saw your post ... answering two years after is probably irrelevant, but anyway: things have changed since 2011. Using the Physics library up-to-date (you can download it from the the "Maple Physics: Research & Development" updates page), current version:

 >
 (1)

Set some commutation rules to see how it works

 >
 >
 (2)

The first commutator has a constant in the rhs: in these cases you can now index the operators A and B or give functionality to them as desired and the result will always be the right-hand side of type constant  :

 >
 (3)
 >
 (4)
 >
 (5)

In the second commutator, the right-hand side is not constant, so this one works as in previous releases:

 >
 (6)
 >
 (7)
 >
 (8)

The third commutator has functionality in the left-hand and right-hand sides, the same one, so in this case you have more flexibility

 >
 (9)
 >
 (10)

You can also transform f into a procedure

 >
 (11)
 >
 (12)
 >
 (13)
 >
 (14)

The Physics update is developed assuming the Maple 17 library, but the last approach, with  in the right-hand side of the commutator followed by defining f as a procedure, will also work in previous Maples.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Quantum Mechanics examples...

I suggest you to give a look at the section on Quantum Mechanics, subsection on Angular Momentum, within the help page ?Physics,Examples. The situation there illustrated is similar. From there you can either obtain what you want with few changes, or perhaps refine your question a bit more to help you more concretely.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Yes: Simplify....

Hi

I only saw your post now .. anyway:

 >

From the formula you posted I assume you are working in a 3D Euclidean space; set things accordingly and define a tensor A

 >
 (1)

Your formula is (using the abbreviation ep_ for LeviCivita)

 >
 (2)

To obtain the right-hand side you show, you can use Simplify

 >
 (3)

In the above, the repeated index n corresponds to your index i, and the dAlembertian corresonds to your . To understand how this result is formed you can selectively simplify first the product of LeviCivita tensors using the dot operator, as in

 >
 (4)
 >
 (5)
 >

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## cannot reproduce...

Hi
When entering z1*z2*z1*z1; I receive z1 z2 z1^2 which is correct. What version of Maple are you using?

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Total number of particles...

Hi Andriy,

 >

Note first the use of the up-to-date Physics library (dowloadable from the Maple Physics: Research & Development updates page):

 >
 (1)

Now, Psi is a mathematical function (check ?Psi) so, although possible, it's better to not use that name to avoid potential ambiguous meaning. I all what follows below I use psi instead.

 >
 (2)

Your annihilation operators: as mentioned by Carl, you can delay evaluation of these procedures am, ap, nn until i, j and  are all nonnegative integers. For that purpose, add the line you see below after "local k"

 >
 (3)

Insert the same line for ap that generats your creation operators, and also for nn, the occupation number at state

 >
 (4)
 >
 (5)

IMPORTANT: the internal routines know that if A is a quantum operator (and all annihilation and creation operators generated by Annihilation and Creation are automatically quantum operators), a sum of A objects is also a quantum operator. However, because these am, ap and nn defined above are returning unevaluated when any of  are not numbers, the internal routines have no way to know these am, ap, nn programs are quantum operators, restricting the use of these three procedures when  are not numbers. You resolve this by directly passing this piece of information, as in

 >
 (6)

And now you can operate with am, ap and nn as quantum operators even when  are not numbers. For instance, you can do sum, or Sum - but then you cannot us add for the summation where  f is a summation limit and is not defined. So for instance use sum for the addition from 1 to f, and use add for the rest

 >
 (7)

As said, because you indicated that nn is a quantum operator, the system now knows that this sum 'N ' is also a quantum operator:

 >
 (8)

You can now apply N to a Ket even not saying the value of f, although of course the operation cannot be performed to the end until you tell that value (note also that `.` automatically distributes over the sum)

 >
 (9)
 >
 (10)

Evaluate for instance at  f = 2

 >
 (11)

This result is correct and I understand the answer to your question on how to do this, which is pretty close to what you have done in fact.

For curiosity, let's anyway verify this result. You need to check that

a) N is an operator that indeed returns the total number of particles.

b) This total number of particles of the state represented by the ket K is indeed 5.

Start with b) just because it is a 1 step thing: the total number of particles of a Ket is equal to the sum of its occupation numbers.  So, discarding the label of K (first operand), the occupation numbers are

 >
 (12)

and you can add them via

 >
 (13)

So b) checks OK.

For a) you need to show that the summation NK indeed adds all these occupation numbers of K. For that, get the summand

 >
 (14)

Get the nn operands in this summand

 >
 (15)

Check now the quantum number over which each of these Inn operators act. For that purpose note Library:-GetFingerprint (a section describing it is found within the help page for the Physics, Library )

 >
 (16)
 >
 (17)

The quantum number returned by  is then the third element returned by GetFingerprint above. So get all the products  being added and get the occupation number each of them is returning

 >
 (18)
 >
 (19)

In summary: the sum NK is returning a sum of each of the 12 occupation numbers and, indeed, twelve is the number of "occupation numbers" of K, so this sum is adding all the twelve occupation numbers:

 >
 (20)

and because the sum of these occupation numbers is also the total number of particles of the state represented by the Ket then NK is indeed returning the total number of particles.

 >

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Physics:-SumOverRepeatedIndices and Phys...

Hi Peter,

 >
 (1)

Note the use of the up-to-date Physics library (dowloadable from the Maple Physics: Research & Development updates page):

 >
 (2)

Now regarding your post: to work in 3D, you can set the dimension to 3 as you did, yes, or perhaps simpler just set the metric of a the default 4D spacetime to have  and set the letters to use for spaceindices (not spacetimeindices), for instance as in

 >
 (3)

This is the metric (you do not need to use print as in print(g_[]))

 >
 (4)

You can now work with the 3D part by referring to it using spaceindices (not spacetimeindices).

Regarding your use of `.` instead of `*` in the Lagrangian below (I assume you did that to produce tensor contractions), note that the identity , valid in Euclidean or Minkowski spaces, is not valid in this case where diff and  do not commute because the Christoffel symbols have nonzero components

 >
 (5)

In short, in this system of coordinates  is not a tensor

 >
 (6)
 >
 (7)

The use of `.` to contract the indices then produces no contraction (it would be wrong, equivalent to commuting diff and ) and here is then the Lagrangian - the 3D part using spaceindices

 >
 (8)

Regarding your question: the command to perform a summation over the repeated indices is:

 >
 (9)

Below you have a section showing the same but setting the dimention of 'spacetime' to 3 as you did originally.

Regarding your other question, on how to expand the vector expression

 >
 (10)

recalling I am working with the updated Physics library, you can use expand, Expand, or - in the case of Vectors expandable commands as this one - also with Simplify

 >
 (11)
 >
 (12)
 >
 (13)
 Alternative way, setting the dimension of "spacetime" to 3

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## dsolve = many methods...

In brief: dsolve is a general solver, able to solve different kinds of equations, and with a strategy of taking advantage of different methods when more than one can solve a given equation - nothing of that is present in DEtools[bernoullisols] that can only solve Bernoulli equations and always using the same method.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Exact general symbolic solution matching...

Hi,

In what follows you have the symbolic exact solution to the ODE system you posted, matching the ics you posted, and without specializing any of the symbolic parameters a1, a2, a3, b1, b2 or b3.

 >
 (1)

Strategy:

1) rewrite this system as an ODE system for three unknowns C1, C2, C3, plus an expression giving O1 in terms of them

2) compute the exact solution for C1, C2, C3 in terms of three arbitrary constants

3) adjust the three arbitrary constants to match your initial conditions ics for C1, C2 and C3

4) substitute this solution for C1, C2, C3 matching your initial conditions into the expression giving O1 in terms of them.

While performing these steps, do not display expressions that are too large.

Step 1), one of the equations you present as ics is actually a constraint between the functions:

 >
 (2)

The actual system to be solved then involves 4 DEs and one constraint

 >
 >
 (3)
 >
 (4)

Rewrite now this as "one constraint and three DEs involving only C1, C2 and C3" (see casesplit )

 >
 (5)

In the above you see a system entirely equivalent to yours, but now involving 3 DEs instead of four. Remove then the constraint (that has O1 for lhs) to work just with the ODE system, and assign it to

 >
 (6)
 >
 (7)

Step 2) Compute now the exact solution to this system; note that dsolve will solve and simplify the solution - most of the time is spent in simplifying

 >
 (8)
 >
 (9)

As mentioned by others, these solutions involve large algebraic expressions

 >
 (10)

You can transform these into slightly shorter expressions using simplify/size

 >
 >
 (12)

Before proceeding further, let's verify this solution

 >
 (13)

Step 3) Now you need to adjust the integration constants to match your ics for C1, C2 and C3

 >
 (14)

are:

 >
 (15)

So: evaluate  at  and substitute in  in order to have a system for the Cn

 >

Check lengths

 >
 (16)

The symbols in these ics are

 >
 (17)

Solve now for the Cn and simplify the size; check lengths and left-hand sides

 >
 >
 (18)
 >
 (19)

At this point we have solved the problem:  is the general solution in terms of three arbitrary constants Cn and  gives the value of these three arbitrary constants that match your  for C1, C2 and C3. So evaluate  at  to get the answer you are looking for; check lengths

 >
 >
 (20)
 >
 (21)

Step 4) To get the answer to O1, substitute these solutions for C1, C2 and C3 in the

 >
 (22)
 >
 >
 (23)

In addition, the following three would help in compacting the expressions, but they are rather large and simplifying takes time - I am keeping the lines here in comments in case you want to try them

 >
 >

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Take vector products...

Hi,

Suppose a set of N vectors where there may be one of them parallel to one another: their cross product is zero. So, in Maple, for j to N-1, for k from j+1 to N, if V[j] &x V[k] = 0 then V[j] is parallel to V[k]. You can perform this loop operation either using VectorCalculus or Physics:-Vectors.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Yes...

Hi,
Yes, in Maple 17 you can do substitutions of tensors of the form you mention, taking into account free and dummy indices the same way we do when computing with paper and pencil. You need to update your Physics library with the latest one, available for download at the Maplesoft Physics: Research & Development webpage. The command you use to do these substitutions, SubstituteTensor, is currently a Physics:-Library command, part of an upcomming more general Physics:-Substitute command, to handle also tensorial subexpressions within noncommutative products similar to what algsubs and simplify/siderels do with commutative nontensorial products.

 >
 >
 (1)
 >
 (2)

The repeated and free indices of the lhs and rhs of (2)

 >
 (3)

The easy case

 >
 (4)

The free index in the target expression is not  but

 >
 (5)

Distinction between covariant and contravariant indices

 >
 (6)

The index  found repeated in the rhs of the substitution equation (2) apears also repeated in the following target expression

 >
 (7)
 >
 (8)
 >
 (9)

Substitute (2) in the rhs of (2) itself

 >
 (10)
 >
 (11)

The example you posted as a question

 >
 (12)
 >
 (13)
 >
 (14)
 >

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## DEtools[remove_RootOf]...

Hi
allvalues is the natural command to use in that - when solve can rewrite the RootOf expression free of RootOf - you will get rid of it.

There are other situations though, where you would like to understand the RootOf expression without RootOfs around, or allvalues is of no help because solve cannot rewrite the expression without them. This is a typical situation when working with differential equations. A command helpful in these cases, not so well known, is DEtools[remove_RootOf].

Edgardo S. Cheb-Terrab
Physics, Maplesoft

## Other forms of solution?...

You can try other commands of PDEtools as PolynomialSolutions, FunctionFieldSolutions and mainly InvariantSolutions combined with its optional arguments. It would also help seeing the PDE you want to solve - sometimes one can see a change of variables that helps.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

 First 50 51 52 53 54 55 56 Page 52 of 56
﻿