398 Reputation

8 Badges

4 years, 327 days

MaplePrimes Activity

These are answers submitted by Pascal4QM


A possible way is to define a formal differential operator within the Physics package. It can be define with an arbitrary function and trigged at will. For an exemple, have look at:

Of course, it must be adapted to your need.


Using "Component", it is possible to reconstruct a Vector:

V := Vector([seq(Component(q_, k), k = 1 .. 3)])


Try -3 - (-5) or  4*(-10), It should work as expected.

 However, I agree that an expression like -3 - -5 should work without parentheses in Maple, mathematically the expression is correct, surprising. Entering -3-+-5 or 4*-10 in Matlab gives the expected result.


I think that using the new Physics:-Latex with alias, there is even no need for replacing.


sol := dsolve(diff(x(t), `$`(t, 3)) = x(t))

x(t) = _C1*exp(t)+_C2*exp(-(1/2)*t)*sin((1/2)*3^(1/2)*t)+_C3*exp(-(1/2)*t)*cos((1/2)*3^(1/2)*t)


alias(seq(c[k] = _C || k, k = 1 .. 3))

c[1], c[2], c[3]


latex(x(t) = _C1*exp(t)+_C2*exp(-(1/2)*t)*sin((1/2)*3^(1/2)*t)+_C3*exp(-(1/2)*t)*cos((1/2)*3^(1/2)*t))

x \left( t \right) ={\it \_C1}\,{{\rm e}^{t}}+{\it \_C2}\,{{\rm e}^{-{
\frac {t}{2}}}}\sin \left( {\frac {\sqrt {3}t}{2}} \right) +{\it \_C3}
\,{{\rm e}^{-{\frac {t}{2}}}}\cos \left( {\frac {\sqrt {3}t}{2}}


Physics:-Latex(x(t) = _C1*exp(t)+_C2*exp(-(1/2)*t)*sin((1/2)*3^(1/2)*t)+_C3*exp(-(1/2)*t)*cos((1/2)*3^(1/2)*t))

x \left(t \right) =
c_{1} {\rm e}^{t}+c_{2} {\rm e}^{-\frac{t}{2}} \sin \left(\frac{\sqrt{3} t}{2}\right)+c_{3} {\rm e}^{-\frac{t}{2}} \cos \left(\frac{\sqrt{3} t}{2}\right)







use add instead of sum, it should work.

You might define a differential operator


restart; with(Physics); with(Physics[Vectors]); interface(imaginaryunit = I)

Setup(differentialoperators = {[N_, [x, y, z]]})

[differentialoperators = {[N_, [x, y, z]]}]


CompactDisplay(f(x, y, z))

` f`(x, y, z)*`will now be displayed as`*f


N_ := proc (f) options operator, arrow; %Nabla(f) end proc

proc (f) options operator, arrow; %Nabla(f) end proc


N_^4*f(x, y, z)

Physics:-`*`(Physics:-`^`(N_, 4), f(x, y, z))


Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](Physics[`^`](N_, 4), f(x, y, z)))

%Nabla(%Nabla(%Nabla(%Nabla(f(x, y, z)))))


value(%Nabla(%Nabla(%Nabla(%Nabla(f(x, y, z))))))

diff(diff(diff(diff(f(x, y, z), x), x), x), x)+2*(diff(diff(diff(diff(f(x, y, z), x), x), y), y))+2*(diff(diff(diff(diff(f(x, y, z), x), x), z), z))+diff(diff(diff(diff(f(x, y, z), y), y), y), y)+2*(diff(diff(diff(diff(f(x, y, z), y), y), z), z))+diff(diff(diff(diff(f(x, y, z), z), z), z), z)







With Physics package, to get this feature, V should be declared as a quantum operator. Also, use Dagger instead of Transpose, or V_^*.

Setup(quantumoperators = V);

This question is related:



L := [1, 2, 3, 4, 5];
                      L := [1, 2, 3, 4, 5]




I have the same sometime. Just enter "restart" and this should load the last version, even if the message is the same. Otherwise, just close your worksheet and reopen it, it should work fine.


There are several ways. You can use "indets" to extract the variable of an expression, and then "select" according particular properties. For instance, assuming x and y have a t depedency, while A and B are independent of that parameter:

EE := (x(t)/A)^2 + (y(t)/B)^2 = 1;
                              2       2    
                          x(t)    y(t)     
                    EE := ----- + ----- = 1
                            2       2      
                           A       B       

FF := indets(EE);
                  FF := {A, B, t, x(t), y(t)}

select(u -> type(u, freeof(t)), FF);
                             {A, B}



In addition to Edgardo's recommendations, you could try to close the palettes (left Panel). There is a known issue at startup for Maple 2020 involving those palettes. Once Maple has started again, you can reopen the required palettes.


The LinearAlgebra algebra package has a trace function.

Either enter:


or, load the package :



Note, there is also a Trace function within the Physics package. In addition to standard Matrix, it can work on special matrices such as the Pauli or the Dirac matrices.



Functional derivative, that is derivative of a function with respect to another one, is supported within the Physics package. For instance:

ee := diff(f(t), t)^2;
                             / d      \
                       ee := |--- f(t)|
                             \ dt     /

diff(ee, diff(f(t), t));
                            / d      \
                          2 |--- f(t)|
                            \ dt     /


In your code, just add "with(Physics):" after restart, and there will be no error message anymore.

You could also have a look at the Fundiff function. Enter ?Physics:-Fundiff


Entering whattype(a) will return "set".

Hi, maybe CodeTools:-ProgramAnalysis:-StaticCallGraph might be helpful. This is new to Maple 2020.

1 2 3 4 Page 1 of 4