ecterrab

12714 Reputation

24 Badges

17 years, 263 days

MaplePrimes Activity


These are answers submitted by ecterrab

So, if you Setup(anticommutativeprefix = theta_): then theta_2 * theta_1 - theta_1 * theta_2 <>0. Alternatively, if you want to use theta as prefix, then theta2 * theta1 - theta1 * theta2 <> 0 (so removing the _ after theta). In both cases, if you use the prefix indexed, say as in theta_[1] for prefix = theta_, or theta[1] for prefix = theta, it also works.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi

It is not dsolve that hangs, but int (try interrupting the computation, then entering tracelast to see the computational flow and the hanging point). I see it hanging here:

int:-ModuleApply called with arguments: 1/(_a^n/(a^(-n-1)*(b*(x-s)^(-n/(-1+n)))^(-2*n+1)*(a*b*(x-s)^(-n/(-1+n))*n/((-1+n)*(-x+s)))^n*n^(-n))-_a+1), `_a`

Anyway here are two tips that answer your questions.

1) when apparently dsolve hangs, try the same input with options 'useInt' and 'implicit'. Typically, the hang happens within int or solve, frequently because of simplifying radicals or symbolic powers, not an easy task. The options useInt makes dsolve use Int instead of int, and the option implicit makes dsolve skip the last step that attempts isolating the unknown of the problem after having obtained an implicit solution.

2) to indicate dsolve to use a given method, just pass the method to it, for example as in dsolve(ode, [Chini]). See ?dsolve,details and also ?dsolve,setup; you can actually indicate many methods, in the order you prefer, or change the default choicie of methods used by dsolve if you believe it is more convenient for your work.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi

In my post I wrote kernelopt'e's, a typo, it should be without 'e', so kernelopts. If you work with general relativity 'd suggest you Maple 15 were DifferentialGeometry includes a large set of new GR commands (I use it on the mac too). Anyway attached is a Maple 13 mw worksheet (produced in an older windows machine) showing that the display, and copy and paste, work as expected after kernelopts instead of kerneloptes. And yes, if it doesn't work for you let me know again please.

Best

restart; interface(version);

(1)

kernelopts(opaquemodules = false);

(2)

This replaces adjusts a bit an internal subroutine of DifferentialGeometry, and can be entered before or after "with(DifferentialGeometry):

DifferentialGeometry:- labelDataToLabel := proc(t)

local n;

n := nops(t);

if n=1 then

    Local(t[1]);

elif n = 2 then

    if t[2]=[] then

        Local(t[1]);

    else

        Local(t[1])[op(op(t[2]))]

    fi;

else

    error("wrong number of arguments; expected 1 or 2, received: %1", nargs);

fi;

end:

This is a new routine that makes things be displayed properly (via alias) while, at the same time, the copy and paste of the new display also work properly (via a call to assign. (Note this only works in the Standard GUI, not in the old Classic GUI.)

Local := proc(t)

local tmp, T;

option cache;

 

tmp :=         convert(t, '`local`');

if substring(t, 1..1) = "d" and member(substring(t, 2..-1), GreekLetters) then

        T := cat('`d&`', substring(t, 2..-1), '`;`');

        alias(convert(T, '`local`') = tmp);

         assign(T, convert(t, 'name')):

elif substring(t, 1..2) = "D_" and member(substring(t, 3..-1), GreekLetters) then

        T := cat('`D_&`', substring(t, 3..-1), '`;`');

        alias(convert(T, '`local`') = tmp);

         assign(T, convert(t, 'name')):

fi;

tmp;

end:

This is just a list with the greek letters, lower and upper case

GreekLetters := '["alpha", "beta", "gamma", "delta", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega", "Alpha", "Beta", "Gamma", "Delta", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega"]':

 

So at this point you do not need to enter any alias, things work automatically as expected, and not just for phi or for dphi but for all greek letters and also for both dphi and D_phi:

with(DifferentialGeometry);

(3)

You see now , and also  , displayed as expected

DGsetup([theta, phi], sphere, verbose);

 

 

 

 

 

 

(4)

Input dphi, you see ; then lprint to be sure that the right object is behind this display

dphi;

(5)
sphere > 

lprint(%);

_DG([["form", sphere, 1], [[[2], 1]]])

 

Now mark that  with the mouse, copy and paste it in the next line: you continue seeing  and lprint tells it is the right object

sphere > 

dφ;

(6)
sphere > 

lprint(%);

_DG([["form", sphere, 1], [[[2], 1]]])

 
sphere > 

 

 

Download DG_greek_letters.mw

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi Mark

Sorry, I was making the experiment with the development version and didn't notice. To make this work in your code you need to proceed as follows, more ellaborated.

After "with(DifferentialAlgebra)" enter this block of lines (or you may have them in your .mapleinit file, called maple.ini in the windows platform):

> kerneloptes(opaquemodules = false):

> DifferentialGeometry:- labelDataToLabel := proc(t) 
local n; 
n := nops(t);
if n=1 then Local(t[1]);
elif n = 2 then
if t[2]=[] then
Local(t[1]);
else
Local(t[1])[op(op(t[2]))]
fi;
else
error("wrong number of arguments; expected 1 or 2, received: %1", nargs);
fi;
end:

> Local := proc(t)
local tmp, T;
option cache;

tmp := convert(t, '`local`');
if substring(t, 1..1) = "d" and member(substring(t, 2..-1), GreekLetters) then
T := cat('`d&`', substring(t, 2..-1), '`;`');
alias(convert(T, '`local`') = tmp);
assign(T, convert(t, 'name')):
elif substring(t, 1..2) = "D_" and member(substring(t, 3..-1), GreekLetters) then
T := cat('`D_&`', substring(t, 3..-1), '`;`');
alias(convert(T, '`local`') = tmp);
assign(T, convert(t, 'name')):
fi;
tmp;
end:
 
> GreekLetters := '["alpha", "beta", "gamma", "delta", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega", "Alpha", "Beta", "Gamma", "Delta", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega"]':

I tried it now with Maple 15 and rus fine. Please let me know if it also works fine for you.
Have a good weekend.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

I assumed you are working using the Standard GUI (as opposed to the Classic GUI, whiere this workaround does not work). So in the standard GUI, just enter, at the Maple prompt (or in an input region if you are in using the document mode) just enter the command as explained: for dphi use `d&phi` (including the `), and the same for any greek letter. If it doesn't work for you would you please post the input lines or attach a worksheet with them to understand what could be going on.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

For every object like dphi that you want to see displayed with the greek letter, input a corresponding alias as in
> alias(`d&phi;` = dphi);

That will make all the output of DG display the way you want.

This approach may be easy to implement too directly in the DG code for the next release.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi I am unable to reproduce your problem - perhaps if you could bring more details on the actual input..? Here is what I see: > restart; with(Physics): # set hermitian operators > Setup(her={a,b,c,R}); * Partial match of 'her' against keyword 'hermitianoperators' [hermitianoperators = {R, a, b, c}] # introduce your constraint > constraint := a + b*c*b = R; a + b c b = R # introduce the Hamiltonian > H := - a - b*c*b; -a - b c b # to 'subs' you need to isolate 'a' first > isolate(constraint, a); a = R - Physics:-*(b, c, b) # so subs works: > subs(%, H); -R # simplify/siderels also works; you request to eliminate 'a' simplify(H, {constraint}, {a}); -R # algsubs works as well > algsubs(constraint, H); -R

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi Rob, I am unable to reproduce your 10 min evaluation problem. Perhaps there are some details not mentioned in your post? Here is what I am doing and it takes ~0.8 sec to return expanded. restart; with(Physics); ee := alpha*(a + b)*Ket(E1) + beta*(a - b)*Ket(E2) + beta*(3*a + b)*Ket(E3) + alpha*(a + 4*b)*Ket(E4) + beta*(9*a - 6*b)*Ket(E5) + alpha*(3*a + 6*b)*Ket(E6); Dagger(%)*%; expand(%); time(expand(Dagger(ee).ee)); 0.84 Independent of the above, it is sometimes convenient to split the three operations you are combining, in order to identify where the problem actually is: take the Dagger, then take the `.` product, then expand. So by entering: Dagger(%); %% . %%; expand(%); you (not exactly, but mostly) reproduce your computation and can identify where is that the computation is actually taking the time. Best

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi,

The extra documentation is the reference at the bottom of the page, Bogoliubov's book on quantum fields. The S(cattering) matrix described in the help page is the standard Scattering matrix of perturbative quantum field theory -- see in particular pag. 154 "The axiomatix S-Matrix". The expansion computed by the Maple command is exactly the one shown in page 158, formulas (14) to (17). The output of Physics:-FeynmanDiagrams takes into account Wick's theorems and thus consists of sums of normal products with pairings (see pag 161). All this is explained in the help page. In brief: the output of Physics:-FeynmanDiagrams is the analytic representation of the traditional sequence of Feynman graphs.

The project includes returning also the pictorial representation of these graphs - this is not ready yet, we are working on that and enhancing the rest of the package in general.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi,

The fact that Sum(Ket(Psi, s+1) . Bra(Psi,s),s=-n..n) . Ket(Psi,1); is not evaluated to Ket(Psi,2) is a weakness to be fixed. The replacement of the dot operator Physics:-`.` by the non-commutative Physics:-`*` is a bug to be fixed - the fix may be in place in the first dot release. It is not visible in your post but you use sum, not Sum. Using sum, when you take s = -10..10, the sum is expanded and so the dot product works over one term at a time, receiving zero for all of them but for one that returns Ket(Psi,2). When you use subs(n = 10, `....`) the substitution is performed but the sum is not executed, so you fall in that situation (weakness) where the operation is not performed. To have the substitution and the operation evaluated use eval instead of subs. Regarding this other example where you first substitute and in the next line you perform the dot product, as you show (A . Ket(Psi,1)) the sum is performed not when you substitute but when you execute the `.` product in the second line, so that also works. By the way these computations are expected to return the same result with Sum or sum.

Regarding your question: no, in Maple you cannot define a mapping where the parameters are not of type symbol (what you call more complex structures). You can of course obtain the same behavior with the appropriate `->` mapping but it doesn't look as nice nor it can be entered so easily. For example, for your a[x,y] -> a[f(x), y] you can use (A::a[anything, anything]) -> a[f(op(1, A)), op(2, A)]

Edgardo S. Cheb-Terrab
Physics, Maplesoft

 

Hi, In Maple 11, using the Standard Interface, enter ?Physics,examples and the fourth example in the Mechanics section is all about intertia tensor, abstract vector equations, matrices, etc. Most probably this is the info you are looking for .. Edgardo S. Cheb-Terrab Ph.D Theoretical Physics, Research Fellow, Maplesoft
Hi, You have found a bug in the program - it fix is planned for the next Maple release. Edgardo S. Cheb-Terrab Research Fellow, Maplesoft
Hi, In Maple 11 there is a new Physics package. In the Standard GUI (the new worksheet interface), if you enter ?Physics,examples you will see a number of basic and also some more advanced undergraduate Physics problems tackled using the package. These solved problems can be refurbished with ease to cover problems in different aread (frequently similar math). Edgardo S. Cheb-Terrab Research Fellow, Maplesoft Editor for Computer Algebra, Computer Physics Communications
Hi, This thread seem to have different questions; I'll try to answer them by RE to the title of each message. I need to simplify tedious expressions involving products of fermionic creation/annihilation operators. I loaded the Physics package, In that package there are the Annihilation and Creation commands, that will construct these operators with the corresponding properties in one step. and defined the fermionic operators c[i,spin] and C[i,spin] where i=1..4, spin=1..2 Are these c[i], C[j] annihilation/creation operators? Or are they just fermionic (thus anticommuting) operators? My first concern is that c[i,spin].c[i,spin] doesn't return 0 If c[i] are annihilation or creation operators, then c[i].c[i] is not zero. If c[i] is a anticommuting operator, then yes c[i]^2 = 0, and you need to tell the system that these are anticommuting objects. For that purpose either use an anticommuting variable (see Setup, search for anticommutativeprefix) or set them to be operators that satisfy an algebrarule: AntiCommutator(c[i], c[j]) = 0 Edgardo S. Cheb-Terrab Research Fellow, Maplesoft Editor for Computer Algebra, Computer Physics Communications
Hi, Regarding the difficulties to read the help text: to search the Maple system about tensor notation, for instance contravariant or covariant notation, you can enter the keyword contravariant in a Text search in the Help (F1, then to your left select Text and enter the word contravariant; in the Classic GUI try Help -> FullTextSearch for contravariant). That will point you to everything in Maple that knows about contravariant/covariant notation. Essentially, there are three packages: the old tensor and the new Physics and DifferentialGeometry:-Tensor packages introduced in Maple 11. The latter is a package for specialized operations in curved spaces (there are Maple lessons on its use, also distributed with Maple 11, linked in ?DifferentialGeometry:-Tensor). The old "tensor", also permits operations in curved spaces but is less general than the latter and has not the frame given by all the DifferentialGeometry (DG) subpackages. The Maple 11 version of the Physics package, on the other hand, is mainly for doing _abstract_ tensor algebra (not working with tensor components) and in flat spaces (see ?Physics,conventions, listed in that full text search). The plan is to keep DG:-Tensor as the main Tensor package after integrating into it some functionality available in the old "tensor" that is still not present in DG, and keep Physics as package permitting performing tensor algebra using a simpler notation and setup, basically as it is done when computing with paper and pencil, and including the ability to work with tensors in curved spaces. Clearly we are not there yet, and even so we would still miss relevant tensor functionality that you see nowadays in a package like GR-Tensor (see the web for that). Having said that, the answer to your question regarding the Physics package is basically the 1st paragraph in ?Physics,conventions (Spacetime, tensor simplification and default settings). I quote it here: "A notational convention, not settable, used along the Physics package, is that the distinction between covariant and contravariant indices is omitted: when the index is free, the expression has meaning no matter the character of the index, and when a spacetime index is contracted with another one, it is not relevant which of them is covariant and which is contravariant. So both covariant and contravariant free indices are entered the same way, by "computationally indexing" the tensor - say A - as in A[mu], and are displayed the same way as if they were covariant". Me again: the above makes sense provided that you do abstract tensor algebra, i.e. do not split into space and time. The plans for soon is to allow for this splitting and so some conventions are being introduced allowing to set whether a free index in a tensor expression is covariant or contravariant, so that the split into space and time can be performed with the desired sign (flat space). Regarding the printing of covariant and contravariant indices as in textbooks, this is also an area of evolution for Maple, and we expect at some point (not for Maple 12 but hopefully the next one) to have the infrastructure in place for doing that naturally. In this moment, regarding the Physics package notation, as the paragraph quoted above says, all indices (free and contracted) are displayed as subscripts. Regarding the other post (title: "also confused"), there is an implementation detail you are missing: when you say that F is antisymmetric, nothing gets assigned to F, and, instead, the information of the antisymmetry of F is available for the Physics commands to perform operations with F correctly. Now when you actually assign something to a component of F, like in F[1,1] := 10, you are moving away from the Physics package framework (remember the Physics routines implement functionality for doing _abstract_ tensor algebra, not for computing with tensor "components") and Maple allows you to assign anything to anything. Edgardo S. Cheb-Terrab Research Fellow, Maplesoft Editor for Computer Algebra, Computer Physics Communications
First 49 50 51 52 Page 51 of 52