Applications, Examples and Libraries

Share your work here

As a reminder, we regularly host live webinars on a variety of topics for our customers, and we wanted to make this information available to the MaplePrimes community as well.

This featured webinar for this month will outline the Finance Package in Maple 18 including capabilities like the mathematical, statistical, and connectivity tools required to analyse data, calculate forecasts, estimate risks, prototype and develop quantitative algorithms, and leverage parallel programming techniques.

Other topics include:

• Data feed connectivity and system integration

• Price equity and interest rate derivatives

• Populate reporting tools, deliver documents and share worksheets

• Optimize portfolios of financial instruments

• High-Performance Computing (HPC)

To join us for the live presentation, please click here to register.

In Maple 18, the Database package has been updated to include support for SQlite databases as well as a new option for plots to change the background images on plots.  To showcase both of these features, our engineering team put together an example that optimizes the flight path of a pan-US delivery drone.

This application extracts the latitude and longitude of those zip codes from an SQLlite database (the application includes the database, which cross-references US zip codes against their latitude, longitude, city and state). The application then performs a traveling salesman optimization and plots the shortest path on a map of the US.

To download the application click here: PanUSDeliveryDro.zip

This is a 5-days mini-course I gave in Brazil last week, at the CBPF (Brazilian Center for Physics Research). The material will still receive polishment and improvements, towards evolving into a sort of manual, but it is also interesting to see it exactly as it was presented to people during the course. This material uses the update of Physics available at the Maplesoft Physics R&D webpage.

Mini-Course: Computer Algebra for Physicists

 

Edgardo S. Cheb-Terrab

Maplesoft

 

 

This course is organized as a guided experience, 2 hours per day during five days, on learning the basics of the Maple language, and on using it to formulate algebraic computations we do in physics with paper and pencil. It is oriented to people not familiar with computer algebra (sections 1-5), as well as to people who are familiar but want to learn more about how to use it in Physics.

 

Motivation

 

 

Among other things, with computer algebra:

 

• 

You can concentrate more on the ideas (the model and its formulation) instead of on the algebraic manipulations

• 

You can extend your results with ease

• 

You can explore the mathematics surrounding your problem

• 

You can share your results in a reproducible way - and with that exchange about a problem in more productive ways

• 

After you learn the basics, the speed at which algebraic results are obtained with the computer compensates with dramatic advantage the extra time invested to formulate the problem in the computer.

 

All this doesn't mean that we need computer algebra, at all, but does mean computer algebra can enrich our working experience in significant ways.

What is computer algebra - how do you learn to use it?

   

What is this mini-course about?

   

What can you expect from this mini-course?

   

 

Explore. Having success doesn't matter, using your curiosity as a compass does - things can be done in so many different ways. Have full permission to fail. Share your insights. All questions are valid even if to the side. Computer algebra can transform the algebraic computation part of physics into interesting discoveries and fun.

1. Arithmetic operations and elementary functions

   

2. Algebraic Expressions, Equations and Functions

   

3. Limits, Derivatives, Sums, Products, Integrals, Differential Equations

   

4. Algebraic manipulation: simplify, factor, expand, combine, collect and convert

   

5. Matrices (Linear Algebra)

   

6. Vector Analysis

   

7. Tensors and Special Relativity

   

8. Quantum Mechanics

   

9. General Relativity

   

10. Field Theory

   

BrasilComputacaoAlgebrica.mw.zip

BrasilComputacaoAlgebrica.pdf 

Edgardo S. Cheb-Terrab
Physics, Maplesoft

In this post we present the solution with Maple to the logical problem of "Gardens Puzzle"

http://www.mathsisfun.com/puzzles/gardens-solution.html

The Puzzle:

Five friends have their gardens next to one another, where they grow three kinds of crops: fruits (apple, pear, nut, cherry), vegetables (carrot, parsley, gourd, onion) and flowers (aster, rose, tulip, lily).

1. They grow 12 different varieties.
2. Everybody grows exactly 4 different varieties
3. Each variety is at least in one garden.
4. Only one variety is in 4 gardens.
5. Only in one garden are all 3 kinds of crops.
6. Only in one garden are all 4 varieties of one kind of crops.
7. Pear is only in the two border gardens.
8. Paul's garden is in the middle with no lily.
9. Aster grower doesn't grow vegetables.
10. Rose growers don't grow parsley.
11. Nuts grower has also gourd and parsley.
12. In the first garden are apples and cherries.
13. Only in two gardens are cherries.
14. Sam has onions and cherries.
15. Luke grows exactly two kinds of fruit.
16. Tulip is only in two gardens.
17. Apple is in a single garden.
18. Only in one garden next to Zick's is parsley.
19. Sam's garden is not on the border.
20. Hank grows neither vegetables nor asters.
21. Paul has exactly three kinds of vegetable.

Who has which garden and what is grown where?

 

About methods of solution. At first I just wanted to generate all variations and using conditions 1 .. 21 to find all solutions. But even if we use the condition that everybody grows exactly 4 different varieties then the total number variants equals  5!^2*binomial(12,4)^5=427945522455000000

So from the very beginning using some of the conditions 1 .. 21 we maximally reduce the number of possible variants. For example from the conditions 11, 18 and 6 implies that only in one garden are all 4 varieties of flowers. Next we pass through these variants and using conditions 1 .. 21 and finally come to a unique solution:

restart;

Fruits:={apple, pear, nut, cherry}:

Vegetables:={carrot, parsley, gourd, onion}:

Flowers:={aster, rose, tulip, lily}:

 

Set1:=Flowers:

Garden1:={Set1}:

Set2:=Fruits union Vegetables union Flowers minus {nut,gourd,parsley} minus {apple,cherry,rose}:

Garden2:={seq({nut,gourd,parsley} union {Set2[i]}, i=1..nops(Set2))}:

Set3:=Vegetables union Flowers minus {parsley}:

Garden3:={seq({apple,cherry,pear} union {Set3[i]}, i=1..nops(Set3))}:

Set4:=combinat[choose](Fruits union Vegetables union Flowers minus {onion,cherry} minus {apple,parsley,pear,nut}, 2):

Garden4:={seq({onion,cherry} union Set4[i], i=1..nops(Set4))}:

Set5:=Fruits union Vegetables union Flowers minus {apple, cherry,nut,parsley}:

Garden5:=combinat[choose](Set5, 4):

 

S:=[]:

for s1 in Garden1 do

for s2 in Garden2 do

for s3 in Garden3 do

for s4 in Garden4 do

for s5 in Garden5 do

s:=[s1,s2,s3,s4,s5]: s_4:=combinat[choose](s,4): m:=0: n:=0: k:=0: p:=0: q:=0:

for i in s do

if `intersect`(i,Fruits)<>{} and `intersect`(i,Vegetables)<>{} and `intersect`(i,Flowers)<>{} then m:=m+1: fi:

if pear in i then n:=n+1: fi:

if tulip in i then k:=k+1: fi:

if aster in i and `intersect`(i,Vegetables)<>{} then p:=p+1: fi:

if i=Fruits or i=Vegetables or i=Flowers then q:=q+1: fi:

od:

if nops(`union`(op(s)))=12 and nops(`union`(seq(`intersect`(op(s_4[j])), j=1..nops(s_4))))=1 and m=1 and n=2 and k=2 and p=0 and q=1 then S:=[op(S),[s1,s2,s3,s4,s5]]: fi:

od: od: od: od: od:

 

L1:=[seq([[3,Paul],[2,Sam],seq([combinat[permute]([1,4,5])[i,j],[Luke,Zick,Hank][j]],j=1..3)],i=1..6)]:

L2:=[seq([[3,Paul],[4,Sam],seq([combinat[permute]([1,2,5])[i,j],[Luke,Zick,Hank][j]],j=1..3)],i=1..6)]:

L0:=[op(L1),op(L2)]:

L:=[seq(op(combinat[permute](L0[i])),i=1..nops(L0))]:

Sol:=[]:

for l in L do

for s in S do

sol:=[seq([op(l[i]),s[i]], i=1..5)]:

gad1:=op(select(has,sol,parsley)): gad2:=op(select(has,sol,Zick)):

if abs(gad1[1]-gad2[1])=1 and convert([seq(((pear in sol[i][3] implies (sol[i][1]=1 or sol[i][1]=5)) and (sol[i][2]=Paul implies (not lily in sol[i][3])) and (sol[i][1]=1 implies (apple in sol[i][3] and cherry in sol[i][3])) and (sol[i][2]=Sam implies (onion in sol[i][3] and cherry in sol[i][3])) and (sol[i][2]=Luke implies nops(`intersect`(sol[i][3],Fruits))=2) and (sol[i][2]=Hank implies (`intersect`(sol[i][3],Vegetables)={} and not aster in sol[i][3])) and (sol[i][2]=Paul implies nops(`intersect`(sol[i][3],Vegetables))=3)), i=1..5)], `and`) then Sol:=[op(Sol), sol]: fi:

 

od: od:

for i in Sol do

Matrix(sort(i,(x,y)->x[1]<y[1]));

od;

 

 

In this post we present another compact proof of this remarkable theorem without using  geometry package.
The proof uses a procedure called  Cc , which for three points returns a list of the coordinates of the center and the radius of the circumscribed circle.

restart;

Cc:=proc(A,B,C)

local x1, y1, x2, y2, x3, y3, x, y;

x1,y1:=op(A);  x2,y2:=op(B);  x3,y3:=op(C);

solve({(x2-x1)*(x-(x1+x2)/2)+(y2-y1)*(y-(y1+y2)/2)=0, (x2-x3)*(x-(x2+x3)/2)+(y2-y3)*(y-(y2+y3)/2)=0},{x,y});

assign(%);

[simplify([x,y]), simplify(sqrt((x-x1)^2+(y-y1)^2))];

end proc:

Proof for arbitrary triangle:

A, B, C:=[x1,y1], [x2,y2], [x3,y3]:

A1, B1, C1, M:=(B+C)/2, (A+C)/2, (A+B)/2, (A+B+C)/3:

P1:=Cc(A,M,B1)[1]: P2:=Cc(B1,M,C)[1]: P3:=Cc(C,M,A1)[1]:

P4:=Cc(A1,M,B)[1]: P5:=Cc(B,M,C1)[1]: P6:=Cc(C1,M,A)[1]:

Cc1:=Cc(P1,P2,P3):  Cc2:=Cc(P4,P5,P6):

is(Cc1=Cc2);

                                                  true

Let  us consider the general case of symbolic values C(xC,yC). I make use of the idea suggested by edgar in http://www.mapleprimes.com/questions/97743-How-To-Prove-Morleys-Trisector-Theorem : no assumptions.

restart; with(geometry); point(A, 0, 0);
point(B, 1, 0);
point(C, xC, yC);
point(MA, (xC+1)*(1/2), (1/2)*yC);
point(MC, 1/2, 0);
point(MB, (1/2)*xC, (1/2)*yC);
point(E, (0+1+xC)*(1/3), (0+0+yC)*(1/3));# the center of mass
line(l1, x = 1/4, [x, y]);
The coordinates of the center of the first described circle are found as the solutions of the system of the equations of midperpendiculars.

midpoint(ae, A, E); coordinates(ae);


S1 := solve({x = 1/4, ((xC+1)*(1/3))*(x-(xC+1)*(1/6))+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

BTW, Maple can't create the midperpendiculars in this case.

point(O1, op(map(rhs, S1)));
                               O1

Simple details are omitted in the above. The coordinates of the centers of the two next described circles are found similarly.
coordinates(midpoint(mce, MC, E));

S2 := solve({x = 3/4, ((-1/2+xC)*(1/3))*(x-5/12-(1/6)*xC)+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

point(O2, op(map(rhs, S2)));

                               O2
coordinates(midpoint(bma, B, MA)); coordinates(midpoint(be, B, E));
  

                

S3 := solve({(xC-1)*(x-(xC+3)*(1/4))+yC*(y-(1/4)*yC) = 0, ((-2+xC)*(1/3))*(x-(4+xC)*(1/6))+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

point(O3, op(map(rhs, S3)));

                               O3

Now we find the equation of the circumference which passes through O1, O2, and O3.

eq := a*x+b*y+x^2+y^2+c = 0:
sol := solve({eval(eq, S1), eval(eq, S2), eval(eq, S3)}, {a, b, c});

A long output can be seen in the attached .mw file.

eq1 := eval(eq, sol);

  Now we find (in suspense)  the coordinates of the next center and verify whether it belongs to the sircumference O1O2O3.

coordinates(midpoint(mac, C, MA)); coordinates(midpoint(ec, E, C)); S4 := solve({(xC-1)*(x-(3*xC+1)*(1/4))+yC*(y-3*yC*(1/4)) = 0, ((2*xC-1)*(1/3))*(x-(4*xC+1)*(1/6))+(2*yC*(1/3))*(y-4*yC*(1/6)) = 0}, {x, y});

 point(O4, op(map(rhs, S4)));

                               O4
simplify(eval(eq1, S4));

                             0 = 0

Hope the reader will have a real pleasure to find the two residuary centers and to verify these on his/her own.

geom2.mw

 

 

 

 

It is well known that the medians of a triangle divide it into 6 triangles.
It is less known that the centers of their circumscribed circles belong to one circumference as drawn below

This remarkable theorem  was proved in the 21st century! Unfortunately, I lost its source.
I can't prove this difficult  theorem by hand. However, I can prove it with Maple.
The aim of this post is to expose these proofs. Everybody knows that it is scarcely possible
to construct a general triangle with help of the geometry package of Maple.
Without loss of generality one may assume that the vertex A is placed at the origin,
the vertex B is placed at (1,0), and the vertex C(xC,yC). We firstly consider the theorem
in the case of concrete values of xC and yC.

restart; with(geometry):with(plots):
point(A, 0, 0);
point(B, 1, 0);
xC := 15*(1/10); yC := sqrt(3); point(C, xC, yC);
triangle(T, [A, B, C]);
median(mA, A, T, MA);
median(mB, B, T, MB);
median(mC, C, T, MC);
line(m1, [A, MA]);
line(m2, [B, MB]);
intersection(E, m1, m2);
triangle(AEMB, [A, E, MB]);
circumcircle(c1, AEMB, 'centername' = C1);
circumcircle(c2, triangle(CEMB, [C, E, MB]), 'centername' = C2);
circumcircle(c3, triangle(CEMA, [C, E, MA]), 'centername' = C3);
circumcircle(c4, triangle(BEMA, [B, E, MA]), 'centername' = C4);
circumcircle(c5, triangle(BEMC, [B, E, MC]), 'centername' = C5);
circumcircle(c6, triangle(AEMC, [A, E, MC]), 'centername' = C6);
circle(CC, [C1, C2, C3]);
IsOnCircle(C4, CC);
                              true

IsOnCircle(C5, CC);
                              true
IsOnCircle(C6, CC);
                              true
display([draw([T(color = black), mA(color = black), mB(color = black), mC(color = black), C1(color = blue), C2(color = blue), C3(color = blue), C4(color = blue), C5(color = blue), C6(color = blue), CC(color = red)], symbol = solidcircle, symbolsize = 15, thickness = 2, scaling = constrained), textplot({[-0.5e-1, 0.5e-1, "A"], [.95, 0.5e-1, "B"], [xC-0.5e-1, yC+0.5e-1, "C"]})], axes = frame, view = [-.1 .. max(1, xC)+.1, 0 .. yC+.1]);

This can be done as a procedure in such a way.

restart; SixPoints := proc (xC, yC) geometry:-point(A, 0, 0); geometry:-point(B, 1, 0); geometry:-point(C, xC, yC); geometry:-triangle(T, [A, B, C]); geometry:-median(mA, A, T, MA); geometry:-median(mB, B, T, MB); geometry:-median(mC, C, T, MC); geometry:-line(m1, [A, MA]); geometry:-line(m2, [B, MB]); geometry:-intersection(E, m1, m2); geometry:-triangle(AEMB, [A, E, MB]); geometry:-circumcircle(c1, AEMB, 'centername' = C1); geometry:-circumcircle(c2, geometry:-triangle(CEMB, [C, E, MB]), 'centername' = C2); geometry:-circumcircle(c3, geometry:-triangle(CEMA, [C, E, MA]), 'centername' = C3); geometry:-circumcircle(c4, geometry:-triangle(BEMA, [B, E, MA]), 'centername' = C4); geometry:-circumcircle(c5, geometry:-triangle(BEMC, [B, E, MC]), 'centername' = C5); geometry:-circumcircle(c6, geometry:-triangle(AEMC, [A, E, MC]), 'centername' = C6); geometry:-circle(CC, [C1, C2, C3]); return geometry:-IsOnCircle(C4, CC), geometry:-IsOnCircle(C5, CC), geometry:-IsOnCircle(C6, CC), geometry:-draw([CC(color = blue), C1(color = red), C2(color = red), C3(color = red), C4(color = red), C5(color = red), C6(color = red), T(color = black), mA(color = black), mB(color = black), mC(color = black), c1(color = green), c4(color = green), c2(color = green), c3(color = green), c5(color = green), c6(color = green)], symbol = solidcircle, symbolsize = 15, thickness = 2) end proc;
SixPoints(1.5, 1.2);

true, true, true, PLOT(...)
 SixPoints(1.5, 1.2)[4];

See geom1.mw

To be continued (The general case will be considered in  part 2http://www.mapleprimes.com/posts/200210-Six-Points-On-Circumference-2 .).

 

 





 

I am using "Maple 15" and "Windows 7" and I want to share the tip for using "Classic worksheet" and "GR Tensor". Windows 7 is 64-bit but you can use Classic worksheet and GR Tensor, which work basically in 32-bit, by simply downlording "32-bit Maple 15" !! I haven't tried other more current versions of Maple but Maple 15 works well: you can choose 32-bit Maple in the download options.

Enjoy the Classic worksheet and GR Tensor. Good luck !  

 

Code of the animation:

restart;

N := 192:

A := seq(plot([[.85*sin(t)^3-2+1.25*i/N, .85*(13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t)), t = 0 .. Pi*i/N], [-.85*sin(t)^3-2+1.25*i/N, .85*(13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t)), t = 0 .. Pi*i/N], [sin(t)^3+2-1.25*i/N, 13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t), t = 0 .. Pi*i/N], [-sin(t)^3+2-1.25*i/N, 13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t), t = 0 .. Pi*i/N]], color = red, thickness = 5, view = [-3 .. 3, -1.2 .. .9]), i = 1 .. N):

plots[display](A, insequence = true, scaling = constrained, axes = none);

Congratulations to Andriy Andrusyk, from the Institute for Condensed Matter Physics of the National Academy of Sciences of Ukraine, who won last quarter’s Möbius Challenge with his application Heat Equation.  Dr. Andrusyk won a DSLR Camera Prize Pack.

Remember that you have until Mar. 31 to enter your Möbius Apps for a chance to win the next prize, an Xbox One!   Visit Möbius App Challenge for full contest details.

 

eithne

I thought it would be interesting to review what happened with Physics in Maple during 2013. The proposed theme for the Physics project was the consolidation and integration of the package with the rest of the Maple library. There were more than 500 changes, enhancements in most of the Physics commands, plus 17 new Physics:-Library commands. The impact of these changes is across the board, from Vector Analysis to Quantum Mechanics, Relativity and Field Theory.

Consolidation of the Physics package is about making it robust and versatile in real case scenarios. With the launch of the Physics: Research and Development updates webpage, Maplesoft has pioneered feedback, adjustments in the package and new developments provided around the clock for all of its users. The result of this accelerated exchange with people around the world is what you find in Maple's updated Physics today.

In addition to changes improving the functionality in mathematical-physics, changes were introduced towards making the computational experience as natural as possible, now including textbook-like typesetting of inert forms for the whole mathematical language and vectorial differential operators.

Physics doubled in size in Maple 16, almost doubled again in Maple 17, and during 2013 Physics received the largest number of changes ever in the package in one year. We are aiming for real to provide a state-of-the-art environment for algebraic computations in Physics. The links at the end show the same but with the Examples sections expanded.

Simplify

 

Simplification is perhaps the most common operation performed in a computer algebra system. In Physics, this typically entails simplifying tensorial expressions, or expressions involving noncommutative operators that satisfy certain commutator/anticommutator rules, or sums and integrals involving quantum operators and Dirac delta functions in the summands and integrands. Relevant enhancements were introduced for all these cases.

Examples

   

4-Vectors, Substituting Tensors

 

In Maple 17, it is possible to define a tensor with a tensorial equation, where the tensor being defined is on the left-hand side. Then, on the right-hand side, you write either a tensorial expression with free and repeated indices, or a Matrix or Array with the components themselves. With the updated Physics, you can also define a 4-Vector with a tensorial equation, where you indicate the vector's components on the right-hand side as a list.

One new Library routine specialized for tensor substitutions was added to the Maple library: SubstituteTensor, which substitutes the equation(s) Eqs into an expression, taking care of the free and repeated indices, such that: 1) equations in Eqs are interpreted as mappings having the free indices as parameters, and 2) repeated indices in Eqs do not clash with repeated indices in the expression. This new routine can also substitute algebraic sub-expressions of type product or sum within the expression, generalizing and unifying the functionality of the subs and algsubs  commands for algebraic tensor expressions.

Examples

   

Functional Differentiation

 

The Physics:-Fundiff command for functional differentiation has been extended to handle all the complex components ( abs , argument , conjugate , Im , Re , signum ) and vectorial differential operators in order to compute field equations using variational principles when the field function enters the Lagrangian together with its conjugate. For an example illustrating the use of the new capabilities in the context of a more general problem, see the MaplePrimes post Quantum Mechanics using Computer Algebra.

Examples

   

More Metrics in the Database of Solutions to Einstein's Equations

 

A database of solutions to Einstein's equations  was added to the Maple library in Maple 15 with a selection of metrics from "Stephani, H.; Kramer, D.; MacCallum, M.; Hoenselaers, C.; and Herlt, E.,  Exact Solutions to Einstein's Field Equations" and "Hawking, Stephen; and Ellis, G. F. R., The Large Scale Structure of Space-Time". More metrics from these two books were added for Maple 16 and Maple 17. These metrics can be searched using the command DifferentialGeometry:-Library:-MetricSearch, or directly using g_ (the Physics command representing the spacetime metric that also sets the metric to your choice).

• 

With the updated Physics, fifty more metrics are available in the database from Chapter 28 of the aformentioned book entitled "Exact Solutions to Einstein's Field Equations".

• 

It is now possible to list all the metrics of a chapter by indexing the metric command with the chapter's number, for example, entering g_["28"].

Examples

   

Commutators, AntiCommutators

 

When computing with products of noncommutative operators, the results depend on the algebra of commutators and anticommutators that you previously set. Besides that, in Physics, various mathematical objects themselves satisfy specific commutation rules. You can query about these rules using the Library commands Commute and Anticommute. Previously existing functionality and enhancements in this area were refined and implemented during 2013. Among them:

• 

Both Commutator and AntiCommutator now accept matrices as arguments.

• 

The AntiCommutator of products of fermionic operators - for instance annihilation and creation operators - is now derived automatically from the intrinsic anticommutation rules they satisfy.

• 

Commutators and Anticommutators of vectorial quantum operators `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`, `#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`, are now implemented and expressed using the dot (scalar) product, as in Physics:-Commutator(`#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`, `#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`) = `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`.`#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`-`#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`.`#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`

• 

If two noncommutative operators a and S  satisfy "[a^(&dagger;),S][-]=0" , then the commutator  "[a,S^(&dagger;)][-]" is automatically taken equal to 0; if in addition S is Hermitian, then  "[a,S][-]"is also automatically taken equal to zero.

Examples

   

Expand and Combine

 

In the context of Physics, the expansion and recombination of algebraic expressions requires additional care: products may involve non-commutative operators and then some of the standard expansion and combination rules do not apply, or apply differently. Similarly, the expansion of vectorial operators also follows special rules. During 2013, many of these algebraic operations were reviewed and related special formulas (such as Glauber's and Haussdorf's) were implemented.

Examples

   

New Enhanced Modes in Physics Setup

 

Four enhanced modes were added to the Physics setup. With these modes, you can:

1. 

Indicate the real objects of a computation.

2. 

Automatically combine powers of the same base.

3. 

Set Maple to take z and its conjugate, "z," as independent variables and in equal footing; this is Wirtinger calculus.

4. 

Redefine the sum command in order to perform multi-index summation.

These options combined provide flexibility, subsequently making the Physics environment more expressive.

Real Objects

   

Combining Powers of the Same Base

   

Complex variables: z and conjugate(z) in equal footing

   

Redefine Sum for Multi-Index Summation

   

Dagger

 

Physics:-Dagger now has the same shortcut notation of Hermitian transpose , which acts on Vectors, vector products, equations, and automatically maps over the arguments of derivatives when the differentiation variables are real.

Examples

   

Vectors Package

 

A number of changes were performed in the Vectors subpackage to make the computations more natural and versatile:

• 

You can now use geometrical coordinates indexed, as in r[j], to represent mathematical objects unrelated to the coordinates themselves (in this case the spherical coordinate r).  This is a more appropriate mimicry of the way we compute with paper and pencil.

• 

Integrate the Vectors package commands with assuming and accept a tensor with 1 index (of type Library:-PhysicsType:-Tensor, defined using Define) as a possible abstract representation of the kth component of a vector.

• 

When V is a vector of the Physics:-Vectors package, make its absolute value abs(V), compute automatically using Physics:-Vectors:-Norm

• 

For an arbitrary vector  `#mover(mi("A"),mo("&rarr;"))`, make its Norm LinearAlgebra[Norm](`#mover(mi("A"),mo("&rarr;"))`) = "A*(A)," and introduce a new option conjugate to Norm, to specify whether to use `#mover(mi("A"),mo("&rarr;"))`.conjugate(`#mover(mi("A"),mo("&rarr;"))`) or `#mover(mi("A"),mo("&rarr;"))`.`#mover(mi("A"),mo("&rarr;"))` when computing LinearAlgebra[Norm](`#mover(mi("A"),mo("&rarr;"))`).

• 

When `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))` is a quantum operator, Norm returns using Dagger instead of conjugate.

• 

Commutators and Anticommutators of vectorial quantum operators `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`, `#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`, are now implemented and expressed using the dot (scalar) product, as in "[A,B][-]=A*B-B*A . "

• 

New PhysicsVectors type in the Library of types Library:-PhysicsTypes, in order to programmatically identify vectors of the Physics:-Vectors package.

 

Two examples illustrating the use of the new capabilities in the context of a more general problem are found in the MaplePrimes posts Quantum Mechanics using Computer Algebra and Quantum Mechanics (II).

Examples

   

Library

 

Seventeen new commands, useful for programming and interactive computation, were added to the Physics:-Library package. These are:

• 

Add unifies the standard add and sum commands using a more modern handling of arguments, free of premature evaluation problems, and brings new multi-index functionality.

• 

ApplyCommandUsingImplicitAssumptions applies any command to expressions containing sums, integrals or products such that the command is applied to the summand (integrand or 1st argument of the product) taking into account the assumptions implicit in the summation (integration or product) range.

• 

CombinePowersOfSameBase combines powers of the same base in products correctly handling the case of noncommutative products and powers, using Glauber's formula.

• 

FromTensorFunctionalForm is a generalization of the former FromGeneralRelativityTensorFunctionalForm command, that also handles user defined tensor functions.

• 

GetFAndDifferentiationVariables receives a derivative and returns a sequence with derivand and all the differentiation variables.

• 

GetReplacementIndices receives a list of indices of different kinds (spacetime, space, spinor, etc) and any other arguments and returns a list with new indices of the same kinds - useful for replacements - not present in the rest of the arguments.

• 

GetSymbolsWithSameType receives an expression x, of type commutative, anticommutative or noncommutative, and any other arguments, and returns symbols of the same type as x, and not present in the rest of arguments.

• 

GetTensorDependency gets the dependency of a given tensor; this dependency typically depends of the spacetime metric or on the way you defined the tensor using Define.

• 

GetTensorFunctionalForm is a generalization of the former GetGeneralRelativityTensorFunctionalForm command, that also handles user defined tensor functions.

• 

IsLiteralSubscript returns true or false according to whether a symbol s is of the form x__y, that is, it has the substring __ after the first or next characters and before the last one.

• 

IsRealObject returns true or false according to whether a mathematical expression, function or variable passed is known to be real, either because it was assumed to be real, or because it was set to be real using Setup and its realobjects keyword.

• 

RealObjects sets and unsets mathematical variables and functions as real, and answers queries about them.

• 

SortProducts sorts the operands of noncommutative products into any particular desired ordering while taking into account commutator and anticommutator algebra rules, such that the returned product is mathematically equivalent to the one received.

• 

SubstituteTensor substitutes equations into an expression, taking care of the free and repeated indices such that: 1) the substitution equations are interpreted as mappings having the free indices as parameters, and 2) repeated indices in the substitution equations do not clash with existing repeated indices in the target expression.

• 

ToContravariant and ToCovariant rewrite a given expression multiplying by the spacetime metric so that all of its free indices become respectively contravariant or covariant.

• 

ToTensorFunctionalForm reverses the operation performed by the new FromTensorFunctionalForm described above.

Examples

   

Miscellaneous

 
• 

Implement formulas for abstract k, n both nonnegint entering "`a+`^k*| A[n] >" and "a(-)^k*| A[n] >", where `a+` and "a-" are Creation and Annihilation operators, respectively, acting on the 1st quantum number of the space of quantum states labeled A.

• 

Implement new PDEtools:-dchange rules for changing variables in Bras Kets and Brackets of the Physics package

• 

Library:-Degree can now compute the degree for noncommutative products Enhance PDEtools:-Library:-Degree and PDEtools:-Coefficients, to work with Physics:-`.` the same way it does with Physics:-`*`

• 

Changes in design:

a. 

When the spacetime is Euclidean, there is no difference in value between the covariant and contravariant components of a tensor. Therefore, represent both with covariant indices making simplification and all manipulations simpler. This change affects the display of indices on the screen as well as the output of SumOverRepeatedIndices.

b. 

The dot product A . B of quantum operators A and B now returns as a (noncommutative) product  A * B when neither A nor B involve Bras or Kets.

c. 

When A is a quantum operator (generic, Hermitian or unitary), the literal subscript object A__x is now considered an operator of the same kind.

d. 

Normal normalizes powers of the same base (including exponentials) by combining them. For example, A^n*A^m "->A^(n+m)."

e. 

Normal normalizes noncommutative products by sorting objects that commute between themselves putting those that involve Dagger and conjugate to the left, more aligned with normal ordering in quantum field theories.

f. 

FeynmanDiagrams does not return any crossed propagators unless explicitly requested using the new option includecrossedpropagators. The former option, normalproducts, was renamed as externallegs.

Examples

   

See Also

 

The Physics project, Physics, what is new in Physics in Maple 17, what is new in Physics in Maple 16

 

Physics2013.pdf    Physics2013.mw

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Maplesoft is holding its first ever Virtual User Summit on Feb. 27.  You’ll be able to watch presentations by both Maplesoft and Maplesoft customers, ask questions, have discussions in the lounge with other attendees, and even enter a draw, all from the comfort of your own home or office.

Here’s the agenda.  We’ll release more detailed information on speakers and session times in the next couple of weeks.

For more information and to register:  Maplesoft Virtual User Conference

We're looking forward to seeing you there. (Well, "seeing you" :-))

eithne

I'd like to pay attention to an application "Periodicity of Sunspots " by Samir Khan, where a real data is analysed. That application can be used in teaching statistics.

PS. The code by Samir Khan works well for me.

Voting is open for the next individual prize to be awarded as part of the Möbius App Challenge.  The winner will receive a DSLR Camera Prize Pack! 

Here are the finalist Apps:

If you do not have the latest version of Java installed, released last week, you may have problems viewing these apps, as older versions of Java seem to be quietly disabling themselves.  I’ve attached a zip file of the finalist Apps in case it is helpful. finalists.zip

Note that, if you ever have any problems viewing Apps in your browser, or simply want to work offline, you can always download a Möbius App and view it in Maple or the free Maple Player. To download a Möbius App, follow the link to the App and then click on the Download button near the top left of the page.

You can vote for your favorite through our Facebook page or, if you’re not on Facebook, send an email with your vote to Mobius-Project@maplesoft.com.

And remember, we are now accepting entries for the next quarterly prize. You could win an Xbox One!  See the Möbuis App Challenge for details.

Voting closes Jan. 30.

eithne

Greetings to all.

It is a new year (for some time now) and I am writing to indicate that the mathematical adventures with cycle index computations and Maple continue!

Here are the previous installments:

My purpose this time is to alert readers who might be interested to a new cycle index computation that is neither an application of the classical form of the Polya Enumeration Theorem (PET) nor of Power Group Enumeration. The former counts objects being distributed into slots with a group acting on the slots and the latter objects going into slots with a second group which permutes the objects in addition to the slots being permuted. What I am about to present treats a third possible case: when the slot permutation group and the object permutation group are one and the same and act simultaneously (not exactly the same but induced by the action of a single group).

This requires quite radical proceedings in the etymological sense of the word, which is to go back to the roots of a problem. It seems that after working with the PET sooner or later one is confronted with enumeration problems that demand the original unmitigated power of Burnside's lemma, sometimes called the lemma that is not Burnside's. This is the case with the following problem. Suppose you have an N-by-N matrix whose entries are values from 1 to N, with all assignments allowed and the symmetric group on N elements acts on the row and column indices permuting rows and columns as well as the entries simultaneously. We ask how many such matrices there are taking these double symmetries into account. This also counts the number of closed binary operations on a set of N elemnents and there is a discussion as well as the Maple code (quite simple in my opinion and no more than a few lines) that solves this problem at the following Math Stackexchange link, which uses Lovasz Formula for the cycle index of the symmetric group which some readers may remember.

In continuing the saga of Polya and Burnside exploration I have often reflected on how best to encapsulate these techniques in a Maple package. With this latest installment it would appear that a command to do Burnside enumeration probably ought to be part of such a package.

Best regards,

Marko Riedel

First 44 45 46 47 48 49 50 Last Page 46 of 71