Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Can I define the creation and annihilation operator commutation relations with an explicit momentum dependence?

The goal is to implement an expression of a discrete scalar plane-wave solution to the Klein-Gordon equation that makes use of the creation and annihilation operators in the Physics package.

We don't bother solving the Klein-Gordon equation explicitly. Instead, we just take a solution from literature. This approach is sufficient to show the difficulty in defining the the creation and annihilation operators in this way.

how_to_define_creation_and_annihilation_operators_with_a_momentum_dependence.mw

restart

Setup

   

NULL``

Goal

   

NULL``

Define Creation and Annihilation Operators for Quantum Field phi

   

NULL

Static Textbook Solution

   

NULL

Commutator Definition Attempt 1 FAIL

   

NULL``

Commutator Definition Attempt 2 FAIL

   

NULL``

Commutator Definition Attempt 3 FAIL

   

NULLNULL

Commutator Definition Attempt 4 FAIL

   

NULL``

Commutator Definition Attempt 5 FAIL

   

So, is defining the creation and annihilation operators with a momentum dependence even possible, using the physics MAPLE package?

Download how_to_define_creation_and_annihilation_operators_with_a_momentum_dependence.mw

Whenever I have local proc inside a proc, and use local variables from the outer proc inside it, Mint tells me that the variables are not used.

This can't be right. Why does it say that? Here is MWE. I have this foo.mpl file

foo := proc()

local C1;
local y,x;

    proc()
        C1:= `tools/genglobal`(_C); 
        sol:=y(x)=  C1; 
    end proc();

end proc;

We see clearly that C1 is used, also x and y are used. There can be more code using these inside the inner proc. But this is what mint says

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\mint.exe" foo.mpl

    |\^/|      Maple 2024 Diagnostic Program
._|\|   |/|_.  Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2024
 \  MINT   /   All rights reserved. Maple is a trademark of
 <____ ____>   Waterloo Maple Inc.
      |
Procedure foo() on lines 1 to 11
  These local variables were never used:  C1, x, y

Any idea why it says these are not used?

Also, I noticed it did not warn me that variable sol is global inside the proc. i.e. I was expecting something like this 

          These names were used as global names but were not declared: sol

Which is typical message mint gives when using a name inside a proc which was not declared,

Maple 2024.2 on Windows

Hi Maple lovers, and others,

I wrote up some simple Maple code that 
checks if an expression (a^3+2) is a prime number.

The output fits on one page of paper.
n_cubed_plus_2.mw

n_cubed_plus_2.pdf

Also, I have an account at mersenneforum.org

Kindest Regards,

Matt

PS Does this help?  The code works.

I have a square matrix of data points. Each point is between 0 to 0.2. I wish to plot it and set the axes to values from 0 to 1. I want the 3D plot to be plotted with a constrained scaling. The two options I have are plots:-matrixplot and plots:-surfdata. 

* matrixplot can constrain the data, but it isn't obvious how to change the axes so that it shows from 0 to 1 in both directions. 

* In surfaceplot, it is easy to adjust the axes values, but scaling=constrained does nothing. 

(I assume someone else might also appreciate the answer. So, instead of me continuing to struggle, I post here and hope someone can answer without the use of many brain cells.) 

Example attached.

restart; N := 20; M := LinearAlgebra:-RandomMatrix(N, generator = rand(0 .. .2))

 

Scaling can be easily controlled, but labels are bad

plots:-matrixplot(N*M, labels = ["x", "y", "V"], scaling = constrained, axis = [tickmarks = [seq(0 .. 1, numelems = 10)]], size = [600, 600])

 

Axes are shown nicely, but scaling cannot be constrained.

plots:-surfdata(M, 0 .. 1, 0 .. 1, labels = ["x", "y", "V"], scaling = constrained, size = [600, 600])

 
 

NULL

Download Scaled_matrix_plot_with_axes.mw

 always i try to apply a technique like long wave limit to get my result, but this time when i do i reach zero so the author try to use another method which really i can't reach how they did and some term are dispear and some are remain , it about substituting and apply epsilon go to zero which i don't know how they apply, anyone can figure out how they reach the result, and maybe my letter and paper are not same about small and capital but it is so clear 

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

_local(gamma)

declare(u(x, y, z, t))

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

(2)

declare(f(x, y, z, t))

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

(3)

NULL

pde := diff(diff(u(x, y, z, t), t)+6*u(x, y, z, t)*(diff(u(x, y, z, t), x))+diff(u(x, y, z, t), `$`(x, 3)), x)-lambda*(diff(u(x, y, z, t), `$`(y, 2)))+diff(alpha*(diff(u(x, y, z, t), x))+beta*(diff(u(x, y, z, t), y))+gamma*(diff(u(x, y, z, t), z)), x)

diff(diff(u(x, y, z, t), t), x)+6*(diff(u(x, y, z, t), x))^2+6*u(x, y, z, t)*(diff(diff(u(x, y, z, t), x), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), x)-lambda*(diff(diff(u(x, y, z, t), y), y))+alpha*(diff(diff(u(x, y, z, t), x), x))+beta*(diff(diff(u(x, y, z, t), x), y))+gamma*(diff(diff(u(x, y, z, t), x), z))

(4)

pde_linear, pde_nonlinear := selectremove(proc (term) options operator, arrow; not has((eval(term, u(x, y, z, t) = a*u(x, y, z, t)))/a, a) end proc, expand(pde))

diff(diff(u(x, y, z, t), t), x)+diff(diff(diff(diff(u(x, y, z, t), x), x), x), x)-lambda*(diff(diff(u(x, y, z, t), y), y))+alpha*(diff(diff(u(x, y, z, t), x), x))+beta*(diff(diff(u(x, y, z, t), x), y))+gamma*(diff(diff(u(x, y, z, t), x), z)), 6*(diff(u(x, y, z, t), x))^2+6*u(x, y, z, t)*(diff(diff(u(x, y, z, t), x), x))

(5)

lambda := 1; alpha := 1; beta := 1; gamma := 1

1

 

1

 

1

 

1

(6)

NULL

thetai := t*w[i]+x*k[i]+y*l[i]+z*r[i]

t*w[i]+x*k[i]+y*l[i]+z*r[i]

(7)

NULL

eqw := w[i] = -(k[i]^4+k[i]^2+k[i]*l[i]+k[i]*r[i]-l[i]^2)/k[i]

w[i] = -(k[i]^4+k[i]^2+k[i]*l[i]+k[i]*r[i]-l[i]^2)/k[i]

(8)

NULL

Bij := proc (i, j) options operator, arrow; (3*k[i]^4*k[j]^2-6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)/(3*k[i]^4*k[j]^2+6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2) end proc

proc (i, j) options operator, arrow; (3*k[i]^4*k[j]^2-6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)/(3*k[i]^4*k[j]^2+6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2) end proc

(9)

NULL

eij := (3*k[i]^4*k[j]^2-6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)/(3*k[i]^4*k[j]^2+6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)

(3*k[i]^4*k[j]^2-6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)/(3*k[i]^4*k[j]^2+6*k[i]^3*k[j]^3+(3*k[j]^4+l[j]^2)*k[i]^2-2*k[i]*k[j]*l[i]*l[j]+k[j]^2*l[i]^2)

(10)

eval(eij, k[j] = b*k[i]); series(%, k[i], 3); convert(%, polynom); eval(%, b = k[j]/k[i]); Bij := (%-1)/(k[i]*k[j])

(3*k[i]^6*b^2-6*k[i]^6*b^3+(3*b^4*k[i]^4+l[j]^2)*k[i]^2-2*k[i]^2*b*l[i]*l[j]+b^2*k[i]^2*l[i]^2)/(3*k[i]^6*b^2+6*k[i]^6*b^3+(3*b^4*k[i]^4+l[j]^2)*k[i]^2-2*k[i]^2*b*l[i]*l[j]+b^2*k[i]^2*l[i]^2)

 

series(1+O(k[i]^4),k[i],4)

 

1

 

1

 

0

(11)

NULL


Download transformation.mw

If I understand right, in the following calling an exception should be raised since the return value of the matching coercion procedure is of course not of type “set”: 

restart;
foo := (x::coerce(set, (y::rtable) -> convert(y, list))) -> x:
foo(<0>);
 = 
                              [0]

Did I miss something?

So just like the title illustrates, I found a paper authored by Gary Nicklason in 2022: Autonomous Planar Systems of Riccati Type and in the last section it mentioned about a class of Abel ODE, which belongs to AIA(Abel Inverse Abel) class. It is of First kind and the inverse of it(by swapping variables) is of second kind.

While the first kind is solvable in terms of Airy function, the inverse of it along with its equivalence class is not solvable by the existing dsolve.

I have tested it in my worksheet Nicklason_equation.mw. So is it possible to add this class into the dictionary for solvable Abel ODE, or, maybe there are some bugs within the internal procedure of dsolve, which results in failure for catching the solvable candidates?

I want to remove the Lambert function (LambertW) from my equation, but I don't know how. I tried using the explicit option, but it didn't work. How can I express the equation without LambertW?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

declare(u(x, y, z, t))

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

(2)

declare(f(x, y, z, t))

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

(3)

pde := diff(diff(u(x, y, z, t), t)+6*u(x, y, z, t)*(diff(u(x, y, z, t), x))+diff(u(x, y, z, t), `$`(x, 3)), x)-lambda*(diff(u(x, y, z, t), `$`(y, 2)))+diff(alpha*(diff(u(x, y, z, t), x))+beta*(diff(u(x, y, z, t), y))+gamma*(diff(u(x, y, z, t), z)), x)

diff(diff(u(x, y, z, t), t), x)+6*(diff(u(x, y, z, t), x))^2+6*u(x, y, z, t)*(diff(diff(u(x, y, z, t), x), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), x)-lambda*(diff(diff(u(x, y, z, t), y), y))+alpha*(diff(diff(u(x, y, z, t), x), x))+beta*(diff(diff(u(x, y, z, t), x), y))+gamma*(diff(diff(u(x, y, z, t), x), z))

(4)

pde_nonlinear, pde_linear := selectremove(proc (term) options operator, arrow; not has((eval(term, u(x, y, t) = a*u(x, y, t)))/a, a) end proc, expand(pde))

0, diff(diff(u(x, y, z, t), t), x)+6*(diff(u(x, y, z, t), x))^2+6*u(x, y, z, t)*(diff(diff(u(x, y, z, t), x), x))+diff(diff(diff(diff(u(x, y, z, t), x), x), x), x)-lambda*(diff(diff(u(x, y, z, t), y), y))+alpha*(diff(diff(u(x, y, z, t), x), x))+beta*(diff(diff(u(x, y, z, t), x), y))+gamma*(diff(diff(u(x, y, z, t), x), z))

(5)

thetai := t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i]; eval(pde_linear, u(x, y, z, t) = exp(thetai)); eq15 := isolate(%, w[i])

t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i]

 

w[i]*k[i]*exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i])+12*k[i]^2*(exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i]))^2+k[i]^4*exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i])-lambda*l[i]^2*exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i])+alpha*k[i]^2*exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i])+beta*k[i]*l[i]*exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i])+gamma*k[i]*r[i]*exp(t*w[i]+x*k[i]+y*l[i]+z*r[i]+eta[i])

 

w[i] = -(t*k[i]^4+gamma*t*k[i]*r[i]+alpha*t*k[i]^2+beta*t*k[i]*l[i]-lambda*t*l[i]^2+LambertW(12*t*k[i]*exp(-(t*k[i]^4+alpha*t*k[i]^2+beta*t*k[i]*l[i]+gamma*t*k[i]*r[i]-lambda*t*l[i]^2-x*k[i]^2-y*k[i]*l[i]-z*k[i]*r[i]-eta[i]*k[i])/k[i]))*k[i])/(t*k[i])

(6)

sol := solve(eq15, w[i], explicit)

-(t*k[i]^4+gamma*t*k[i]*r[i]+alpha*t*k[i]^2+beta*t*k[i]*l[i]-lambda*t*l[i]^2+LambertW(12*t*k[i]*exp(-(t*k[i]^4+alpha*t*k[i]^2+beta*t*k[i]*l[i]+gamma*t*k[i]*r[i]-lambda*t*l[i]^2-x*k[i]^2-y*k[i]*l[i]-z*k[i]*r[i]-eta[i]*k[i])/k[i]))*k[i])/(t*k[i])

(7)
 

NULL

Download remove.mw

I have a system of polynomial equations where the unknowns are real numbers. The set of solutions is infinite (positive-dimensional). How can I compute the real dimension of the solution set (i.e. of a real algebraic variety)?

As it as mentioned in arXiv:2105.10255, this can be done using the RealTriangularize function from the RegularChains package. What is best way of getting the real dimension from the regular_semi_algebraic_system object, which is returned by this function?

I got email to register to "see" Maple 2025 :

for a special advanced look at Maple 2025

But I do not understand what does registering here means. Do I then get a link to some Maple internal URL to watch Video at that time? It says

Date/Time: Tuesday, March 18, 2025 at 11:00 AM
Language: English
Duration: 1 hour

If I register, then what happens?  do I get a link that opens at the time time to watch it? If so, why does one have to register to watch a Maple video? Why is the link not made public for any one to watch? Does one have to be at the browser at that exact time for the link to open?

I just do not know what a Maple webinar means.  Is it like a youtube video?

Hi,

Would someone please help me with how to achieve this cool animation shown here.

3d plot

How i can add lebel inside graph  like this picture for some graph , in somecoding i have but i can't how it work i want add to  my code but i can't do the same as paper did

label.mw

I am trying to find the most compact form of the symbolic matrix exponential of the specific 4x4 input matrix with the following form:

where all variables are non-negative real constants, with the additional problem specific conditions:

1. omega__1 + omega__2 = 1 

2. f__p + f__d1 + f__d2 = 1

There are many mathematically identical subterms at the matrix exponential, so I would like to use a few proper substitute subexpressions, but Maple does not apply it, without any error or warning message.

Moreover, I have no idea how to incorporate above-mentioned additional conditions into the simplification process.

expFT_compact.mw

I will be very happy for any help with this problem.

Michal

I am very interested in problems of integration and limit determination. In order to be able to continue other work with the help of Maple, I would like some advice on solving the following problem. The solution I know of using pen and paper is very tiring, perhaps Maple can make it easier:

To calculate Int(from 0 to 1)[ln(x)*ln(1-x)]dx
or, for obvious reasons, formulated differently:
Let eps, delta>0. Calculate
lim(eps, delta-->0)Int(0+eps to 1-delta)[ln(x)*ln(1-x)]dx

First 12 13 14 15 16 17 18 Last Page 14 of 2199